소스 검색

cmDspPgmKr.c : Many and various changes following 8/24/14 Disklavier session.

master
Kevin Larke 10 년 전
부모
커밋
10a831cd72
1개의 변경된 파일437개의 추가작업 그리고 65개의 파일을 삭제
  1. 437
    65
      dsp/cmDspPgmKr.c

+ 437
- 65
dsp/cmDspPgmKr.c 파일 보기

@@ -44,6 +44,7 @@ typedef struct
44 44
   const cmChar_t* recordDir;
45 45
   const cmChar_t* midiDevice;
46 46
   const cmChar_t* midiOutPort;
47
+  const cmChar_t* midiOutPort2;
47 48
 } krRsrc_t;
48 49
 
49 50
 cmDspRC_t krLoadRsrc(cmDspSysH_t h, cmErr_t* err, krRsrc_t* r)
@@ -60,6 +61,7 @@ cmDspRC_t krLoadRsrc(cmDspSysH_t h, cmErr_t* err, krRsrc_t* r)
60 61
   cmDspRsrcString(h,&r->recordDir,   "recordDir",    NULL);
61 62
   cmDspRsrcString(h,&r->midiDevice,  "midiDevice",   NULL);
62 63
   cmDspRsrcString(h,&r->midiOutPort, "midiOutPort",  NULL);
64
+  cmDspRsrcString(h,&r->midiOutPort2, "midiOutPort2", NULL);
63 65
 
64 66
   if((rc = cmDspSysLastRC(h)) != kOkDspRC )
65 67
     cmErrMsg(err,rc,"A KR DSP resource load failed.");
@@ -87,7 +89,7 @@ const cmChar_t* _mlbl(const cmChar_t* prefix, unsigned ch )
87 89
 #define mlbl(a)  _mlbl(a,mch)
88 90
 #define lbl(a) cmDspSysPrintLabel(a,ch)
89 91
 
