From 7c56622ace1da1d3fe73c10049d6642631a60e80 Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Tue, 24 Aug 2004 02:44:38 +0000 Subject: "" svn path=/trunk/; revision=1973 --- externals/grill/vst/src/main.cpp | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'externals/grill/vst/src') diff --git a/externals/grill/vst/src/main.cpp b/externals/grill/vst/src/main.cpp index 13205a4d..00804e53 100644 --- a/externals/grill/vst/src/main.cpp +++ b/externals/grill/vst/src/main.cpp @@ -19,7 +19,7 @@ WARRANTIES, see the file, "license.txt," in this distribution. #include -#define VST_VERSION "0.1.0pre13" +#define VST_VERSION "0.1.0pre14" class vst: @@ -473,8 +473,27 @@ V vst::m_signal(I n,R *const *insigs,R *const *outsigs) int i,mx = CntInSig(); if(mx > CntOutSig()) mx = CntOutSig(); - for(i = 0; i < mx; ++i) - CopySamples(outsigs[i],insigs[i],n); + if(mx == 1) { + CopySamples(outsigs[0],insigs[0],n); + i = 1; + } + else if(mx == 2) { + R *o1 = outsigs[0],*o2 = outsigs[1]; + const R *i1 = insigs[0],*i2 = insigs[1]; + for(int s = 0; s < n; ++s) { + const R f = *(i1++); + *(o2++) = *(i2++); + *(o1++) = f; + } + i = 2; + } + else + for(i = 0; i < mx; ++i) { + // must copy via temporary buffer as ordering of output signals can collide with input signals + CopySamples(tmpin[i],insigs[i],n); + CopySamples(outsigs[i],tmpin[i],n); + } + for(; i < CntOutSig(); ++i) ZeroSamples(outsigs[i],n); } -- cgit v1.2.1