From 3dd3d9818a0502013250c0a36e7275455969684b Mon Sep 17 00:00:00 2001 From: kevin Date: Fri, 20 Oct 2017 14:51:25 -0400 Subject: [PATCH] cmDspPgmKrChain.h/c, cmDspPgmKrTimeLineLite.c : Changes to support driving transforms through from chain scale ranges untis and to take input from the MIDI input or a the MIDI file player. --- dsp/cmDspPgmKrChain.c | 132 ++++++++++++++++++++--------------- dsp/cmDspPgmKrChain.h | 1 + dsp/cmDspPgmKrTimeLineLite.c | 71 ++++++++++++------- 3 files changed, 124 insertions(+), 80 deletions(-) diff --git a/dsp/cmDspPgmKrChain.c b/dsp/cmDspPgmKrChain.c index a281af5..f16865d 100644 --- a/dsp/cmDspPgmKrChain.c +++ b/dsp/cmDspPgmKrChain.c @@ -77,8 +77,8 @@ const cmChar_t* _mlbl(const cmChar_t* prefix, unsigned ch ) #ifndef KR2 void _cmDspSys_TlXformChain( cmDspSysH_t h, cmDspTlXform_t* c, unsigned preGrpSymId, unsigned cmpPreGrpSymId, cmDspInst_t* modp, unsigned ach, unsigned mch ) { - unsigned measRtrChCnt = 6; // note: router channel 6 is not connected - unsigned scaleRangeDfltSelId = 4; + unsigned measRtrChCnt = 9; // note: router channel 8 is not connected + unsigned scaleRangeDfltSelId = 8; int krWndSmpCnt = 2048; int krHopFact = 4; @@ -98,6 +98,10 @@ void _cmDspSys_TlXformChain( cmDspSysH_t h, cmDspTlXform_t* c, unsigned preGrpS double cmpWndMaxMs = 1000.0; double cmpWndMs = 200.0; + + cmDspInst_t* p_wet = cmDspSysAllocInst(h,"Printer", NULL, 1, "WET:"); + + cmDspInst_t* achan = cmDspSysAllocInst(h, "AvailCh", NULL, 1, xfadeChCnt ); // Measurement scale/range @@ -119,7 +123,7 @@ void _cmDspSys_TlXformChain( cmDspSysH_t h, cmDspTlXform_t* c, unsigned preGrpS cmDspInst_t* thr_sr = cmDspSysAllocInst(h, "ScaleRange", NULL, 4, 0.0, 1.0, 0.01, 100.0 ); cmDspInst_t* upr_sr = cmDspSysAllocInst(h, "ScaleRange", NULL, 4, 0.0, 1.0, -1.0, 5.0 ); cmDspInst_t* lwr_sr = cmDspSysAllocInst(h, "ScaleRange", NULL, 4, 0.0, 1.0, -5.0, 5.0 ); - cmDspInst_t* off_sr = cmDspSysAllocInst(h, "ScaleRange", NULL, 4, 0.0, 1.0, 0.0, 100.0 ); + //cmDspInst_t* off_sr = cmDspSysAllocInst(h, "ScaleRange", NULL, 4, 0.0, 1.0, 0.0, 100.0 ); cmDspInst_t* wet_sr = cmDspSysAllocInst(h, "ScaleRange", NULL, 4, 0.0, 1.0, 0.0, 1.0 ); @@ -158,40 +162,48 @@ void _cmDspSys_TlXformChain( cmDspSysH_t h, cmDspTlXform_t* c, unsigned preGrpS // Measurement Number Controls + cmDspInst_t* val_dynm_ctl = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Dynm Meas"), 0.0, 10.0, 1.0, 1.0); cmDspInst_t* min_dynm_ctl = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Min In Dyn"), 0.0, 10.0, 1.0, 0.0); cmDspInst_t* max_dynm_ctl = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Max In Dyn"), 0.0, 10.0, 1.0, 4.0); cmDspInst_t* dynm_map_menu = cmDspSysAllocMsgListP(h,preGrpSymId, NULL, lbl("DynSel 0"), NULL, "measMenu", scaleRangeDfltSelId); - cmDspInst_t* min_even_ctl = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Min In Even"), 0.0, 1.0, 0.001, 0.75); + cmDspInst_t* val_even_ctl = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Even Meas"), 0.0, 3.0, 0.001, 0.5); + cmDspInst_t* min_even_ctl = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Min In Even"), 0.0, 1.0, 0.001, 0.0); cmDspInst_t* max_even_ctl = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Max In Even"), 0.0, 3.0, 0.001, 1.0); - cmDspInst_t* even_map_menu = cmDspSysAllocMsgListP( h,preGrpSymId, NULL, lbl("EvenSel"), NULL, "measMenu", scaleRangeDfltSelId); + cmDspInst_t* even_map_menu = cmDspSysAllocMsgListP( h,preGrpSymId, NULL, lbl("EvenSel"), NULL, "measMenu", 4); cmDspSysNewColumn(h,0); - cmDspInst_t* min_tmpo_ctl = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Min In Tempo"), 0.0, 200.0, 1.0, 80.0); - cmDspInst_t* max_tmpo_ctl = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Max In Tempo"), 0.0, 200.0, 1.0, 120.0); - cmDspInst_t* tmpo_map_menu = cmDspSysAllocMsgListP( h,preGrpSymId, NULL, lbl("TempoSel"), NULL, "measMenu", scaleRangeDfltSelId); + cmDspInst_t* val_tmpo_ctl = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Tempo Meas"), 0.0, 200.0, 1.0, 100.0); + cmDspInst_t* min_tmpo_ctl = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Min In Tempo"), 0.0, 200.0, 1.0, 80.0); + cmDspInst_t* max_tmpo_ctl = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Max In Tempo"), 0.0, 200.0, 1.0, 120.0); + cmDspInst_t* tmpo_map_menu = cmDspSysAllocMsgListP( h,preGrpSymId, NULL, lbl("TempoSel"), NULL, "measMenu", scaleRangeDfltSelId); + cmDspInst_t* val_cost_ctl = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Cost Meas"), 0.0, 1.0, 0.01, 0.5); cmDspInst_t* min_cost_ctl = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Min In Cost"), 0.0, 1.0, 0.01, 0.0); cmDspInst_t* max_cost_ctl = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Max In Cost"), 0.0, 1.0, 0.01, 1.0); cmDspInst_t* cost_map_menu = cmDspSysAllocMsgListP( h,preGrpSymId, NULL, lbl("CostSel"), NULL, "measMenu", scaleRangeDfltSelId); + cmDspSysInstallCb(h, val_dynm_ctl, "val", dynm_sr, "val_in", NULL ); cmDspSysInstallCb(h, min_dynm_ctl, "val", dynm_sr, "min_in", NULL ); - cmDspSysInstallCb(h, max_dynm_ctl, "val", dynm_sr, "min_in", NULL ); + cmDspSysInstallCb(h, max_dynm_ctl, "val", dynm_sr, "max_in", NULL ); cmDspSysInstallCb(h, dynm_map_menu,"out", dynm_rt, "sel", NULL ); cmDspSysInstallCb(h, dynm_sr, "val_out", dynm_rt, "f-in", NULL ); + cmDspSysInstallCb(h, val_even_ctl, "val", even_sr, "val_in", NULL ); cmDspSysInstallCb(h, min_even_ctl, "val", even_sr, "min_in", NULL ); - cmDspSysInstallCb(h, max_even_ctl, "val", even_sr, "min_in", NULL ); + cmDspSysInstallCb(h, max_even_ctl, "val", even_sr, "max_in", NULL ); cmDspSysInstallCb(h, even_map_menu,"out", even_rt, "sel", NULL ); cmDspSysInstallCb(h, even_sr, "val_out", even_rt, "f-in", NULL ); + cmDspSysInstallCb(h, val_tmpo_ctl, "val", tmpo_sr, "val_in", NULL ); cmDspSysInstallCb(h, min_tmpo_ctl, "val", tmpo_sr, "min_in", NULL ); - cmDspSysInstallCb(h, max_tmpo_ctl, "val", tmpo_sr, "min_in", NULL ); + cmDspSysInstallCb(h, max_tmpo_ctl, "val", tmpo_sr, "max_in", NULL ); cmDspSysInstallCb(h, tmpo_map_menu,"out", tmpo_rt, "sel", NULL ); cmDspSysInstallCb(h, tmpo_sr, "val_out", tmpo_rt, "f-in", NULL ); + cmDspSysInstallCb(h, val_cost_ctl, "val", cost_sr, "val_in", NULL ); cmDspSysInstallCb(h, min_cost_ctl, "val", cost_sr, "min_in", NULL ); - cmDspSysInstallCb(h, max_cost_ctl, "val", cost_sr, "min_in", NULL ); + cmDspSysInstallCb(h, max_cost_ctl, "val", cost_sr, "max_in", NULL ); cmDspSysInstallCb(h, cost_map_menu,"out", cost_rt, "sel", NULL ); cmDspSysInstallCb(h, cost_sr, "val_out", cost_rt, "f-in", NULL ); @@ -226,6 +238,7 @@ void _cmDspSys_TlXformChain( cmDspSysH_t h, cmDspTlXform_t* c, unsigned preGrpS cmDspInst_t* lwr_ctl = cmDspSysAllocScalarP( h,preGrpSymId,NULL, lbl("Lwr slope"), 0.3, 10.0, 0.01, 2.0 ); cmDspInst_t* wet_ctl = cmDspSysAllocScalarP( h,preGrpSymId,NULL, lbl("Wet Dry"), 0.0, 1.0, 0.001, 1.0 ); + cmDspSysInstallCb(h, wnd_ctl, "out", wnd_rt, "f-in", NULL ); cmDspSysInstallCb(h, achan, "ch", wnd_rt, "sel", NULL ); // ach->rt sel cmDspSysInstallCb(h, wnd_rt, "f-out-0", kr0, "wndn", NULL ); // wndn->kr @@ -237,42 +250,6 @@ void _cmDspSys_TlXformChain( cmDspSysH_t h, cmDspTlXform_t* c, unsigned preGrpS cmDspSysInstallCb(h, hop_rt, "f-out-1", kr1, "hopf", NULL ); // hopf->kr - cmDspSysInstallCb(h, min_cel_ctl, "val", cel_sr, "min_out", NULL ); - cmDspSysInstallCb(h, max_cel_ctl, "val", cel_sr, "max_out", NULL ); - cmDspSysInstallCb(h, even_rt, "f-out-0", cel_sr, "val_in", NULL ); - cmDspSysInstallCb(h, dynm_rt, "f-out-0", cel_sr, "val_in", NULL ); - cmDspSysInstallCb(h, tmpo_rt, "f-out-0", cel_sr, "val_in", NULL ); - cmDspSysInstallCb(h, cost_rt, "f-out-0", cel_sr, "val_in", NULL ); - cmDspSysInstallCb(h, cel_sr, "val_out", cel_ctl,"val", NULL ); - cmDspSysInstallCb(h, cel_ctl, "val", cel_rt, "f-in", NULL ); - cmDspSysInstallCb(h, achan, "ch", cel_rt, "sel", NULL ); // ach->rt sel - cmDspSysInstallCb(h, cel_rt, "f-out-0", kr0, "ceil", NULL ); // cel->kr - cmDspSysInstallCb(h, cel_rt, "f-out-1", kr1, "ceil", NULL ); // cel->kr - - cmDspSysInstallCb(h, min_exp_ctl, "val", exp_sr, "min_out", NULL ); - cmDspSysInstallCb(h, max_exp_ctl, "val", exp_sr, "max_out", NULL ); - cmDspSysInstallCb(h, even_rt, "f-out-0", exp_sr, "val_in", NULL ); - cmDspSysInstallCb(h, dynm_rt, "f-out-0", exp_sr, "val_in", NULL ); - cmDspSysInstallCb(h, tmpo_rt, "f-out-0", exp_sr, "val_in", NULL ); - cmDspSysInstallCb(h, cost_rt, "f-out-0", exp_sr, "val_in", NULL ); - cmDspSysInstallCb(h, exp_sr, "val_out", exp_ctl,"val", NULL ); - cmDspSysInstallCb(h, exp_ctl, "val", exp_rt, "f-in", NULL ); - cmDspSysInstallCb(h, achan, "ch", exp_rt, "sel", NULL ); // ach->rt sel - cmDspSysInstallCb(h, exp_rt, "f-out-0", kr0, "expo", NULL ); // exp->kr - cmDspSysInstallCb(h, exp_rt, "f-out-1", kr1, "expo", NULL ); // exp->kr - - cmDspSysInstallCb(h, min_mix_ctl, "val", mix_sr, "min_out", NULL ); - cmDspSysInstallCb(h, max_mix_ctl, "val", mix_sr, "max_out", NULL ); - cmDspSysInstallCb(h, even_rt, "f-out-0", mix_sr, "val_in", NULL ); - cmDspSysInstallCb(h, dynm_rt, "f-out-0", mix_sr, "val_in", NULL ); - cmDspSysInstallCb(h, tmpo_rt, "f-out-0", mix_sr, "val_in", NULL ); - cmDspSysInstallCb(h, cost_rt, "f-out-0", mix_sr, "val_in", NULL ); - cmDspSysInstallCb(h, mix_sr, "val_out", mix_ctl,"val", NULL ); - cmDspSysInstallCb(h, mix_ctl, "val", mix_rt, "f-in", NULL ); - cmDspSysInstallCb(h, achan, "ch", mix_rt, "sel", NULL ); // ach->rt sel - cmDspSysInstallCb(h, mix_rt, "f-out-0", kr0, "mix", NULL ); // mix->kr - cmDspSysInstallCb(h, mix_rt, "f-out-1", kr1, "mix", NULL ); // mix->kr - cmDspSysInstallCb(h, min_thr_ctl, "val", thr_sr, "min_out", NULL ); cmDspSysInstallCb(h, max_thr_ctl, "val", thr_sr, "max_out", NULL ); cmDspSysInstallCb(h, even_rt, "f-out-0", thr_sr, "val_in", NULL ); @@ -311,15 +288,56 @@ void _cmDspSys_TlXformChain( cmDspSysH_t h, cmDspTlXform_t* c, unsigned preGrpS cmDspSysInstallCb(h, min_wet_ctl, "val", wet_sr, "min_out", NULL ); cmDspSysInstallCb(h, max_wet_ctl, "val", wet_sr, "max_out", NULL ); - cmDspSysInstallCb(h, even_rt, "f-out-4", wet_sr, "val_in", NULL ); - cmDspSysInstallCb(h, dynm_rt, "f-out-4", wet_sr, "val_in", NULL ); - cmDspSysInstallCb(h, tmpo_rt, "f-out-4", wet_sr, "val_in", NULL ); - cmDspSysInstallCb(h, cost_rt, "f-out-4", wet_sr, "val_in", NULL ); + cmDspSysInstallCb(h, even_rt, "f-out-3", wet_sr, "val_in", NULL ); + cmDspSysInstallCb(h, dynm_rt, "f-out-3", wet_sr, "val_in", NULL ); + cmDspSysInstallCb(h, tmpo_rt, "f-out-3", wet_sr, "val_in", NULL ); + cmDspSysInstallCb(h, cost_rt, "f-out-3", wet_sr, "val_in", NULL ); cmDspSysInstallCb(h, wet_sr, "val_out", wet_ctl,"val", NULL ); cmDspSysInstallCb(h, wet_ctl, "val", wet_rt, "f-in", NULL ); cmDspSysInstallCb(h, achan, "ch", wet_rt, "sel", NULL ); // ach->rt sel cmDspSysInstallCb(h, wet_rt, "f-out-0", kr0, "wet", NULL ); // wet->kr cmDspSysInstallCb(h, wet_rt, "f-out-1", kr1, "wet", NULL ); // wet->kr + + + cmDspSysInstallCb(h, wet_rt, "f-out-0", p_wet, "in", NULL ); + cmDspSysInstallCb(h, wet_rt, "f-out-1", p_wet, "in", NULL ); + + cmDspSysInstallCb(h, min_cel_ctl, "val", cel_sr, "min_out", NULL ); + cmDspSysInstallCb(h, max_cel_ctl, "val", cel_sr, "max_out", NULL ); + cmDspSysInstallCb(h, even_rt, "f-out-4", cel_sr, "val_in", NULL ); + cmDspSysInstallCb(h, dynm_rt, "f-out-4", cel_sr, "val_in", NULL ); + cmDspSysInstallCb(h, tmpo_rt, "f-out-4", cel_sr, "val_in", NULL ); + cmDspSysInstallCb(h, cost_rt, "f-out-4", cel_sr, "val_in", NULL ); + cmDspSysInstallCb(h, cel_sr, "val_out", cel_ctl,"val", NULL ); + cmDspSysInstallCb(h, cel_ctl, "val", cel_rt, "f-in", NULL ); + cmDspSysInstallCb(h, achan, "ch", cel_rt, "sel", NULL ); // ach->rt sel + cmDspSysInstallCb(h, cel_rt, "f-out-0", kr0, "ceil", NULL ); // cel->kr + cmDspSysInstallCb(h, cel_rt, "f-out-1", kr1, "ceil", NULL ); // cel->kr + + cmDspSysInstallCb(h, min_exp_ctl, "val", exp_sr, "min_out", NULL ); + cmDspSysInstallCb(h, max_exp_ctl, "val", exp_sr, "max_out", NULL ); + cmDspSysInstallCb(h, even_rt, "f-out-5", exp_sr, "val_in", NULL ); + cmDspSysInstallCb(h, dynm_rt, "f-out-5", exp_sr, "val_in", NULL ); + cmDspSysInstallCb(h, tmpo_rt, "f-out-5", exp_sr, "val_in", NULL ); + cmDspSysInstallCb(h, cost_rt, "f-out-5", exp_sr, "val_in", NULL ); + cmDspSysInstallCb(h, exp_sr, "val_out", exp_ctl,"val", NULL ); + cmDspSysInstallCb(h, exp_ctl, "val", exp_rt, "f-in", NULL ); + cmDspSysInstallCb(h, achan, "ch", exp_rt, "sel", NULL ); // ach->rt sel + cmDspSysInstallCb(h, exp_rt, "f-out-0", kr0, "expo", NULL ); // exp->kr + cmDspSysInstallCb(h, exp_rt, "f-out-1", kr1, "expo", NULL ); // exp->kr + + cmDspSysInstallCb(h, min_mix_ctl, "val", mix_sr, "min_out", NULL ); + cmDspSysInstallCb(h, max_mix_ctl, "val", mix_sr, "max_out", NULL ); + cmDspSysInstallCb(h, even_rt, "f-out-6", mix_sr, "val_in", NULL ); + cmDspSysInstallCb(h, dynm_rt, "f-out-6", mix_sr, "val_in", NULL ); + cmDspSysInstallCb(h, tmpo_rt, "f-out-6", mix_sr, "val_in", NULL ); + cmDspSysInstallCb(h, cost_rt, "f-out-6", mix_sr, "val_in", NULL ); + cmDspSysInstallCb(h, mix_sr, "val_out", mix_ctl,"val", NULL ); + cmDspSysInstallCb(h, mix_ctl, "val", mix_rt, "f-in", NULL ); + cmDspSysInstallCb(h, achan, "ch", mix_rt, "sel", NULL ); // ach->rt sel + cmDspSysInstallCb(h, mix_rt, "f-out-0", kr0, "mix", NULL ); // mix->kr + cmDspSysInstallCb(h, mix_rt, "f-out-1", kr1, "mix", NULL ); // mix->kr + cmDspSysNewColumn(h,0); @@ -374,7 +392,7 @@ void _cmDspSys_TlXformChain( cmDspSysH_t h, cmDspTlXform_t* c, unsigned preGrpS cmDspSysInstallCb(h, modp, mlbl("thr"), thr_ctl, "val", NULL ); cmDspSysInstallCb(h, modp, mlbl("upr"), upr_ctl, "val", NULL ); cmDspSysInstallCb(h, modp, mlbl("lwr"), lwr_ctl, "val", NULL ); - cmDspSysInstallCb(h, modp, mlbl("wet"), wet_ctl, "val", NULL ); + //cmDspSysInstallCb(h, modp, mlbl("wet"), wet_ctl, "val", NULL ); cmDspSysInstallCb(h, modp, mlbl("minc"), min_cel_ctl, "val", NULL ); cmDspSysInstallCb(h, modp, mlbl("maxc"), max_cel_ctl, "val", NULL ); cmDspSysInstallCb(h, modp, mlbl("mine"), min_exp_ctl, "val", NULL ); @@ -389,13 +407,14 @@ void _cmDspSys_TlXformChain( cmDspSysH_t h, cmDspTlXform_t* c, unsigned preGrpS cmDspSysInstallCb(h, modp, mlbl("maxl"), max_lwr_ctl, "val", NULL ); cmDspSysInstallCb(h, modp, mlbl("mino"), min_off_ctl, "val", NULL ); cmDspSysInstallCb(h, modp, mlbl("maxo"), max_off_ctl, "val", NULL ); - cmDspSysInstallCb(h, modp, mlbl("sw"), achan, "trig", NULL ); // See also: amp.sfloc->achan.trig + //cmDspSysInstallCb(h, modp, mlbl("sw"), achan, "trig", NULL ); // See also: amp.sfloc->achan.trig c->achan = achan; c->kr0 = kr0; c->kr1 = kr1; - c->cmp = cmp; + c->cmp = cmp; + c->even_ctl = val_even_ctl; } #endif @@ -405,7 +424,7 @@ void _cmDspSys_TlXformChain( cmDspSysH_t h, cmDspTlXform_t* c, unsigned preGrpS // KR2 Modeless Transform based on cmDspKr2 and cmSpecDist2 //======================================================================================================================= //======================================================================================================================= - +/* #ifdef KR2 void _cmDspSys_TlXformChain( cmDspSysH_t h, cmDspTlXform_t* c, unsigned preGrpSymId, unsigned cmpPreGrpSymId, cmDspInst_t* modp, unsigned ach, unsigned mch ) { @@ -584,3 +603,4 @@ void _cmDspSys_TlXformChain( cmDspSysH_t h, cmDspTlXform_t* c, unsigned preGrpS } #endif +*/ diff --git a/dsp/cmDspPgmKrChain.h b/dsp/cmDspPgmKrChain.h index 48e8604..de90f21 100644 --- a/dsp/cmDspPgmKrChain.h +++ b/dsp/cmDspPgmKrChain.h @@ -31,6 +31,7 @@ typedef struct cmDspInst_t* kr0; // audio input cmDspInst_t* kr1; cmDspInst_t* cmp; // audio output + cmDspInst_t* even_ctl; } cmDspTlXform_t; diff --git a/dsp/cmDspPgmKrTimeLineLite.c b/dsp/cmDspPgmKrTimeLineLite.c index 3bbfb87..7841add 100644 --- a/dsp/cmDspPgmKrTimeLineLite.c +++ b/dsp/cmDspPgmKrTimeLineLite.c @@ -58,9 +58,12 @@ cmDspRC_t _cmDspSysPgm_TimeLineLite(cmDspSysH_t h, void** userPtrPtr ) if( krLoadRsrc(h,&err,&r) != kOkDspRC ) return rc; + + cmDspInst_t* ai0 = cmDspSysAllocInst(h,"AudioIn", NULL, 1, 0); cmDspInst_t* ai1 = cmDspSysAllocInst(h,"AudioIn", NULL, 1, 1); - cmDspInst_t* mip = cmDspSysAllocInst(h,"MidiIn", NULL, 2, "MOTU - Traveler mk3", "MIDI Port"); + //cmDspInst_t* mip = cmDspSysAllocInst(h,"MidiIn", NULL, 2, "MOTU - Traveler mk3", "MIDI Port"); + cmDspInst_t* mip = cmDspSysAllocInst(h,"MidiIn", NULL, 2, "Apple Inc. - IAC Driver", "Bus 1"); cmDspInst_t* tlp = cmDspSysAllocInst(h,"TimeLine", "tl", 2, r.tlFn, r.tlPrefixPath ); cmDspInst_t* scp = cmDspSysAllocInst(h,"Score", "sc", 1, r.scFn ); @@ -70,7 +73,7 @@ cmDspRC_t _cmDspSysPgm_TimeLineLite(cmDspSysH_t h, void** userPtrPtr ) cmDspInst_t* nmp = cmDspSysAllocInst(h,"NanoMap", NULL, 0 ); cmDspInst_t* mop = cmDspSysAllocInst(h,"MidiOut", NULL, 2, r.midiDevice,r.midiOutPort); cmDspInst_t* mo2p = cmDspSysAllocInst(h,"MidiOut", NULL, 2, r.midiDevice,r.midiOutPort2); - cmDspInst_t* sfp = cmDspSysAllocInst(h,"ScFol", NULL, 1, r.scFn, sfBufCnt, sfMaxWndCnt, sfMinVel, sfEnaMeasFl ); + cmDspInst_t* sfp = cmDspSysAllocInst(h,"ScFol", NULL, 5, r.scFn, sfBufCnt, sfMaxWndCnt, sfMinVel, sfEnaMeasFl ); cmDspInst_t* amp = cmDspSysAllocInst(h,"ActiveMeas", NULL, 1, 100 ); cmDspInst_t* modp = cmDspSysAllocInst(h,"ScMod", NULL, 2, r.modFn, "m1" ); @@ -88,23 +91,23 @@ cmDspRC_t _cmDspSysPgm_TimeLineLite(cmDspSysH_t h, void** userPtrPtr ) cmDspInst_t* ao0 = cmDspSysAllocInst(h,"AudioOut", NULL, 1, 4 ); // 4 Piano 1 Output cmDspInst_t* ao1 = cmDspSysAllocInst(h,"AudioOut", NULL, 1, 5 ); // 5 2 - cmDspInst_t* ao2 = cmDspSysAllocInst(h,"AudioOut", NULL, 1, 2 ); // 2 Transform 1 OUtput - cmDspInst_t* ao3 = cmDspSysAllocInst(h,"AudioOut", NULL, 1, 3 ); // 3 2 + cmDspInst_t* ao2 = cmDspSysAllocInst(h,"AudioOut", NULL, 1, 0 ); // 2 Transform 1 OUtput + cmDspInst_t* ao3 = cmDspSysAllocInst(h,"AudioOut", NULL, 1, 1 ); // 3 2 cmDspSysNewPage(h,"Main"); cmDspInst_t* onb = cmDspSysAllocInst(h,"Button", "start", 2, kButtonDuiId, 1.0 ); cmDspInst_t* offb = cmDspSysAllocInst(h,"Button", "stop", 2, kButtonDuiId, 1.0 ); cmDspInst_t* mod_sel = cmDspSysAllocMsgList(h, NULL, "mod_sel", 1 ); cmDspInst_t* prp = cmDspSysAllocInst(h,"Printer", NULL, 1, ">" ); - cmDspInst_t* prd = cmDspSysAllocInst(h,"Printer", NULL, 1, "DYN:" ); + cmDspInst_t* prd = cmDspSysAllocInst(h,"Printer", NULL, 1, "DYNM:" ); cmDspInst_t* pre = cmDspSysAllocInst(h,"Printer", NULL, 1, "EVEN:" ); - cmDspInst_t* prt = cmDspSysAllocInst(h,"Printer", NULL, 1, "TEMPO:"); + cmDspInst_t* prt = cmDspSysAllocInst(h,"Printer", NULL, 1, "TMPO:"); cmDspInst_t* prc = cmDspSysAllocInst(h,"Printer", NULL, 1, "COST:"); // Record <-> Live switches cmDspInst_t* tlRt = cmDspSysAllocInst(h,"Router", NULL, 2, 2, 0); // time line swich cmDspInst_t* mfpRt = cmDspSysAllocInst(h,"Router", NULL, 2, 2, 0); - cmDspInst_t* amRt = cmDspSysAllocInst(h,"Router", NULL, 2, 2, 0); + //cmDspInst_t* amRt = cmDspSysAllocInst(h,"Router", NULL, 2, 2, 0); //cmDspSysNewColumn(h,0); cmDspInst_t* igain0 = cmDspSysAllocInst(h,"Scalar", "In Gain-0", 5, kNumberDuiId, 0.0, 100.0,0.01, 1.0 ); @@ -184,9 +187,10 @@ cmDspRC_t _cmDspSysPgm_TimeLineLite(cmDspSysH_t h, void** userPtrPtr ) //cmDspSysInstallCb( h, prtBtn, "sym", scp, "cmd", NULL ); // print the score cmDspSysInstallCb( h, amCmd, "add", amp, "cmd", NULL ); // add active meas cmDspSysInstallCb( h, amCmd, "rewind", amp, "cmd", NULL ); // rewind active meas - cmDspSysInstallCb( h, sfp, "out", amRt, "f-in", NULL ); // sfp-active meas router (rtr is switched by live btn) - cmDspSysInstallCb( h, amRt, "f-out-0",amp, "sfloc", NULL ); - + //cmDspSysInstallCb( h, sfp, "out", amRt, "f-in", NULL ); // sfp-active meas router (rtr is switched by live btn) + //cmDspSysInstallCb( h, amRt, "f-out-0",amp, "sfloc", NULL ); + cmDspSysInstallCb( h, sfp, "out", amp, "sfloc", NULL ); + cmDspSysInstallCb( h, sfp, "vloc", amp, "loc", NULL ); // live meas's to active meas unit cmDspSysInstallCb( h, sfp, "vval", amp, "val", NULL ); // cmDspSysInstallCb( h, sfp, "vcost",amp, "cst", NULL ); // @@ -194,20 +198,37 @@ cmDspRC_t _cmDspSysPgm_TimeLineLite(cmDspSysH_t h, void** userPtrPtr ) cmDspSysInstallCb( h, sfp, "vtyp", amCmd, "add", NULL); // // ***** delete this to prevent the score follower from driving the active-measure unit in 'live' mode - cmDspSysInstallCb( h, amRt, "f-out-1",amp, "sfloc", NULL ); + //cmDspSysInstallCb( h, amRt, "f-out-1",amp, "sfloc", NULL ); // ***** // active measure loc to xfad channel trigger + cmDspSysInstallCb( h, amp, "scloc",c0.achan, "trig", NULL ); // See Also: modp.sw ->achan.trig cmDspSysInstallCb( h, amp, "scloc",c1.achan, "trig", NULL ); cmDspSysInstallCb( h, recallBtn, "sym", c0.achan, "trig", NULL ); cmDspSysInstallCb( h, recallBtn, "sym", c1.achan, "trig", NULL ); - + cmDspSysInstallCb( h, amp, "even", pre, "in", NULL ); // active meas output to printers - cmDspSysInstallCb( h, amp, "dyn", prd, "in", NULL ); - cmDspSysInstallCb( h, amp, "tempo", prt, "in", NULL ); - cmDspSysInstallCb( h, amp, "cost", prc, "in", NULL ); + //cmDspSysInstallCb( h, amp, "even", c0.even_ctl, "val", NULL ); + //cmDspSysInstallCb( h, amp, "even", c1.even_ctl, "val", NULL ); + cmDspSysInstallCb( h, amp, "even", modp, "even", NULL ); + cmDspSysInstallCb( h, amp, "dyn", prd, "in", NULL ); + cmDspSysInstallCb( h, amp, "dyn", modp, "dyn", NULL ); + + cmDspSysInstallCb( h, amp, "tempo", prt, "in", NULL ); + cmDspSysInstallCb( h, amp, "tempo", modp, "tempo",NULL ); + + cmDspSysInstallCb( h, amp, "cost", prc, "in", NULL ); + cmDspSysInstallCb( h, amp, "cost", modp, "cost", NULL ); + + + /* + cmDspSysInstallCb( h, sfp, "vloc", pre, "in", NULL ); // live meas's to active meas unit + cmDspSysInstallCb( h, sfp, "vval", prd, "in", NULL ); // + cmDspSysInstallCb( h, sfp, "vcost",prt, "in", NULL ); // + cmDspSysInstallCb( h, sfp, "vtyp", prc, "in", NULL ); // + */ // wave-table to time-line cursor //cmDspSysInstallCb( h, wtp, "fidx",tlp, "curs", NULL); @@ -248,22 +269,24 @@ cmDspRC_t _cmDspSysPgm_TimeLineLite(cmDspSysH_t h, void** userPtrPtr ) cmDspSysInstallCb(h, scp, "sel", modp,"reset", NULL ); cmDspSysInstallCb(h, scp, "sel", prp, "in", NULL ); + cmDspInst_t* msrc = mfp; // switch MIDI source (mfp or mip) + // MIDI file player to score follower and sampler - cmDspSysInstallCb(h, mip, "smpidx", sfp, "smpidx",NULL ); + cmDspSysInstallCb(h, msrc, "smpidx", sfp, "smpidx",NULL ); //cmDspSysInstallCb(h, mfp, "id", sfp, "muid", NULL ); - cmDspSysInstallCb(h, mip, "d1", sfp, "d1", NULL ); - cmDspSysInstallCb(h, mip, "d1", nmp, "d1", NULL ); + cmDspSysInstallCb(h, msrc, "d1", sfp, "d1", NULL ); + cmDspSysInstallCb(h, msrc, "d1", nmp, "d1", NULL ); cmDspSysInstallCb(h, nmp, "d1", mop, "d1", NULL ); //cmDspSysInstallCb(h, nmp, "d1", mo2p, "d1", NULL ); - cmDspSysInstallCb(h, mip, "d0", sfp, "d0", NULL ); - cmDspSysInstallCb(h, mip, "d0", nmp, "d0", NULL ); + cmDspSysInstallCb(h, msrc, "d0", sfp, "d0", NULL ); + cmDspSysInstallCb(h, msrc, "d0", nmp, "d0", NULL ); cmDspSysInstallCb(h, nmp, "d0", mop, "d0", NULL ); //cmDspSysInstallCb(h, nmp, "d0", mo2p, "d0", NULL ); - cmDspSysInstallCb(h, mip, "status", sfp, "status",NULL ); - cmDspSysInstallCb(h, mip, "status", nmp, "status",NULL ); + cmDspSysInstallCb(h, msrc, "status", sfp, "status",NULL ); + cmDspSysInstallCb(h, msrc, "status", nmp, "status",NULL ); cmDspSysInstallCb(h, nmp, "status", mop, "status",NULL ); //cmDspSysInstallCb(h, nmp, "status", mo2p, "status",NULL ); @@ -281,8 +304,8 @@ cmDspRC_t _cmDspSysPgm_TimeLineLite(cmDspSysH_t h, void** userPtrPtr ) cmDspSysInstallCb(h, modp, "wgain0", ogain2, "val", NULL ); cmDspSysInstallCb(h, modp, "wgain1", ogain3, "val", NULL ); - cmDspSysInstallCb(h, ogain0, "val", ao0, "gain", NULL ); // output gain control - dry 0 - cmDspSysInstallCb(h, ogain1, "val", ao1, "gain", NULL ); // dry 1 + //cmDspSysInstallCb(h, ogain0, "val", ao0, "gain", NULL ); // output gain control - dry 0 + //cmDspSysInstallCb(h, ogain1, "val", ao1, "gain", NULL ); // dry 1 cmDspSysInstallCb(h, ogain2, "val", ao2, "gain", NULL ); // wet 0 cmDspSysInstallCb(h, ogain3, "val", ao3, "gain", NULL ); // wet 1