90
-void _cmDspSys_TlXformChain( cmDspSysH_t h, cmDspTlXform_t* c,  unsigned preGrpSymId, unsigned cmpPreGrpSymId, cmDspInst_t* modp, unsigned ch, unsigned mch )
92
+void _cmDspSys_TlXformChain1( cmDspSysH_t h, cmDspTlXform_t* c,  unsigned preGrpSymId, unsigned cmpPreGrpSymId, cmDspInst_t* modp, unsigned ch, unsigned mch )
91 93
 {
92 94
   unsigned        measRtrChCnt = 6; // note: router channel 6 is not connected
93 95
 
@@ -367,14 +369,295 @@ void _cmDspSys_TlXformChain( cmDspSysH_t h, cmDspTlXform_t* c,  unsigned preGrpS
367 369
 
368 370
 }
369 371
 
372
+void _cmDspSys_TlXformChain( cmDspSysH_t h, cmDspTlXform_t* c,  unsigned preGrpSymId, unsigned cmpPreGrpSymId, cmDspInst_t* modp, unsigned ch, unsigned mch )
373
+{
374
+  unsigned        measRtrChCnt = 6; // note: router channel 6 is not connected
375
+
376
+  int             krWndSmpCnt = 2048;
377
+  int             krHopFact   = 4;
378
+
379
+  unsigned        xfadeChCnt  = 2;
380
+  double          xfadeMs     = 50;
381
+  bool            xfadeInitFl = true;
382
+  double          mixGain     = 1.0;
383
+
384
+  bool            cmpBypassFl  = false;
385
+  double          cmpInGain    = 3.0;
386
+  double          cmpThreshDb  = -40.0;
387
+  double          cmpRatio_num = 5.0;
388
+  double          cmpAtkMs     = 20.0;
389
+  double          cmpRlsMs     = 100.0;
390
+  double          cmpMakeup    = 1.0;
391
+  double          cmpWndMaxMs  = 1000.0;
392
+  double          cmpWndMs     = 200.0;
393
+
394
+  cmDspInst_t* achan = cmDspSysAllocInst(h, "AvailCh",     NULL, 1, xfadeChCnt );
395
+  
396
+  // Measurement scale/range 
397
+  cmDspInst_t* even_sr  = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4,  0.8,   1.1, 0.0,   1.0 );
398
+  cmDspInst_t* dynm_sr  = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4,  0.0,   4.0, 0.01,  1.0 );
399
+  cmDspInst_t* tmpo_sr  = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4, 80.0, 120.0, 0.01,  1.0 );
400
+  cmDspInst_t* cost_sr  = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4,  0.0,   1.0, 0.001, 1.0 );
401
+
402
+  // Measurement -> parameter mappers
403
+  cmDspInst_t* even_rt  = cmDspSysAllocInst(h, "Router",      NULL,  2,  measRtrChCnt, measRtrChCnt-1 );
404
+  cmDspInst_t* dynm_rt  = cmDspSysAllocInst(h, "Router",      NULL,  2,  measRtrChCnt, measRtrChCnt-1 );
405
+  cmDspInst_t* tmpo_rt  = cmDspSysAllocInst(h, "Router",      NULL,  2,  measRtrChCnt, measRtrChCnt-1 );
406
+  cmDspInst_t* cost_rt  = cmDspSysAllocInst(h, "Router",      NULL,  2,  measRtrChCnt, measRtrChCnt-1 );
407
+
408
+  // Scale/ranges applied to incoming measurements.
409
+  cmDspInst_t* thr_sr   = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4,  0.0, 1.0, 0.01, 100.0 );
410
+  cmDspInst_t* upr_sr   = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4,  0.0, 1.0, -1.0, 5.0 );
411
+  cmDspInst_t* lwr_sr   = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4,  0.0, 1.0, -5.0, 5.0 );
412
+  cmDspInst_t* off_sr   = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4,  0.0, 1.0,  0.0, 100.0 );
413
+  cmDspInst_t* wet_sr   = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4,  0.0, 1.0,  0.0, 1.0 );
414
+
415
+ 
416
+  // Parameter-> kr routers (routers used to cross-fade between the two kr units)
417
+  unsigned paramRtChCnt = 2;
418
+  cmDspInst_t* mod_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
419
+  cmDspInst_t* wnd_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
420
+  cmDspInst_t* hop_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
421
+  cmDspInst_t* thr_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
422
+  cmDspInst_t* upr_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
423
+  cmDspInst_t* lwr_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
424
+  cmDspInst_t* inv_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
425
+  cmDspInst_t* off_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
426
+  cmDspInst_t* wet_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
427
+
428
+  // Audio processors
429
+  cmDspInst_t* kr0  = cmDspSysAllocInst(h, "Kr",         NULL,   2, krWndSmpCnt, krHopFact );
430
+  //cmDspInst_t* kr1  = cmDspSysAllocInst(h, "Kr",         NULL,   2, krWndSmpCnt, krHopFact );
431
+  cmDspInst_t* xfad = cmDspSysAllocInst(h, "Xfader",     NULL,   3, xfadeChCnt,  xfadeMs, xfadeInitFl ); 
432
+  cmDspInst_t* mix  = cmDspSysAllocInst(h, "AMix",       NULL,   3, xfadeChCnt,  mixGain, mixGain );
433
+  cmDspInst_t* cmp  = cmDspSysAllocInst(h, "Compressor", NULL,   8, cmpBypassFl, cmpThreshDb, cmpRatio_num, cmpAtkMs, cmpRlsMs, cmpMakeup, cmpWndMs, cmpWndMaxMs ); 
434
+
435
+
436
+  // Internal audio connections
437
+  cmDspSysConnectAudio(h, kr0,  "out",   xfad, "in-0");
438
+  //cmDspSysConnectAudio(h, kr1,  "out",   xfad, "in-1");
439
+  cmDspSysConnectAudio(h, xfad, "out-0", mix,  "in-0");
440
+  cmDspSysConnectAudio(h, xfad, "out-1", mix,  "in-1");
441
+  cmDspSysConnectAudio(h, mix,  "out",   cmp,  "in" );
442
+
443
+  // active channel <-> cross-fade connections
444
+  cmDspSysInstallCb(h, achan,  "reset",   xfad, "reset", NULL);
445
+  cmDspSysInstallCb(h, achan,  "gate-0",  xfad, "gate-0", NULL );
446
+  cmDspSysInstallCb(h, achan,  "gate-1",  xfad, "gate-1", NULL );
447
+  cmDspSysInstallCb(h, xfad,   "state-0", achan, "dis-0",  NULL );
448
+  cmDspSysInstallCb(h, xfad,   "state-1", achan, "dis-1",  NULL );
449
+
450
+  
451
+  //  Measurement Number Controls
452
+  cmDspInst_t* min_dynm_ctl    = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Min In Dyn"),      0.0, 10.0, 1.0, 0.0);
453
+  cmDspInst_t* max_dynm_ctl    = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Max In Dyn"),      0.0, 10.0, 1.0, 4.0);
454
+  cmDspInst_t* dynm_map_menu   = cmDspSysAllocMsgListP(h,preGrpSymId, NULL, lbl("DynSel 0"), NULL, "measMenu", measRtrChCnt-1);
455
+
456
+  cmDspInst_t* min_even_ctl   = cmDspSysAllocScalarP(  h,preGrpSymId, NULL, lbl("Min In Even"),    0.0, 1.0, 0.001, 0.75);
457
+  cmDspInst_t* max_even_ctl   = cmDspSysAllocScalarP(  h,preGrpSymId, NULL, lbl("Max In Even"),    0.0, 3.0, 0.001, 1.0);
458
+  cmDspInst_t* even_map_menu  = cmDspSysAllocMsgListP( h,preGrpSymId, NULL, lbl("EvenSel"), NULL, "measMenu", measRtrChCnt-1);
459
+
460
+  cmDspSysNewColumn(h,0);
461
+  cmDspInst_t* min_tmpo_ctl  = cmDspSysAllocScalarP(   h,preGrpSymId, NULL, lbl("Min In Tempo"),   0.0, 200.0, 1.0, 80.0);
462
+  cmDspInst_t* max_tmpo_ctl  = cmDspSysAllocScalarP(   h,preGrpSymId, NULL, lbl("Max In Tempo"),   0.0, 200.0, 1.0, 120.0);
463
+  cmDspInst_t* tmpo_map_menu = cmDspSysAllocMsgListP(  h,preGrpSymId, NULL, lbl("TempoSel"), NULL, "measMenu", measRtrChCnt-1);
464
+
465
+  cmDspInst_t* min_cost_ctl   = cmDspSysAllocScalarP(  h,preGrpSymId, NULL, lbl("Min In Cost"),      0.0, 1.0, 0.01, 0.0);
466
+  cmDspInst_t* max_cost_ctl   = cmDspSysAllocScalarP(  h,preGrpSymId, NULL, lbl("Max In Cost"),      0.0, 1.0, 0.01, 1.0);
467
+  cmDspInst_t* cost_map_menu  = cmDspSysAllocMsgListP( h,preGrpSymId, NULL, lbl("CostSel"), NULL, "measMenu", measRtrChCnt-1);
468
+
469
+  cmDspSysInstallCb(h, min_dynm_ctl, "val",     dynm_sr, "min_in", NULL );
470
+  cmDspSysInstallCb(h, max_dynm_ctl, "val",     dynm_sr, "min_in", NULL );
471
+  cmDspSysInstallCb(h, dynm_map_menu,"out",     dynm_rt, "sel",    NULL );   
472
+  cmDspSysInstallCb(h, dynm_sr,      "val_out", dynm_rt, "f-in",   NULL );
473
+
474
+  cmDspSysInstallCb(h, min_even_ctl, "val",     even_sr, "min_in", NULL );
475
+  cmDspSysInstallCb(h, max_even_ctl, "val",     even_sr, "min_in", NULL );
476
+  cmDspSysInstallCb(h, even_map_menu,"out",     even_rt, "sel",    NULL );   
477
+  cmDspSysInstallCb(h, even_sr,      "val_out", even_rt, "f-in",   NULL );
478
+
479
+  cmDspSysInstallCb(h, min_tmpo_ctl, "val",     tmpo_sr, "min_in", NULL );
480
+  cmDspSysInstallCb(h, max_tmpo_ctl, "val",     tmpo_sr, "min_in", NULL );
481
+  cmDspSysInstallCb(h, tmpo_map_menu,"out",     tmpo_rt, "sel",    NULL );   
482
+  cmDspSysInstallCb(h, tmpo_sr,      "val_out", tmpo_rt, "f-in",   NULL );
483
+  
484
+  cmDspSysInstallCb(h, min_cost_ctl, "val",     cost_sr, "min_in", NULL );
485
+  cmDspSysInstallCb(h, max_cost_ctl, "val",     cost_sr, "min_in", NULL );
486
+  cmDspSysInstallCb(h, cost_map_menu,"out",     cost_rt, "sel",    NULL );   
487
+  cmDspSysInstallCb(h, cost_sr,      "val_out", cost_rt, "f-in",   NULL );
488
+
489
+  cmDspSysNewColumn(h,0);
490
+  cmDspInst_t* min_thr_ctl   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Min Thresh"),       0.0,100.0, 1.0, 30.0);
491
+  cmDspInst_t* max_thr_ctl   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Max Thresh"),       0.0,100.0, 1.0, 80.0);
492
+  cmDspInst_t* min_upr_ctl   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Min Upr"),         -1.0,  1.0, 0.001, -0.5);
493
+  cmDspInst_t* max_upr_ctl   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Max Upr"),         -1.0,  1.0, 0.001, 0.5);
494
+  cmDspInst_t* min_lwr_ctl   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Min Lwr"),          0.0, -1.0, 5.0, 1.0);
495
+  cmDspInst_t* max_lwr_ctl   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Max Lwr"),          0.0, -1.0, 5.0, 3.0);
496
+  cmDspInst_t* min_off_ctl   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Min Off"),          0.0, 50.0, 0.1, 30.0);
497
+  cmDspInst_t* max_off_ctl   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Max Off"),          0.0, 50.0, 0.1, 30.0);
498
+  cmDspInst_t* min_wet_ctl   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Min Wet"),          0.0,  1.0, 0.01, 1.0);
499
+  cmDspInst_t* max_wet_ctl   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Max Wet"),          0.0,  1.0, 0.01, 1.0);
500
+
501
+
502
+  // Parameter number controls 
503
+  cmDspSysNewColumn(h,0);
504
+  cmDspInst_t* mod_ctl = cmDspSysAllocScalarP( h,preGrpSymId,NULL, lbl("Mode"),      0.0, 4.0, 1.0, 1.0);
505
+  cmDspInst_t* wnd_ctl = cmDspSysAllocMsgListP(h,preGrpSymId,NULL, lbl("WndSmpCnt"), NULL, "wndSmpCnt", 2);
506
+  cmDspInst_t* hop_ctl = cmDspSysAllocMsgListP(h,preGrpSymId,NULL, lbl("HopFact"),   NULL, "hopFact",   2);
507
+  cmDspInst_t* thr_ctl = cmDspSysAllocScalarP( h,preGrpSymId,NULL, lbl("Threshold"), 0.0, 100.0, 1.0,  60.0 );
508
+  cmDspInst_t* upr_ctl = cmDspSysAllocScalarP( h,preGrpSymId,NULL, lbl("Upr slope"), 0.0,  10.0, 0.01,  0.0 ); 
509
+  cmDspInst_t* lwr_ctl = cmDspSysAllocScalarP( h,preGrpSymId,NULL, lbl("Lwr slope"), 0.3,  10.0, 0.01,  2.0 );
510
+  cmDspInst_t* off_ctl = cmDspSysAllocScalarP( h,preGrpSymId,NULL, lbl("Offset"),    0.0, 100.0, 0.01, 20.0 );
511
+  cmDspInst_t* inv_ctl = cmDspSysAllocScalarP( h,preGrpSymId,NULL, lbl("Invert"),    0.0,   1.0, 1.0,   0.0 );  
512
+  cmDspInst_t* wet_ctl = cmDspSysAllocScalarP( h,preGrpSymId,NULL, lbl("Wet Dry"),   0.0,   1.0, 0.001, 1.0 );  
513
+
514
+  cmDspSysInstallCb(h, mod_ctl, "val",         mod_rt, "f-in",    NULL );
515
+  cmDspSysInstallCb(h, achan,   "ch",          mod_rt, "sel",     NULL );   // ach->rt sel
516
+  cmDspSysInstallCb(h, mod_rt,  "f-out-0",     kr0,    "mode",    NULL );   // mode->kr
517
+  //cmDspSysInstallCb(h, mod_rt,  "f-out-1",     kr1,    "mode",    NULL );   // mode->kr
518
+
519
+  cmDspSysInstallCb(h, wnd_ctl, "out",         wnd_rt, "f-in",    NULL );
520
+  cmDspSysInstallCb(h, achan,   "ch",          wnd_rt, "sel",     NULL );   // ach->rt sel
521
+  cmDspSysInstallCb(h, wnd_rt,  "f-out-0",     kr0,    "wndn",    NULL );   // wndn->kr
522
+  //cmDspSysInstallCb(h, wnd_rt,  "f-out-1",     kr1,    "wndn",    NULL );   // wndn->kr
523
+
524
+  cmDspSysInstallCb(h, hop_ctl, "out",         hop_rt, "f-in",    NULL );
525
+  cmDspSysInstallCb(h, achan,   "ch",          hop_rt, "sel",     NULL );   // ach->rt sel
526
+  cmDspSysInstallCb(h, hop_rt,  "f-out-0",     kr0,    "hopf",    NULL );   // hopf->kr
527
+  //cmDspSysInstallCb(h, hop_rt,  "f-out-1",     kr1,    "hopf",    NULL );   // hopf->kr
528
+
529
+  cmDspSysInstallCb(h, min_thr_ctl, "val",     thr_sr, "min_out", NULL );
530
+  cmDspSysInstallCb(h, max_thr_ctl, "val",     thr_sr, "max_out", NULL );
531
+  cmDspSysInstallCb(h, even_rt,     "f-out-0", thr_sr, "val_in",  NULL );
532
+  cmDspSysInstallCb(h, dynm_rt,     "f-out-0", thr_sr, "val_in",  NULL );
533
+  cmDspSysInstallCb(h, tmpo_rt,     "f-out-0", thr_sr, "val_in",  NULL );
534
+  cmDspSysInstallCb(h, cost_rt,     "f-out-0", thr_sr, "val_in",  NULL );
535
+  cmDspSysInstallCb(h, thr_sr,      "val_out", thr_ctl,"val",     NULL );
536
+  cmDspSysInstallCb(h, thr_ctl,     "val",     thr_rt, "f-in",    NULL );
537
+  cmDspSysInstallCb(h, achan,       "ch",      thr_rt, "sel",     NULL );   // ach->rt sel
538
+  cmDspSysInstallCb(h, thr_rt,      "f-out-0", kr0,    "thrh",    NULL );   // thr->kr
539
+  //cmDspSysInstallCb(h, thr_rt,      "f-out-1", kr1,    "thrh",    NULL );   // thr->kr
540
+
541
+  cmDspSysInstallCb(h, min_upr_ctl, "val",     upr_sr, "min_out", NULL );
542
+  cmDspSysInstallCb(h, max_upr_ctl, "val",     upr_sr, "max_out", NULL );
543
+  cmDspSysInstallCb(h, even_rt,     "f-out-1", upr_sr, "val_in",  NULL );
544
+  cmDspSysInstallCb(h, dynm_rt,     "f-out-1", upr_sr, "val_in",  NULL );
545
+  cmDspSysInstallCb(h, tmpo_rt,     "f-out-1", upr_sr, "val_in",  NULL );
546
+  cmDspSysInstallCb(h, cost_rt,     "f-out-1", upr_sr, "val_in",  NULL );
547
+  cmDspSysInstallCb(h, upr_sr,      "val_out", upr_ctl,"val",     NULL );
548
+  cmDspSysInstallCb(h, upr_ctl,     "val",     upr_rt, "f-in",    NULL );
549
+  cmDspSysInstallCb(h, achan,       "ch",      upr_rt, "sel",     NULL );   // ach->rt sel
550
+  cmDspSysInstallCb(h, upr_rt,      "f-out-0", kr0,    "uprs",    NULL );   // upr->kr
551
+  //cmDspSysInstallCb(h, upr_rt,      "f-out-1", kr1,    "uprs",    NULL );   // upr->kr
552
+
553
+  cmDspSysInstallCb(h, min_lwr_ctl, "val",     lwr_sr, "min_out", NULL );
554
+  cmDspSysInstallCb(h, max_lwr_ctl, "val",     lwr_sr, "max_out", NULL );
555
+  cmDspSysInstallCb(h, even_rt,     "f-out-2", lwr_sr, "val_in",  NULL );
556
+  cmDspSysInstallCb(h, dynm_rt,     "f-out-2", lwr_sr, "val_in",  NULL );
557
+  cmDspSysInstallCb(h, tmpo_rt,     "f-out-2", lwr_sr, "val_in",  NULL );
558
+  cmDspSysInstallCb(h, cost_rt,     "f-out-2", lwr_sr, "val_in",  NULL );
559
+  cmDspSysInstallCb(h, lwr_sr,      "val_out", lwr_ctl,"val",     NULL );
560
+  cmDspSysInstallCb(h, lwr_ctl,     "val",     lwr_rt, "f-in",    NULL );
561
+  cmDspSysInstallCb(h, achan,       "ch",      lwr_rt, "sel",     NULL );   // ach->rt sel
562
+  cmDspSysInstallCb(h, lwr_rt,      "f-out-0", kr0,    "lwrs",    NULL );   // lwr->kr
563
+  //cmDspSysInstallCb(h, lwr_rt,      "f-out-1", kr1,    "lwrs",    NULL );   // lwr->kr
564
+
565
+  cmDspSysInstallCb(h, min_off_ctl, "val",     off_sr, "min_out", NULL );
566
+  cmDspSysInstallCb(h, max_off_ctl, "val",     off_sr, "max_out", NULL );
567
+  cmDspSysInstallCb(h, even_rt,     "f-out-3", off_sr, "val_in",  NULL );
568
+  cmDspSysInstallCb(h, dynm_rt,     "f-out-3", off_sr, "val_in",  NULL );
569
+  cmDspSysInstallCb(h, tmpo_rt,     "f-out-3", off_sr, "val_in",  NULL );
570
+  cmDspSysInstallCb(h, cost_rt,     "f-out-3", off_sr, "val_in",  NULL );
571
+  cmDspSysInstallCb(h, off_sr,      "val_out", off_ctl,"val",     NULL );
572
+  cmDspSysInstallCb(h, off_ctl,     "val",     off_rt, "f-in",    NULL );
573
+  cmDspSysInstallCb(h, achan,       "ch",      off_rt, "sel",     NULL );   // ach->rt sel
574
+  cmDspSysInstallCb(h, off_rt,      "f-out-0", kr0,    "offs",    NULL );   // off->kr
575
+  //cmDspSysInstallCb(h, off_rt,      "f-out-1", kr1,    "offs",    NULL );   // off->kr
576
+
577
+  cmDspSysInstallCb(h, inv_ctl,     "val",     inv_rt, "f-in",   NULL );
578
+  cmDspSysInstallCb(h, achan,       "ch",      inv_rt, "sel",    NULL );   // ach->rt sel
579
+  cmDspSysInstallCb(h, inv_rt,      "f-out-0", kr0,    "invt",   NULL );   // inv->kr
580
+  //cmDspSysInstallCb(h, inv_rt,      "f-out-1", kr1,    "invt",   NULL );   // inv->kr
581
+
582
+  cmDspSysInstallCb(h, min_wet_ctl, "val",     wet_sr, "min_out", NULL );
583
+  cmDspSysInstallCb(h, max_wet_ctl, "val",     wet_sr, "max_out", NULL );
584
+  cmDspSysInstallCb(h, even_rt,     "f-out-4", wet_sr, "val_in",  NULL );
585
+  cmDspSysInstallCb(h, dynm_rt,     "f-out-4", wet_sr, "val_in",  NULL );
586
+  cmDspSysInstallCb(h, tmpo_rt,     "f-out-4", wet_sr, "val_in",  NULL );
587
+  cmDspSysInstallCb(h, cost_rt,     "f-out-4", wet_sr, "val_in",  NULL );
588
+
589
+  cmDspSysInstallCb(h, wet_sr,      "val_out", wet_ctl,"val",     NULL );
590
+  cmDspSysInstallCb(h, wet_ctl,     "val",     wet_rt, "f-in",    NULL );
591
+  cmDspSysInstallCb(h, achan,       "ch",      wet_rt, "sel",     NULL );   // ach->rt sel
592
+  cmDspSysInstallCb(h, wet_rt,      "f-out-0", kr0,    "wet",     NULL );   // wet->kr
593
+  //cmDspSysInstallCb(h, wet_rt,      "f-out-1", kr1,    "wet",     NULL );   // wet->kr
594
+  
595
+
596
+  cmDspSysNewColumn(h,0);
597
+  cmDspInst_t* cmp_byp   = cmDspSysAllocCheckP(  h, cmpPreGrpSymId, NULL, lbl("Bypass"), 1.0 );
598
+  cmDspInst_t* cmp_igain = cmDspSysAllocScalarP( h, cmpPreGrpSymId, NULL, lbl("In Gain"),  0.0,   10.0, 0.1, cmpInGain);
599
+  cmDspInst_t* cmp_thr   = cmDspSysAllocScalarP( h, cmpPreGrpSymId, NULL, lbl("ThreshDb"), -100.0, 0.0, 0.1, cmpThreshDb);
600
+  cmDspInst_t* cmp_rat   = cmDspSysAllocScalarP( h, cmpPreGrpSymId, NULL, lbl("Ratio"),    0.1, 100, 0.1, cmpRatio_num);
601
+  cmDspInst_t* cmp_atk   = cmDspSysAllocScalarP( h, cmpPreGrpSymId, NULL, lbl("Atk Ms"),   0.0, 1000.0, 0.1, cmpAtkMs);
602
+  cmDspInst_t* cmp_rls   = cmDspSysAllocScalarP( h, cmpPreGrpSymId, NULL, lbl("Rls Ms"),   0.0, 1000.0, 0.1, cmpRlsMs);
603
+  cmDspInst_t* cmp_mkup  = cmDspSysAllocScalarP( h, cmpPreGrpSymId, NULL, lbl("Makeup"),   0.0, 10.0,   0.01, cmpMakeup);
604
+  cmDspInst_t* cmp_wnd   = cmDspSysAllocScalarP( h, cmpPreGrpSymId, NULL, lbl("Wnd Ms"),   1.0, cmpWndMaxMs, 1.0, cmpWndMs );
605
+  cmDspInst_t* cmp_mtr   = cmDspSysAllocInst(h,"Meter",lbl("Env"), 3, 0.0, 0.0, 1.0);
606
+
607
+  cmDspSysInstallCb(h, cmp_byp,  "out", cmp, "bypass", NULL );
608
+  cmDspSysInstallCb(h, cmp_igain,"val", cmp, "igain", NULL );
609
+  cmDspSysInstallCb(h, cmp_thr,  "val", cmp, "thr", NULL );
610
+  cmDspSysInstallCb(h, cmp_rat,  "val", cmp, "ratio", NULL );
611
+  cmDspSysInstallCb(h, cmp_atk,  "val", cmp, "atk", NULL );
612
+  cmDspSysInstallCb(h, cmp_rls,  "val", cmp, "rls", NULL );
613
+  cmDspSysInstallCb(h, cmp_mkup, "val", cmp, "ogain", NULL );
614
+  cmDspSysInstallCb(h, cmp_wnd,  "val", cmp, "wnd", NULL );
615
+  cmDspSysInstallCb(h, cmp,      "env", cmp_mtr, "in", NULL );
616
+
617
+  cmDspSysInstallCb(h, modp, mlbl("cbyp"),    cmp_byp,  "in", NULL );
618
+  cmDspSysInstallCb(h, modp, mlbl("cigain"),  cmp_igain,"val", NULL );
619
+  cmDspSysInstallCb(h, modp, mlbl("cthrsh"),  cmp_thr,  "val", NULL );
620
+  cmDspSysInstallCb(h, modp, mlbl("cratio"),  cmp_rat,  "val", NULL );
621
+  cmDspSysInstallCb(h, modp, mlbl("catkms"),  cmp_atk,  "val", NULL );
622
+  cmDspSysInstallCb(h, modp, mlbl("crlsms"),  cmp_rls,  "val", NULL );
623
+  cmDspSysInstallCb(h, modp, mlbl("cmakeup"), cmp_mkup, "val", NULL );
624
+  cmDspSysInstallCb(h, modp, mlbl("cwndms"),  cmp_wnd,  "val", NULL );
625
+
626
+  // 
627
+  cmDspInst_t* xfadMs = cmDspSysAllocInst(h,"Scalar", lbl("Xfade Ms"),     5, kNumberDuiId, 0.0,   1000.0,0.01, 50.0 );  
628
+  cmDspSysInstallCb(h, xfadMs, "val", xfad, "ms", NULL );
629
+  cmDspSysInstallCb(h, modp, mlbl("xfad"), xfadMs,  "val", NULL);
630
+
631
+  cmDspSysInstallCb(h, modp, mlbl("win"),  wnd_ctl, "sel",  NULL );
632
+  cmDspSysInstallCb(h, modp, mlbl("hop"),  hop_ctl, "sel", NULL );
633
+  cmDspSysInstallCb(h, modp, mlbl("mod"),  mod_ctl, "val", NULL );
634
+  cmDspSysInstallCb(h, modp, mlbl("thr"),  thr_ctl, "val", NULL );
635
+  cmDspSysInstallCb(h, modp, mlbl("upr"),  upr_ctl, "val", NULL );
636
+  cmDspSysInstallCb(h, modp, mlbl("lwr"),  lwr_ctl, "val", NULL );
637
+  cmDspSysInstallCb(h, modp, mlbl("mint"), min_thr_ctl, "val", NULL );
638
+  cmDspSysInstallCb(h, modp, mlbl("maxt"), max_thr_ctl, "val", NULL );
639
+  cmDspSysInstallCb(h, modp, mlbl("minu"), min_upr_ctl, "val", NULL );
640
+  cmDspSysInstallCb(h, modp, mlbl("maxu"), max_upr_ctl, "val", NULL );
641
+  cmDspSysInstallCb(h, modp, mlbl("minl"), min_lwr_ctl, "val", NULL );
642
+  cmDspSysInstallCb(h, modp, mlbl("maxl"), max_lwr_ctl, "val", NULL );
643
+  cmDspSysInstallCb(h, modp, mlbl("sw"),   achan,       "trig", NULL ); // See also: amp.sfloc->achan.trig
644
+
645
+  c->achan = achan; 
646
+  c->kr0   = kr0; 
647
+  //c->kr1   = kr1;
648
+  c->cmp   = cmp; 
649
+
650
+}
651
+
370 652
 cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
