diff --git a/dsp/cmDspPgmKr.c b/dsp/cmDspPgmKr.c index b8d3e14..1c32c63 100644 --- a/dsp/cmDspPgmKr.c +++ b/dsp/cmDspPgmKr.c @@ -61,8 +61,6 @@ cmDspRC_t krLoadRsrc(cmDspSysH_t h, cmErr_t* err, krRsrc_t* r) cmDspRsrcString(h,&r->midiDevice, "midiDevice", NULL); cmDspRsrcString(h,&r->midiOutPort, "midiOutPort", NULL); - - if((rc = cmDspSysLastRC(h)) != kOkDspRC ) cmErrMsg(err,rc,"A KR DSP resource load failed."); @@ -364,6 +362,7 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr ) cmErr_t err; krRsrc_t r; bool fragFl = false; + bool useWtFl = true; unsigned wtLoopCnt = 1; // 1=play once (-1=loop forever) unsigned wtInitMode = 0; // initial wt mode is 'silence' unsigned wtSmpCnt = floor(cmDspSysSampleRate(h)); // wt length == srate @@ -498,21 +497,22 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr ) // Audio connections cmDspSysConnectAudio(h, php, "out", wtp, "phs" ); // phs -> wt - cmDspSysConnectAudio(h, wtp, "out", au0Sw, "a-in-0" ); // wt -> sw - - /* - cmDspSysConnectAudio(h, ai0p, "out", au0Sw, "a-in-1" ); // ain -> sw - cmDspSysConnectAudio(h, ai0p, "out", mi0p, "in" ); - cmDspSysConnectAudio(h, au0Sw, "a-out", rpp, "in-0"); // sw -> rcdply - cmDspSysConnectAudio(h, au0Sw, "a-out", c0.kr0,"in" ); // sw -> kr - cmDspSysConnectAudio(h, au0Sw, "a-out", c0.kr1,"in" ); // sw -> kr - */ - - - cmDspSysConnectAudio(h, ai0p, "out", rpp, "in-0"); // sw -> rcdply - cmDspSysConnectAudio(h, ai0p, "out", c0.kr0, "in" ); // ain -> sw - cmDspSysConnectAudio(h, ai0p, "out", c0.kr1, "in" ); // ain -> sw - cmDspSysConnectAudio(h, ai0p, "out", mi0p, "in" ); + if( useWtFl ) + { + cmDspSysConnectAudio(h, wtp, "out", au0Sw, "a-in-0" ); // wt -> sw + cmDspSysConnectAudio(h, ai0p, "out", au0Sw, "a-in-1" ); // ain -> sw + cmDspSysConnectAudio(h, ai0p, "out", mi0p, "in" ); + cmDspSysConnectAudio(h, au0Sw, "a-out", rpp, "in-0"); // sw -> rcdply + cmDspSysConnectAudio(h, au0Sw, "a-out", c0.kr0,"in" ); // sw -> kr + cmDspSysConnectAudio(h, au0Sw, "a-out", c0.kr1,"in" ); // sw -> kr + } + else + { + cmDspSysConnectAudio(h, ai0p, "out", rpp, "in-0"); // sw -> rcdply + cmDspSysConnectAudio(h, ai0p, "out", c0.kr0, "in" ); // ain -> sw + cmDspSysConnectAudio(h, ai0p, "out", c0.kr1, "in" ); // ain -> sw + cmDspSysConnectAudio(h, ai0p, "out", mi0p, "in" ); + } if( fragFl ) { @@ -525,22 +525,26 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr ) else { cmDspSysConnectAudio(h, c0.cmp, "out", ao0p, "in" ); + //cmDspSysConnectAudio(h, wtp, "out", ao0p, "in" ); } - cmDspSysConnectAudio(h, wtp, "out", au1Sw, "a-in-0" ); // wt -> sw - /* - cmDspSysConnectAudio(h, ai1p, "out", au1Sw, "a-in-1" ); // ain -> sw - cmDspSysConnectAudio(h, ai1p, "out", mi1p, "in" ); - cmDspSysConnectAudio(h, au1Sw, "a-out", rpp, "in-1"); // sw -> rcdply - cmDspSysConnectAudio(h, au1Sw, "a-out", c1.kr0,"in" ); // sw -> kr - cmDspSysConnectAudio(h, au1Sw, "a-out", c1.kr1,"in" ); // sw -> kr - */ - - cmDspSysConnectAudio(h, ai1p, "out", rpp, "in-1"); // sw -> rcdply - cmDspSysConnectAudio(h, ai1p, "out", c1.kr0, "in" ); // ain -> sw - cmDspSysConnectAudio(h, ai1p, "out", c1.kr1, "in" ); // ain -> sw - cmDspSysConnectAudio(h, ai1p, "out", mi1p, "in" ); + if( useWtFl ) + { + cmDspSysConnectAudio(h, wtp, "out", au1Sw, "a-in-0" ); // wt -> sw + cmDspSysConnectAudio(h, ai1p, "out", au1Sw, "a-in-1" ); // ain -> sw + cmDspSysConnectAudio(h, ai1p, "out", mi1p, "in" ); + cmDspSysConnectAudio(h, au1Sw, "a-out", rpp, "in-1"); // sw -> rcdply + cmDspSysConnectAudio(h, au1Sw, "a-out", c1.kr0,"in" ); // sw -> kr + cmDspSysConnectAudio(h, au1Sw, "a-out", c1.kr1,"in" ); // sw -> kr + } + else + { + cmDspSysConnectAudio(h, ai1p, "out", rpp, "in-1"); // sw -> rcdply + cmDspSysConnectAudio(h, ai1p, "out", c1.kr0, "in" ); // ain -> sw + cmDspSysConnectAudio(h, ai1p, "out", c1.kr1, "in" ); // ain -> sw + cmDspSysConnectAudio(h, ai1p, "out", mi1p, "in" ); + } if( fragFl ) { @@ -553,6 +557,8 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr ) else { cmDspSysConnectAudio(h, c1.cmp, "out", ao1p, "in" ); // cmp -> mix 0 + //cmDspSysConnectAudio(h, wtp, "out", ao1p, "in" ); + } cmDspSysConnectAudio(h, c0.cmp, "out", afop, "in0" ); // comp -> audio_file_out