Quellcode durchsuchen

cmDspPgmKr.c : Added separate channels for fragment transformation.

master
kevin vor 11 Jahren
Ursprung
Commit
2f0df884b0
1 geänderte Dateien mit 40 neuen und 12 gelöschten Zeilen
  1. 40
    12
      dsp/cmDspPgmKr.c

+ 40
- 12
dsp/cmDspPgmKr.c Datei anzeigen

@@ -85,10 +85,10 @@ const cmChar_t* _mlbl(const cmChar_t* prefix, unsigned ch )
85 85
   return s;
86 86
 }
87 87
 
88
-#define mlbl(a)  _mlbl(a,ch)
88
+#define mlbl(a)  _mlbl(a,mch)
89 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 93
   unsigned        measRtrChCnt = 6; // note: router channel 6 is not connected
94 94
 
@@ -132,7 +132,7 @@ void _cmDspSys_TlXformChain( cmDspSysH_t h, cmDspTlXform_t* c,  unsigned preGrpS
132 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 136
   unsigned paramRtChCnt = 2;
137 137
   cmDspInst_t* mod_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
138 138
   cmDspInst_t* wnd_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
@@ -398,22 +398,30 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
398 398
   cmDspInst_t* amp  = cmDspSysAllocInst(h,"ActiveMeas",  NULL,  1, 100 );
399 399
   cmDspInst_t* rpp  = cmDspSysAllocInst(h,"RecdPlay",    NULL,  6, 2, r.scFn, recdPlayInitAllocSecs, recdPlayMaxLaSecs, recdPlayCurLaSecs, recdPlayFadeRateDbPerSec );
400 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 403
   unsigned   preGrpSymId     = cmDspSysPresetRegisterGroup(h,"tl");
403 404
   unsigned   cmpPreGrpSymId  = cmDspSysPresetRegisterGroup(h,"tl_cmp"); 
404 405
 
405
-  cmDspTlXform_t c0,c1;
406
+  cmDspTlXform_t c0,c1,c2,c3;
406 407
 
407 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 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 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 425
   cmDspInst_t* ao2p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 2 );
418 426
   cmDspInst_t* ao3p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 3 );
419 427
 
@@ -426,6 +434,8 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
426 434
   cmDspInst_t* offb = cmDspSysAllocInst(h,"Button", "stop",    2, kButtonDuiId, 1.0 );
427 435
   cmDspInst_t* prtb = cmDspSysAllocInst(h,"Button", "print",   2, kButtonDuiId, 1.0 );
428 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 439
   cmDspInst_t* prp  = cmDspSysAllocInst(h,"Printer", NULL,   1, ">" );
430 440
   cmDspInst_t* prd  = cmDspSysAllocInst(h,"Printer", NULL,   1, "DYN:" );
431 441
   cmDspInst_t* pre  = cmDspSysAllocInst(h,"Printer", NULL,   1, "EVEN:" );
@@ -487,7 +497,9 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
487 497
   cmDspSysConnectAudio(h, au0Sw,  "a-out", c0.kr0,"in"  );    // sw  -> kr
488 498
   cmDspSysConnectAudio(h, au0Sw,  "a-out", c0.kr1,"in"  );    // sw  -> kr
489 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 503
   cmDspSysConnectAudio(h, mix0,   "out",   ao0p,  "in" );     // mix -> aout
492 504
 
493 505
 
@@ -498,8 +510,10 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
498 510
   cmDspSysConnectAudio(h, au1Sw,  "a-out", c1.kr0,"in"  );    // sw  -> kr
499 511
   cmDspSysConnectAudio(h, au1Sw,  "a-out", c1.kr1,"in"  );    // sw  -> kr
500 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 518
   cmDspSysConnectAudio(h, c0.cmp, "out", afop, "in0" );    // comp -> audio_file_out
505 519
   cmDspSysConnectAudio(h, c1.cmp, "out", afop, "in1" );
@@ -556,6 +570,9 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
556 570
   // active measure loc to xfad channel trigger
557 571
   cmDspSysInstallCb( h, amp,    "scloc",  c0.achan,   "trig", NULL );  // See Also: modp.sw ->achan.trig
558 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 576
   cmDspSysInstallCb( h, amp,    "even",   pre,        "in",   NULL );  // active meas output to printers
560 577
   cmDspSysInstallCb( h, amp,    "dyn",    prd,        "in",   NULL );
561 578
   cmDspSysInstallCb( h, amp,    "tempo",  prt,        "in",   NULL );
@@ -597,6 +614,7 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
597 614
   cmDspSysInstallCb(h, pts, "on",      wtRt,  "s-in",  NULL );
598 615
   cmDspSysInstallCb(h, wtRt,"s-out-0", wtp,   "cmd",   NULL );
599 616
   cmDspSysInstallCb(h, pts, "on",      modp,  "cmd",   NULL );
617
+  cmDspSysInstallCb(h, pts, "on",      modr,  "cmd",   NULL );
600 618
   cmDspSysInstallCb(h, pts, "on",      rpp,   "cmd",   NULL );
601 619
   cmDspSysInstallCb(h, onb, "sym",     amCmd, "rewind",NULL );
602 620
   cmDspSysInstallCb(h, onb, "out",     c0.achan,"reset",  NULL );
@@ -609,6 +627,7 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
609 627
   cmDspSysInstallCb(h, offb, "sym", pts, "off", NULL );
610 628
   cmDspSysInstallCb(h, pts,  "off", wtp, "cmd", NULL );
611 629
   cmDspSysInstallCb(h, pts,  "off", modp,"cmd", NULL );
630
+  cmDspSysInstallCb(h, pts,  "off", modr,"cmd", NULL );
612 631
   cmDspSysInstallCb(h, offb, "sym", mop, "reset", NULL );
613 632
 
614 633
   // time-line to wave-table selection 
@@ -624,6 +643,7 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
624 643
   // score to score follower - to set initial search location
625 644
   cmDspSysInstallCb(h, scp, "sel",    sfp, "index",  NULL );
626 645
   cmDspSysInstallCb(h, scp, "sel",    modp,"reset", NULL );
646
+  cmDspSysInstallCb(h, scp, "sel",    modr,"reset", NULL );
627 647
   
628 648
   //cmDspSysInstallCb(h, reload,"out",  modp, "reload", NULL );
629 649
 
@@ -657,6 +677,7 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
657 677
   // score follower to recd_play,modulator and printers
658 678
   cmDspSysInstallCb(h, sfp, "out",     rpp,     "index", NULL );
659 679
   cmDspSysInstallCb(h, sfp, "out",     modp,    "index", NULL );
680
+  cmDspSysInstallCb(h, sfp, "out",     modr,    "index", NULL );
660 681
   cmDspSysInstallCb(h, sfp, "recent",  prp,     "in",  NULL );  // report 'recent' but only act on 'max' loc index
661 682
 
662 683
   cmDspSysInstallCb(h, prtb, "sym", sfp, "cmd", NULL );
@@ -668,6 +689,13 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
668 689
 
669 690
   cmDspSysInstallCb(h, igain0, "val", ai0p, "gain", NULL );   // input gain control
670 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 699
   cmDspSysInstallCb(h, ogain0, "val", ao0p, "gain", NULL );   // output gain control
672 700
   cmDspSysInstallCb(h, ogain1, "val", ao1p, "gain", NULL );
673 701
   cmDspSysInstallCb(h, ogain2, "val", ao2p, "gain", NULL );

Laden…
Abbrechen
Speichern