371 653
 {
372 654
   cmDspRC_t       rc         = kOkDspRC;
373 655
   cmCtx_t*        cmCtx      = cmDspSysPgmCtx(h);
374 656
   cmErr_t         err;
375 657
   krRsrc_t        r;
376
-  bool            fragFl     = true;
377
-  bool            useWtFl    = true;
658
+  bool            fragFl     = false;
659
+  bool            useWtFl    = false;
660
+  bool            useChain1Fl= true;
378 661
   unsigned        wtLoopCnt  = 1;                            // 1=play once (-1=loop forever)
379 662
   unsigned        wtInitMode = 0;                            // initial wt mode is 'silence'
380 663
   unsigned        wtSmpCnt   = floor(cmDspSysSampleRate(h)); // wt length == srate
@@ -388,15 +671,30 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
388 671
   double          recdPlayCurLaSecs        = 0.1;
389 672
   double          recdPlayFadeRateDbPerSec = 4.0;
390 673
 
674
+  /*
675
+  bool            cmpBypassFl  = false;
676
+  double          cmpInGain    = 3.0;
677
+  double          cmpThreshDb  = -40.0;
678
+  double          cmpRatio_num = 5.0;
679
+  double          cmpAtkMs     = 20.0;
680
+  double          cmpRlsMs     = 100.0;
681
+  double          cmpMakeup    = 1.0;
682
+  double          cmpWndMaxMs  = 1000.0;
683
+  double          cmpWndMs     = 200.0;
684
+  */
685
+
391 686
   memset(&r,0,sizeof(r));
392 687
   cmErrSetup(&err,&cmCtx->rpt,"Kr Timeline");
393 688
 
394 689
   if( krLoadRsrc(h,&err,&r) != kOkDspRC )
395 690
     return rc;
396 691
 
692
+  cmDspInst_t* ai0p = cmDspSysAllocInst(h,"AudioIn",     NULL,  1, 2);
693
+  cmDspInst_t* ai1p = cmDspSysAllocInst(h,"AudioIn",     NULL,  1, 3);
694
+
695
+  //cmDspInst_t* ci0p = cmDspSysAllocInst(h,"Compressor",  NULL,  8, cmpBypassFl, cmpThreshDb, cmpRatio_num, cmpAtkMs, cmpRlsMs, cmpMakeup, cmpWndMs, cmpWndMaxMs ); 
696
+  //cmDspInst_t* ci1p = cmDspSysAllocInst(h,"Compressor",  NULL,  8, cmpBypassFl, cmpThreshDb, cmpRatio_num, cmpAtkMs, cmpRlsMs, cmpMakeup, cmpWndMs, cmpWndMaxMs ); 
397 697
 
398
-  cmDspInst_t* ai0p = cmDspSysAllocInst(h,"AudioIn",     NULL,  1, 0);
399
-  cmDspInst_t* ai1p = cmDspSysAllocInst(h,"AudioIn",     NULL,  1, 1);
400 698
 
401 699
   cmDspInst_t* tlp  = cmDspSysAllocInst(h,"TimeLine",    "tl",  2, r.tlFn, r.tlPrefixPath );
402 700
   cmDspInst_t* scp  = cmDspSysAllocInst(h,"Score",       "sc",  1, r.scFn );
@@ -404,9 +702,11 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
404 702
   cmDspInst_t* wtp  = cmDspSysAllocInst(h,"WaveTable",   NULL,  4, wtSmpCnt, wtInitMode, NULL, wtLoopCnt );
405 703
   cmDspInst_t* pts  = cmDspSysAllocInst(h,"PortToSym",   NULL,  2, "on", "off" );
406 704
   cmDspInst_t* mip  = cmDspSysAllocInst(h,"MidiIn",      NULL,  0 );
705
+
407 706
   cmDspInst_t* mfp  = cmDspSysAllocInst(h,"MidiFilePlay",NULL,  0 );
408 707
   cmDspInst_t* nmp  = cmDspSysAllocInst(h,"NanoMap",     NULL,  0 );
409 708
   cmDspInst_t* mop  = cmDspSysAllocInst(h,"MidiOut",     NULL,  2, r.midiDevice,r.midiOutPort);
709
+  cmDspInst_t* mo2p = cmDspSysAllocInst(h,"MidiOut",     NULL,  2, r.midiDevice,r.midiOutPort2);
410 710
   cmDspInst_t* sfp  = cmDspSysAllocInst(h,"ScFol",       NULL,  1, r.scFn, sfBufCnt, sfMaxWndCnt, sfMinVel, sfEnaMeasFl );
411 711
   cmDspInst_t* amp  = cmDspSysAllocInst(h,"ActiveMeas",  NULL,  1, 100 );
412 712
   cmDspInst_t* rpp  = cmDspSysAllocInst(h,"RecdPlay",    NULL,  6, 2, r.scFn, recdPlayInitAllocSecs, recdPlayMaxLaSecs, recdPlayCurLaSecs, recdPlayFadeRateDbPerSec);
@@ -421,8 +721,11 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
421 721
   cmDspSysNewPage(h,"Controls-0");
422 722
   _cmDspSys_TlXformChain(h, &c0, preGrpSymId, cmpPreGrpSymId, modp, 0, 0 );
423 723
 
424
-  cmDspSysNewPage(h,"Controls-1");
425
-  _cmDspSys_TlXformChain(h, &c1, preGrpSymId, cmpPreGrpSymId, modp, 1, 1 );
724
+  if( useChain1Fl )
725
+  {
726
+    cmDspSysNewPage(h,"Controls-1");
727
+    _cmDspSys_TlXformChain(h, &c1, preGrpSymId, cmpPreGrpSymId, modp, 1, 1 );
728
+  }
426 729
 
427 730
   cmDspInst_t* mix0 = NULL;
428 731
   cmDspInst_t* mix1 = NULL;
@@ -439,11 +742,60 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
439 742
     mix1 = cmDspSysAllocInst(h,"AMix",        NULL,   3, 2, 1.0, 1.0 );
440 743
   }
