Browse Source

cmDspPgmKr.c : Added separate channels for fragment transformation.

master
kevin 11 years ago
parent
commit
2f0df884b0
1 changed files with 40 additions and 12 deletions
  1. 40
    12
      dsp/cmDspPgmKr.c

+ 40
- 12
dsp/cmDspPgmKr.c View File

85
   return s;
85
   return s;
86
 }
86
 }
87
 
87
 
88
-#define mlbl(a)  _mlbl(a,ch)
88
+#define mlbl(a)  _mlbl(a,mch)
89
 #define lbl(a) cmDspSysPrintLabel(a,ch)
89
 #define lbl(a) cmDspSysPrintLabel(a,ch)
90
 
90
 
91
-void _cmDspSys_TlXformChain( cmDspSysH_t h, cmDspTlXform_t* c,  unsigned preGrpSymId, unsigned cmpPreGrpSymId, cmDspInst_t* modp, unsigned ch )
91
+void _cmDspSys_TlXformChain( cmDspSysH_t h, cmDspTlXform_t* c,  unsigned preGrpSymId, unsigned cmpPreGrpSymId, cmDspInst_t* modp, unsigned ch, unsigned mch )
92
 {
92
 {
93
   unsigned        measRtrChCnt = 6; // note: router channel 6 is not connected
93
   unsigned        measRtrChCnt = 6; // note: router channel 6 is not connected
94
 
94
 
132
   cmDspInst_t* wet_sr   = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4,  0.0, 1.0,  0.0, 1.0 );
132
   cmDspInst_t* wet_sr   = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4,  0.0, 1.0,  0.0, 1.0 );
133
 
133
 
134
  
134
  
135
-  // Parameter -> kr routers
135
+  // Parameter-> kr routers (routers used to cross-fade between the two kr units)
136
   unsigned paramRtChCnt = 2;
136
   unsigned paramRtChCnt = 2;
137
   cmDspInst_t* mod_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
137
   cmDspInst_t* mod_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
138
   cmDspInst_t* wnd_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
138
   cmDspInst_t* wnd_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
398
   cmDspInst_t* amp  = cmDspSysAllocInst(h,"ActiveMeas",  NULL,  1, 100 );
398
   cmDspInst_t* amp  = cmDspSysAllocInst(h,"ActiveMeas",  NULL,  1, 100 );
399
   cmDspInst_t* rpp  = cmDspSysAllocInst(h,"RecdPlay",    NULL,  6, 2, r.scFn, recdPlayInitAllocSecs, recdPlayMaxLaSecs, recdPlayCurLaSecs, recdPlayFadeRateDbPerSec );
399
   cmDspInst_t* rpp  = cmDspSysAllocInst(h,"RecdPlay",    NULL,  6, 2, r.scFn, recdPlayInitAllocSecs, recdPlayMaxLaSecs, recdPlayCurLaSecs, recdPlayFadeRateDbPerSec );
400
   cmDspInst_t* modp = cmDspSysAllocInst(h,"ScMod",       NULL,  2, r.modFn, "m1" );
400
   cmDspInst_t* modp = cmDspSysAllocInst(h,"ScMod",       NULL,  2, r.modFn, "m1" );
401
+  cmDspInst_t* modr = cmDspSysAllocInst(h,"ScMod",       NULL,  2, r.modFn, "m1" );
401
  
402
  
402
   unsigned   preGrpSymId     = cmDspSysPresetRegisterGroup(h,"tl");
403
   unsigned   preGrpSymId     = cmDspSysPresetRegisterGroup(h,"tl");
403
   unsigned   cmpPreGrpSymId  = cmDspSysPresetRegisterGroup(h,"tl_cmp"); 
404
   unsigned   cmpPreGrpSymId  = cmDspSysPresetRegisterGroup(h,"tl_cmp"); 
404
 
405
 
405
-  cmDspTlXform_t c0,c1;
406
+  cmDspTlXform_t c0,c1,c2,c3;
406
 
407
 
407
   cmDspSysNewPage(h,"Controls-0");
408
   cmDspSysNewPage(h,"Controls-0");
408
-  _cmDspSys_TlXformChain(h, &c0, preGrpSymId, cmpPreGrpSymId, modp, 0 );
409
-  cmDspInst_t* mix0 = cmDspSysAllocInst(h,"AMix",        NULL,   3, 2, 1.0, 1.0 );
410
-  cmDspInst_t* ao0p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 0 );
409
+  _cmDspSys_TlXformChain(h, &c0, preGrpSymId, cmpPreGrpSymId, modp, 0, 0 );
411
 
410
 
412
   cmDspSysNewPage(h,"Controls-1");
411
   cmDspSysNewPage(h,"Controls-1");