441 744
 
745
+  /*
746
+  if( useCmpFl )
747
+  {
748
+    cmDspSysNewPage(h,"InComp");
749
+
750
+    cmDspInst_t* cmp0_byp   = cmDspSysAllocCheckP(  h, cmpPreGrpSymId, NULL, ("0-Bypass"), 0.0 );
751
+    cmDspInst_t* cmp0_igain = cmDspSysAllocScalarP( h, cmpPreGrpSymId, NULL, ("0-In Gain"),  0.0,   10.0, 0.1, cmpInGain);
752
+    cmDspInst_t* cmp0_thr   = cmDspSysAllocScalarP( h, cmpPreGrpSymId, NULL, ("0-ThreshDb"), -100.0, 0.0, 0.1, cmpThreshDb);
753
+    cmDspInst_t* cmp0_rat   = cmDspSysAllocScalarP( h, cmpPreGrpSymId, NULL, ("0-Ratio"),    0.1, 100, 0.1, cmpRatio_num);
754
+    cmDspInst_t* cmp0_atk   = cmDspSysAllocScalarP( h, cmpPreGrpSymId, NULL, ("0-Atk Ms"),   0.0, 1000.0, 0.1, cmpAtkMs);
755
+    cmDspInst_t* cmp0_rls   = cmDspSysAllocScalarP( h, cmpPreGrpSymId, NULL, ("0-Rls Ms"),   0.0, 1000.0, 0.1, cmpRlsMs);
756
+    cmDspInst_t* cmp0_mkup  = cmDspSysAllocScalarP( h, cmpPreGrpSymId, NULL, ("0-Makeup"),   0.0, 10.0,   0.01, cmpMakeup);
757
+    cmDspInst_t* cmp0_wnd   = cmDspSysAllocScalarP( h, cmpPreGrpSymId, NULL, ("0-Wnd Ms"),   1.0, cmpWndMaxMs, 1.0, cmpWndMs );
758
+    cmDspInst_t* cmp0_mtr   = cmDspSysAllocInst(h,"Meter",("0-Env"), 3, 0.0, 0.0, 1.0);
759
+
760
+    cmDspSysInstallCb(h, cmp0_byp,  "out", ci0p, "bypass", NULL );
761
+    cmDspSysInstallCb(h, cmp0_igain,"val", ci0p, "igain", NULL );
762
+    cmDspSysInstallCb(h, cmp0_thr,  "val", ci0p, "thr", NULL );
763
+    cmDspSysInstallCb(h, cmp0_rat,  "val", ci0p, "ratio", NULL );
764
+    cmDspSysInstallCb(h, cmp0_atk,  "val", ci0p, "atk", NULL );
765
+    cmDspSysInstallCb(h, cmp0_rls,  "val", ci0p, "rls", NULL );
766
+    cmDspSysInstallCb(h, cmp0_mkup, "val", ci0p, "ogain", NULL );
767
+    cmDspSysInstallCb(h, cmp0_wnd,  "val", ci0p, "wnd", NULL );
768
+    cmDspSysInstallCb(h, ci0p,      "env", cmp0_mtr, "in", NULL );
769
+
770
+    cmDspSysNewColumn(h,0);
771
+    cmDspInst_t* cmp1_byp   = cmDspSysAllocCheckP(  h, cmpPreGrpSymId, NULL, ("1-Bypass"), 0.0 );
772
+    cmDspInst_t* cmp1_igain = cmDspSysAllocScalarP( h, cmpPreGrpSymId, NULL, ("1-In Gain"),  0.0,   10.0, 0.1, cmpInGain);
773
+    cmDspInst_t* cmp1_thr   = cmDspSysAllocScalarP( h, cmpPreGrpSymId, NULL, ("1-ThreshDb"), -100.0, 0.0, 0.1, cmpThreshDb);
774
+    cmDspInst_t* cmp1_rat   = cmDspSysAllocScalarP( h, cmpPreGrpSymId, NULL, ("1-Ratio"),    0.1, 100, 0.1, cmpRatio_num);
775
+    cmDspInst_t* cmp1_atk   = cmDspSysAllocScalarP( h, cmpPreGrpSymId, NULL, ("1-Atk Ms"),   0.0, 1000.0, 0.1, cmpAtkMs);
776
+    cmDspInst_t* cmp1_rls   = cmDspSysAllocScalarP( h, cmpPreGrpSymId, NULL, ("1-Rls Ms"),   0.0, 1000.0, 0.1, cmpRlsMs);
777
+    cmDspInst_t* cmp1_mkup  = cmDspSysAllocScalarP( h, cmpPreGrpSymId, NULL, ("1-Makeup"),   0.0, 10.0,   0.01, cmpMakeup);
778
+    cmDspInst_t* cmp1_wnd   = cmDspSysAllocScalarP( h, cmpPreGrpSymId, NULL, ("1-Wnd Ms"),   1.0, cmpWndMaxMs, 1.0, cmpWndMs );
779
+    cmDspInst_t* cmp1_mtr   = cmDspSysAllocInst(h,"Meter",("1-Env"), 3, 0.0, 0.0, 1.0);
780
+
781
+    cmDspSysInstallCb(h, cmp1_byp,  "out", ci1p, "bypass", NULL );
782
+    cmDspSysInstallCb(h, cmp1_igain,"val", ci1p, "igain", NULL );
783
+    cmDspSysInstallCb(h, cmp1_thr,  "val", ci1p, "thr", NULL );
784
+    cmDspSysInstallCb(h, cmp1_rat,  "val", ci1p, "ratio", NULL );
785
+    cmDspSysInstallCb(h, cmp1_atk,  "val", ci1p, "atk", NULL );
786
+    cmDspSysInstallCb(h, cmp1_rls,  "val", ci1p, "rls", NULL );
787
+    cmDspSysInstallCb(h, cmp1_mkup, "val", ci1p, "ogain", NULL );
788
+    cmDspSysInstallCb(h, cmp1_wnd,  "val", ci1p, "wnd", NULL );
789
+    cmDspSysInstallCb(h, ci1p,      "env", cmp1_mtr, "in", NULL );
790
+
791
+  }
792
+  */
793
+
442 794
 