413
-  _cmDspSys_TlXformChain(h, &c1, preGrpSymId, cmpPreGrpSymId, modp, 1 );
412
+  _cmDspSys_TlXformChain(h, &c1, preGrpSymId, cmpPreGrpSymId, modp, 1, 1 );
413
+
414
+  cmDspSysNewPage(h,"Ctl-R/P-0");
415
+  _cmDspSys_TlXformChain(h, &c2, preGrpSymId, cmpPreGrpSymId, modr, 2, 0 );
416
+
417
+  cmDspSysNewPage(h,"Ctl-R/P-1");
418
+  _cmDspSys_TlXformChain(h, &c3, preGrpSymId, cmpPreGrpSymId, modr, 3, 1 );
419
+
420
+  cmDspInst_t* mix0 = cmDspSysAllocInst(h,"AMix",        NULL,   3, 2, 1.0, 1.0 );
414
   cmDspInst_t* mix1 = cmDspSysAllocInst(h,"AMix",        NULL,   3, 2, 1.0, 1.0 );
421
   cmDspInst_t* mix1 = cmDspSysAllocInst(h,"AMix",        NULL,   3, 2, 1.0, 1.0 );
415
-  cmDspInst_t* ao1p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 1 );
416
 
422
 
423
+  cmDspInst_t* ao0p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 0 );
424
+  cmDspInst_t* ao1p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 1 );
417
   cmDspInst_t* ao2p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 2 );
425
   cmDspInst_t* ao2p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 2 );
418
   cmDspInst_t* ao3p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 3 );
426
   cmDspInst_t* ao3p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 3 );
419
 
427
 
426
   cmDspInst_t* offb = cmDspSysAllocInst(h,"Button", "stop",    2, kButtonDuiId, 1.0 );
434
   cmDspInst_t* offb = cmDspSysAllocInst(h,"Button", "stop",    2, kButtonDuiId, 1.0 );
427
   cmDspInst_t* prtb = cmDspSysAllocInst(h,"Button", "print",   2, kButtonDuiId, 1.0 );
435
   cmDspInst_t* prtb = cmDspSysAllocInst(h,"Button", "print",   2, kButtonDuiId, 1.0 );
428
   cmDspInst_t* qtb  = cmDspSysAllocInst(h,"Button", "quiet",   2, kButtonDuiId, 1.0 );
436
   cmDspInst_t* qtb  = cmDspSysAllocInst(h,"Button", "quiet",   2, kButtonDuiId, 1.0 );
437
+  cmDspInst_t* mutm = cmDspSysAllocInst(h,"Checkbox","main",   1, "main","on","off",1.0,0.0,1.0 );
438
+  cmDspInst_t* mutr = cmDspSysAllocInst(h,"Checkbox","frag",   1, "frag","on","off",1.0,0.0,1.0 );
429
   cmDspInst_t* prp  = cmDspSysAllocInst(h,"Printer", NULL,   1, ">" );
439
   cmDspInst_t* prp  = cmDspSysAllocInst(h,"Printer", NULL,   1, ">" );
430
   cmDspInst_t* prd  = cmDspSysAllocInst(h,"Printer", NULL,   1, "DYN:" );
440
   cmDspInst_t* prd  = cmDspSysAllocInst(h,"Printer", NULL,   1, "DYN:" );
431
   cmDspInst_t* pre  = cmDspSysAllocInst(h,"Printer", NULL,   1, "EVEN:" );
441
   cmDspInst_t* pre  = cmDspSysAllocInst(h,"Printer", NULL,   1, "EVEN:" );
487
   cmDspSysConnectAudio(h, au0Sw,  "a-out", c0.kr0,"in"  );    // sw  -> kr
497
   cmDspSysConnectAudio(h, au0Sw,  "a-out", c0.kr0,"in"  );    // sw  -> kr
488
   cmDspSysConnectAudio(h, au0Sw,  "a-out", c0.kr1,"in"  );    // sw  -> kr
498
   cmDspSysConnectAudio(h, au0Sw,  "a-out", c0.kr1,"in"  );    // sw  -> kr
489
   cmDspSysConnectAudio(h, c0.cmp, "out",   mix0,  "in-0" );   // cmp -> mix 0
499
   cmDspSysConnectAudio(h, c0.cmp, "out",   mix0,  "in-0" );   // cmp -> mix 0
490
-  cmDspSysConnectAudio(h, rpp,    "out-0", mix0,  "in-1");    // rpp -> mix 1
500
+  cmDspSysConnectAudio(h, rpp,    "out-0", c2.kr0,"in" );
501
+  cmDspSysConnectAudio(h, rpp,    "out-0", c2.kr1,"in" );
502
+  cmDspSysConnectAudio(h, c2.cmp, "out",   mix0,  "in-1");    // rpp -> mix 1
491
   cmDspSysConnectAudio(h, mix0,   "out",   ao0p,  "in" );     // mix -> aout
503
   cmDspSysConnectAudio(h, mix0,   "out",   ao0p,  "in" );     // mix -> aout
492
 
504
 
493
 
505
 
498
   cmDspSysConnectAudio(h, au1Sw,  "a-out", c1.kr0,"in"  );    // sw  -> kr
510
   cmDspSysConnectAudio(h, au1Sw,  "a-out", c1.kr0,"in"  );    // sw  -> kr
499
   cmDspSysConnectAudio(h, au1Sw,  "a-out", c1.kr1,"in"  );    // sw  -> kr
511
   cmDspSysConnectAudio(h, au1Sw,  "a-out", c1.kr1,"in"  );    // sw  -> kr
500
   cmDspSysConnectAudio(h, c1.cmp, "out",   mix1,  "in-0" );   // cmp -> mix 0
512
   cmDspSysConnectAudio(h, c1.cmp, "out",   mix1,  "in-0" );   // cmp -> mix 0
501
-  cmDspSysConnectAudio(h, rpp,    "out-1", mix1,  "in-1");    // rpp -> mix 1
502
-  cmDspSysConnectAudio(h, mix1,   "out",   ao1p,  "in" );     // mix -> aout
513
+  cmDspSysConnectAudio(h, rpp,    "out-1", c3.kr0, "in" );
514
+  cmDspSysConnectAudio(h, rpp,    "out-1", c3.kr1, "in" );
515
+  cmDspSysConnectAudio(h, c3.cmp, "out",   mix1,   "in-1");    // rpp -> mix 1
516
+  cmDspSysConnectAudio(h, mix1,   "out",   ao1p,   "in" );     // mix -> aout
503
 
517
 
504
   cmDspSysConnectAudio(h, c0.cmp, "out", afop, "in0" );    // comp -> audio_file_out
518
   cmDspSysConnectAudio(h, c0.cmp, "out", afop, "in0" );    // comp -> audio_file_out
505
   cmDspSysConnectAudio(h, c1.cmp, "out", afop, "in1" );
519
   cmDspSysConnectAudio(h, c1.cmp, "out", afop, "in1" );
556
   // active measure loc to xfad channel trigger
570
   // active measure loc to xfad channel trigger
557
   cmDspSysInstallCb( h, amp,    "scloc",  c0.achan,   "trig", NULL );  // See Also: modp.sw ->achan.trig
571
   cmDspSysInstallCb( h, amp,    "scloc",  c0.achan,   "trig", NULL );  // See Also: modp.sw ->achan.trig
558
   cmDspSysInstallCb( h, amp,    "scloc",  c1.achan,   "trig", NULL );
572
   cmDspSysInstallCb( h, amp,    "scloc",  c1.achan,   "trig", NULL );
573
+  cmDspSysInstallCb( h, amp,    "scloc",  c2.achan,   "trig", NULL ); 
574
+  cmDspSysInstallCb( h, amp,    "scloc",  c3.achan,   "trig", NULL );
575
+
559
   cmDspSysInstallCb( h, amp,    "even",   pre,        "in",   NULL );  // active meas output to printers
576
   cmDspSysInstallCb( h, amp,    "even",   pre,        "in",   NULL );  // active meas output to printers
560
   cmDspSysInstallCb( h, amp,    "dyn",    prd,        "in",   NULL );
577
   cmDspSysInstallCb( h, amp,    "dyn",    prd,        "in",   NULL );
561
   cmDspSysInstallCb( h, amp,    "tempo",  prt,        "in",   NULL );
578
   cmDspSysInstallCb( h, amp,    "tempo",  prt,        "in",   NULL );
597
   cmDspSysInstallCb(h, pts, "on",      wtRt,  "s-in",  NULL );
614
   cmDspSysInstallCb(h, pts, "on",      wtRt,  "s-in",  NULL );
598
   cmDspSysInstallCb(h, wtRt,"s-out-0", wtp,   "cmd",   NULL );
615
   cmDspSysInstallCb(h, wtRt,"s-out-0", wtp,   "cmd",   NULL );
599
   cmDspSysInstallCb(h, pts, "on",      modp,  "cmd",   NULL );
616
   cmDspSysInstallCb(h, pts, "on",      modp,  "cmd",   NULL );
617
+  cmDspSysInstallCb(h, pts, "on",      modr,  "cmd",   NULL );
600
   cmDspSysInstallCb(h, pts, "on",      rpp,   "cmd",   NULL );
618
   cmDspSysInstallCb(h, pts, "on",      rpp,   "cmd",   NULL );