443 795
   cmDspInst_t* ao0p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 0 );
444 796
   cmDspInst_t* ao1p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 1 );
445
-  cmDspInst_t* ao2p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 2 );
446
-  cmDspInst_t* ao3p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 3 );
797
+  //cmDspInst_t* ao2p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 2 );
798
+  //cmDspInst_t* ao3p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 3 );
447 799
 
448 800
   cmDspSysNewPage(h,"Main");
449 801
   cmDspInst_t* liveb= cmDspSysAllocInst(h,"Button", "live",    2, kCheckDuiId,  0.0 );
@@ -477,15 +829,15 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
477 829
   cmDspInst_t* stRt  = cmDspSysAllocInst(h,"Router", NULL, 2, 2, 0);
478 830
 
479 831
   cmDspSysNewColumn(h,0);
480
-  cmDspInst_t* igain0 = cmDspSysAllocInst(h,"Scalar", "In Gain-0",    5, kNumberDuiId, 0.0,   10.0,0.01,   1.0 );  
481
-  cmDspInst_t* igain1 = cmDspSysAllocInst(h,"Scalar", "In Gain-1",    5, kNumberDuiId, 0.0,   10.0,0.01,   1.0 );  
832
+  cmDspInst_t* igain0 = cmDspSysAllocInst(h,"Scalar", "In Gain-0",    5, kNumberDuiId, 0.0,   100.0,0.01,   1.0 );  
833
+  cmDspInst_t* igain1 = cmDspSysAllocInst(h,"Scalar", "In Gain-1",    5, kNumberDuiId, 0.0,   100.0,0.01,   1.0 );  
482 834
 
483 835
   cmDspInst_t* lasecs = cmDspSysAllocInst(h,"Scalar", "LA Secs",      5, kNumberDuiId, 0.0,   recdPlayMaxLaSecs,0.01,   recdPlayCurLaSecs );  
484 836
   cmDspInst_t* dbpsec = cmDspSysAllocInst(h,"Scalar", "Fade dBpSec",  5, kNumberDuiId, 0.0,   24.0, 0.01, recdPlayFadeRateDbPerSec);
485
-  cmDspInst_t* ogain0 = cmDspSysAllocInst(h,"Scalar", "Out Gain-0",   5, kNumberDuiId, 0.0,   10.0,0.01,   3.0 );  
486
-  cmDspInst_t* ogain1 = cmDspSysAllocInst(h,"Scalar", "Out Gain-1",   5, kNumberDuiId, 0.0,   10.0,0.01,   3.0 );  
487
-  cmDspInst_t* ogain2 = cmDspSysAllocInst(h,"Scalar", "Out Gain-2",   5, kNumberDuiId, 0.0,   10.0,0.01,   3.0 );  
488
-  cmDspInst_t* ogain3 = cmDspSysAllocInst(h,"Scalar", "Out Gain-3",   5, kNumberDuiId, 0.0,   10.0,0.01,   3.0 );  
837
+  cmDspInst_t* ogain0 = cmDspSysAllocInst(h,"Scalar", "Out Gain-0",   5, kNumberDuiId, 0.0,   10.0,0.01,   1.0 );  
838
+  cmDspInst_t* ogain1 = cmDspSysAllocInst(h,"Scalar", "Out Gain-1",   5, kNumberDuiId, 0.0,   10.0,0.01,   1.0 );  
839
+  cmDspInst_t* ogain2 = cmDspSysAllocInst(h,"Scalar", "Out Gain-2",   5, kNumberDuiId, 0.0,   10.0,0.01,   1.0 );  
840
+  cmDspInst_t* ogain3 = cmDspSysAllocInst(h,"Scalar", "Out Gain-3",   5, kNumberDuiId, 0.0,   10.0,0.01,   1.0 );  
489 841
 