601
   cmDspSysInstallCb(h, onb, "sym",     amCmd, "rewind",NULL );
619
   cmDspSysInstallCb(h, onb, "sym",     amCmd, "rewind",NULL );
602
   cmDspSysInstallCb(h, onb, "out",     c0.achan,"reset",  NULL );
620
   cmDspSysInstallCb(h, onb, "out",     c0.achan,"reset",  NULL );
609
   cmDspSysInstallCb(h, offb, "sym", pts, "off", NULL );
627
   cmDspSysInstallCb(h, offb, "sym", pts, "off", NULL );
610
   cmDspSysInstallCb(h, pts,  "off", wtp, "cmd", NULL );
628
   cmDspSysInstallCb(h, pts,  "off", wtp, "cmd", NULL );
611
   cmDspSysInstallCb(h, pts,  "off", modp,"cmd", NULL );
629
   cmDspSysInstallCb(h, pts,  "off", modp,"cmd", NULL );
630
+  cmDspSysInstallCb(h, pts,  "off", modr,"cmd", NULL );
612
   cmDspSysInstallCb(h, offb, "sym", mop, "reset", NULL );
631
   cmDspSysInstallCb(h, offb, "sym", mop, "reset", NULL );
613
 
632
 
614
   // time-line to wave-table selection 
633
   // time-line to wave-table selection 
624
   // score to score follower - to set initial search location
643
   // score to score follower - to set initial search location
625
   cmDspSysInstallCb(h, scp, "sel",    sfp, "index",  NULL );
644
   cmDspSysInstallCb(h, scp, "sel",    sfp, "index",  NULL );
626
   cmDspSysInstallCb(h, scp, "sel",    modp,"reset", NULL );
645
   cmDspSysInstallCb(h, scp, "sel",    modp,"reset", NULL );
646
+  cmDspSysInstallCb(h, scp, "sel",    modr,"reset", NULL );
627
   
647
   
628
   //cmDspSysInstallCb(h, reload,"out",  modp, "reload", NULL );
648
   //cmDspSysInstallCb(h, reload,"out",  modp, "reload", NULL );
629
 
649
 
657
   // score follower to recd_play,modulator and printers
677
   // score follower to recd_play,modulator and printers
658
   cmDspSysInstallCb(h, sfp, "out",     rpp,     "index", NULL );
678
   cmDspSysInstallCb(h, sfp, "out",     rpp,     "index", NULL );
659
   cmDspSysInstallCb(h, sfp, "out",     modp,    "index", NULL );
679
   cmDspSysInstallCb(h, sfp, "out",     modp,    "index", NULL );
680
+  cmDspSysInstallCb(h, sfp, "out",     modr,    "index", NULL );
660
   cmDspSysInstallCb(h, sfp, "recent",  prp,     "in",  NULL );  // report 'recent' but only act on 'max' loc index
681
   cmDspSysInstallCb(h, sfp, "recent",  prp,     "in",  NULL );  // report 'recent' but only act on 'max' loc index
661
 
682
 
662
   cmDspSysInstallCb(h, prtb, "sym", sfp, "cmd", NULL );
683
   cmDspSysInstallCb(h, prtb, "sym", sfp, "cmd", NULL );
668
 
689
 
669
   cmDspSysInstallCb(h, igain0, "val", ai0p, "gain", NULL );   // input gain control
690
   cmDspSysInstallCb(h, igain0, "val", ai0p, "gain", NULL );   // input gain control
670
   cmDspSysInstallCb(h, igain1, "val", ai1p, "gain", NULL );
691
   cmDspSysInstallCb(h, igain1, "val", ai1p, "gain", NULL );
692
+
693
+  cmDspSysInstallCb(h, mutm,   "out", mix0, "gain-0", NULL );
694
+  cmDspSysInstallCb(h, mutm,   "out", mix1, "gain-0", NULL );
695
+  cmDspSysInstallCb(h, mutr,   "out", mix0, "gain-1", NULL );
696
+  cmDspSysInstallCb(h, mutr,   "out", mix1, "gain-1", NULL );
697
+  
698
+
671
   cmDspSysInstallCb(h, ogain0, "val", ao0p, "gain", NULL );   // output gain control
699
   cmDspSysInstallCb(h, ogain0, "val", ao0p, "gain", NULL );   // output gain control
672
   cmDspSysInstallCb(h, ogain1, "val", ao1p, "gain", NULL );
700
   cmDspSysInstallCb(h, ogain1, "val", ao1p, "gain", NULL );
673
   cmDspSysInstallCb(h, ogain2, "val", ao2p, "gain", NULL );
701
   cmDspSysInstallCb(h, ogain2, "val", ao2p, "gain", NULL );

Loading…
Cancel
Save