490 842
   cmDspInst_t* scLoc = cmDspSysAllocInst(h,"Scalar", "Sc Loc",   5, kNumberDuiId, 0.0,   3000.0, 1.0,   0.0 );  
491 843
 
@@ -514,17 +866,18 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
514 866
   if( useWtFl )
515 867
   {
516 868
     cmDspSysConnectAudio(h, wtp,    "out",   au0Sw, "a-in-0" ); // wt  -> sw
517
-    cmDspSysConnectAudio(h, ai0p,   "out",   au0Sw, "a-in-1" ); // ain -> sw
518
-    cmDspSysConnectAudio(h, ai0p,   "out",   mi0p,  "in" );     
869
+    cmDspSysConnectAudio(h, ai0p,   "out",   au0Sw, "a-in-1" );      // ain -> sw
870
+    //cmDspSysConnectAudio(h, ci0p,   "out",   au0Sw, "a-in-1" );
519 871
     cmDspSysConnectAudio(h, au0Sw,  "a-out", rpp,   "in-0");    // sw  -> rcdply
520 872
     cmDspSysConnectAudio(h, au0Sw,  "a-out", c0.kr0,"in"  );    // sw  -> kr
521
-    cmDspSysConnectAudio(h, au0Sw,  "a-out", c0.kr1,"in"  );    // sw  -> kr
873
+    //cmDspSysConnectAudio(h, au0Sw,  "a-out", c0.kr1,"in"  );    // sw  -> kr
874
+    cmDspSysConnectAudio(h, au0Sw,  "a-out",  mi0p,  "in" );    // sw  -> meter  
522 875
   }
523 876
   else
524 877
   {
525 878
     cmDspSysConnectAudio(h, ai0p,  "out", rpp,   "in-0");    // sw  -> rcdply
526 879
     cmDspSysConnectAudio(h, ai0p,   "out",   c0.kr0, "in" ); // ain -> sw
527
-    cmDspSysConnectAudio(h, ai0p,   "out",   c0.kr1, "in" ); // ain -> sw
880
+    //cmDspSysConnectAudio(h, ai0p,   "out",   c0.kr1, "in" ); // ain -> sw
528 881
     cmDspSysConnectAudio(h, ai0p,   "out",   mi0p,  "in" );     
529 882
   }
530 883
 
@@ -532,7 +885,7 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
532 885
   {
533 886
     cmDspSysConnectAudio(h, c0.cmp, "out",   mix0,  "in-0" );   // cmp -> mix 0
534 887
     cmDspSysConnectAudio(h, rpp,    "out-0", c2.kr0,"in" );
535
-    cmDspSysConnectAudio(h, rpp,    "out-0", c2.kr1,"in" );
888
+    //cmDspSysConnectAudio(h, rpp,    "out-0", c2.kr1,"in" );
536 889
     cmDspSysConnectAudio(h, c2.cmp, "out",   mix0,  "in-1");    // rpp -> mix 1
537 890
     cmDspSysConnectAudio(h, mix0,   "out",   ao0p,  "in" );     // mix -> aout
538 891
   }
@@ -543,43 +896,50 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
543 896
   }
544 897
 
545 898
 
546
-  if( useWtFl )
547
-  {
548
-    cmDspSysConnectAudio(h, wtp,    "out",   au1Sw, "a-in-0" ); // wt  -> sw
549
-    cmDspSysConnectAudio(h, ai1p,   "out",   au1Sw, "a-in-1" ); // ain -> sw
550
-    cmDspSysConnectAudio(h, ai1p,   "out",   mi1p,  "in" );
551
-    cmDspSysConnectAudio(h, au1Sw,  "a-out", rpp,   "in-1");    // sw  -> rcdply
552
-    cmDspSysConnectAudio(h, au1Sw,  "a-out", c1.kr0,"in"  );    // sw  -> kr
553
-    cmDspSysConnectAudio(h, au1Sw,  "a-out", c1.kr1,"in"  );    // sw  -> kr
554
-  }
555
-  else
556
-  {
557
-    cmDspSysConnectAudio(h, ai1p,  "out", rpp,   "in-1");    // sw  -> rcdply
558
-    cmDspSysConnectAudio(h, ai1p,   "out",   c1.kr0, "in" ); // ain -> sw
559
-    cmDspSysConnectAudio(h, ai1p,   "out",   c1.kr1, "in" ); // ain -> sw
560
-    cmDspSysConnectAudio(h, ai1p,   "out",   mi1p,  "in" );
561
-  }
562
-
563
-  if( fragFl )
899
+  if( useChain1Fl )
564 900
   {
565
-    cmDspSysConnectAudio(h, c1.cmp, "out",   mix1,  "in-0" );   // cmp -> mix 0
566
-    cmDspSysConnectAudio(h, rpp,    "out-1", c3.kr0, "in" );
567
-    cmDspSysConnectAudio(h, rpp,    "out-1", c3.kr1, "in" );
568
-    cmDspSysConnectAudio(h, c3.cmp, "out",   mix1,   "in-1");    // rpp -> mix 1
569
-    cmDspSysConnectAudio(h, mix1,   "out",   ao1p,   "in" );     // mix -> aout
570
-  }
571
-  else
572
-  {
573
-    cmDspSysConnectAudio(h, c1.cmp, "out",   ao1p,  "in" );   // cmp -> mix 0
574
-    //cmDspSysConnectAudio(h, wtp, "out", ao1p, "in" );
575
-
901
+    if( useWtFl )
902
+    {
903
+      cmDspSysConnectAudio(h, wtp,    "out",   au1Sw, "a-in-0" ); // wt  -> sw
904
+      cmDspSysConnectAudio(h, ai1p,   "out",   au1Sw, "a-in-1" ); // ain -> sw
905
+      //cmDspSysConnectAudio(h, ci1p,   "out",   au1Sw, "a-in-1" ); 
906
+      cmDspSysConnectAudio(h, au1Sw,  "a-out", rpp,   "in-1");    // sw  -> rcdply
907
+      cmDspSysConnectAudio(h, au1Sw,  "a-out", c1.kr0,"in"  );    // sw  -> kr
908
+      //cmDspSysConnectAudio(h, au1Sw,  "a-out", c1.kr1,"in"  );    // sw  -> kr
909
+      cmDspSysConnectAudio(h, au1Sw,  "a-out",  mi1p,  "in" );    // sw  -> meter 
910
+    }
911
+    else
912
+    {
913
+      cmDspSysConnectAudio(h, ai1p,  "out", rpp,   "in-1");    // sw  -> rcdply
914
+      cmDspSysConnectAudio(h, ai1p,   "out",   c1.kr0, "in" ); // ain -> sw
915
+      //cmDspSysConnectAudio(h, ai1p,   "out",   c1.kr1, "in" ); // ain -> sw
916
+      cmDspSysConnectAudio(h, ai1p,   "out",   mi1p,  "in" );
917
+    }
918
+
919
+    if( fragFl )
920
+    {
921
+      cmDspSysConnectAudio(h, c1.cmp, "out",   mix1,  "in-0" );   // cmp -> mix 0
922
+      cmDspSysConnectAudio(h, rpp,    "out-1", c3.kr0, "in" );
923
+      //cmDspSysConnectAudio(h, rpp,    "out-1", c3.kr1, "in" );
924
+      cmDspSysConnectAudio(h, c3.cmp, "out",   mix1,   "in-1");    // rpp -> mix 1
925
+      cmDspSysConnectAudio(h, mix1,   "out",   ao1p,   "in" );     // mix -> aout
926
+    }
927
+    else
928
+    {
929
+      cmDspSysConnectAudio(h, c1.cmp, "out",   ao1p,  "in" );   // cmp -> mix 0
930
+      //cmDspSysConnectAudio(h, wtp, "out", ao1p, "in" );
931
+
932
+    }
576 933
   }
577 934
 
578 935
   cmDspSysConnectAudio(h, c0.cmp, "out", afop, "in0" );    // comp -> audio_file_out
579 936
   cmDspSysConnectAudio(h, c1.cmp, "out", afop, "in1" );
580 937
 
581
-  cmDspSysConnectAudio(h, ai0p, "out", ao2p, "in" );
582
-  cmDspSysConnectAudio(h, ai1p, "out", ao3p, "in" );
938
+  //cmDspSysConnectAudio(h, ai0p, "out", afop, "in0" );    // comp -> audio_file_out
939
+  //cmDspSysConnectAudio(h, ai1p, "out", afop, "in1" );
940
+
941
+  //cmDspSysConnectAudio(h, ai0p, "out", ao2p, "in" );     // direct through from input to 
942
+  //cmDspSysConnectAudio(h, ai1p, "out", ao3p, "in" );     //    output chs 2&3
583 943
 
584 944
 
585 945
   //--------------- Preset controls
@@ -630,7 +990,11 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
630 990
 
631 991
   // active measure loc to xfad channel trigger
632 992
   cmDspSysInstallCb( h, amp,    "scloc",  c0.achan,   "trig", NULL );  // See Also: modp.sw ->achan.trig
633
-  cmDspSysInstallCb( h, amp,    "scloc",  c1.achan,   "trig", NULL );
993
+
994
+  if( useChain1Fl )
995
+  {
996
+    cmDspSysInstallCb( h, amp,    "scloc",  c1.achan,   "trig", NULL );
997
+  }
634 998
 
635 999
   if( fragFl )
636 1000
   {
@@ -683,7 +1047,10 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
683 1047
   cmDspSysInstallCb(h, pts, "on",      rpp,   "cmd",   NULL );
684 1048
   cmDspSysInstallCb(h, onb, "sym",     amCmd, "rewind",NULL );
685 1049
   cmDspSysInstallCb(h, onb, "out",     c0.achan,"reset",  NULL );
686
-  cmDspSysInstallCb(h, onb, "out",     c1.achan,"reset",  NULL );
1050
+  if( useChain1Fl )
1051
+  {
1052
+    cmDspSysInstallCb(h, onb, "out",     c1.achan,"reset",  NULL );
1053
+  }
687 1054
 
688 1055
   // stop connections
689 1056
   cmDspSysInstallCb(h, wtp,  "done",offb,"in",  NULL ); // 'done' from WT simulates pressing Stop btn.
@@ -694,6 +1061,8 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
694 1061
   cmDspSysInstallCb(h, pts,  "off", modp,"cmd", NULL );
695 1062
   cmDspSysInstallCb(h, pts,  "off", modr,"cmd", NULL );
696 1063
   cmDspSysInstallCb(h, offb, "sym", mop, "reset", NULL );
1064
+  cmDspSysInstallCb(h, offb, "sym", mo2p, "reset", NULL );
1065
+
697 1066
 
698 1067
   // time-line to wave-table selection 
699 1068
   cmDspSysInstallCb(h, tlp, "absi", wtp, "beg", NULL );  
@@ -731,31 +1100,34 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
731 1100
   cmDspSysInstallCb(h, d1Rt, "f-out-0", sfp,  "d1",    NULL );
732 1101
   cmDspSysInstallCb(h, d1Rt, "f-out-1", nmp,  "d1",    NULL );
733 1102
   cmDspSysInstallCb(h, nmp,   "d1",     mop,  "d1",    NULL );
1103
+  cmDspSysInstallCb(h, nmp,   "d1",     mo2p,  "d1",    NULL );
734 1104
 
735 1105
   cmDspSysInstallCb(h, mfp,  "d0",      d0Rt,  "f-in", NULL );
736 1106
   cmDspSysInstallCb(h, d0Rt, "f-out-0", sfp,   "d0",   NULL );
737 1107
   cmDspSysInstallCb(h, d0Rt, "f-out-1", nmp,  "d0",   NULL );
738 1108
   cmDspSysInstallCb(h, nmp,  "d0",      mop,  "d0",   NULL );
1109
+  cmDspSysInstallCb(h, nmp,  "d0",      mo2p,  "d0",   NULL );
739 1110
 
740 1111
   cmDspSysInstallCb(h, mfp, "status",   stRt, "f-in",  NULL );
741 1112
   cmDspSysInstallCb(h, stRt, "f-out-0", sfp,  "status",NULL );
742 1113
   cmDspSysInstallCb(h, stRt, "f-out-1", nmp,  "status",NULL );
743 1114
   cmDspSysInstallCb(h, nmp,  "status",  mop,  "status",NULL );
1115
+  cmDspSysInstallCb(h, nmp,  "status",  mo2p,  "status",NULL );
744 1116
 
745 1117
   // MIDI input port
746
-  cmDspSysInstallCb(h, mip, "smpidx", sfp, "smpidx", NULL );
747
-  cmDspSysInstallCb(h, mip, "d1",     sfp, "d1",     NULL );
748
-  cmDspSysInstallCb(h, mip, "d0",     sfp, "d0",     NULL );
749
-  cmDspSysInstallCb(h, mip, "status", sfp, "status", NULL );
1118
+  //cmDspSysInstallCb(h, mip, "smpidx", sfp, "smpidx", NULL );
1119
+  //cmDspSysInstallCb(h, mip, "d1",     sfp, "d1",     NULL );
1120
+  //cmDspSysInstallCb(h, mip, "d0",     sfp, "d0",     NULL );
1121
+  //cmDspSysInstallCb(h, mip, "status", sfp, "status", NULL );
750 1122
 
751 1123
   // score follower to recd_play,modulator and printers
752
-  cmDspSysInstallCb(h, sfp, "out",     rpp,     "index", NULL );
753
-  cmDspSysInstallCb(h, sfp, "out",     modp,    "index", NULL );
754
-  cmDspSysInstallCb(h, sfp, "out",     modr,    "index", NULL );
755
-  cmDspSysInstallCb(h, sfp, "recent",  prp,     "in",  NULL );  // report 'recent' but only act on 'max' loc index
1124
+  //cmDspSysInstallCb(h, sfp, "out",     rpp,     "index", NULL );
1125
+  //cmDspSysInstallCb(h, sfp, "out",     modp,    "index", NULL );
1126
+  //cmDspSysInstallCb(h, sfp, "out",     modr,    "index", NULL );
1127
+  //cmDspSysInstallCb(h, sfp, "recent",  prp,     "in",  NULL );  // report 'recent' but only act on 'max' loc index
756 1128
 
757
-  cmDspSysInstallCb(h, prtb, "sym", sfp, "cmd", NULL );
758
-  cmDspSysInstallCb(h, qtb,  "sym", sfp, "cmd", NULL );
1129
+  //cmDspSysInstallCb(h, prtb, "sym", sfp, "cmd", NULL );
1130
+  //cmDspSysInstallCb(h, qtb,  "sym", sfp, "cmd", NULL );
759 1131
 
760 1132
 
761 1133
   cmDspSysInstallCb(   h, lasecs, "val", rpp, "curla", NULL ); // recd/play control
@@ -774,8 +1146,8 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
774 1146
 
775 1147
   cmDspSysInstallCb(h, ogain0, "val", ao0p, "gain", NULL );   // output gain control
776 1148
   cmDspSysInstallCb(h, ogain1, "val", ao1p, "gain", NULL );
777
-  cmDspSysInstallCb(h, ogain2, "val", ao2p, "gain", NULL );
778
-  cmDspSysInstallCb(h, ogain3, "val", ao3p, "gain", NULL );
1149
+  //cmDspSysInstallCb(h, ogain2, "val", ao2p, "gain", NULL );
1150
+  //cmDspSysInstallCb(h, ogain3, "val", ao3p, "gain", NULL );
779 1151
 
780 1152
   return rc;
781 1153
 }

Loading…
취소
저장