Bläddra i källkod

cmDspPgmKr.c: Changeed _cmDspSysPgm_TimeLine() to multiplex param's instead

of measurements.
master
kevin 11 år sedan
förälder
incheckning
13f8d89142
1 ändrade filer med 660 tillägg och 22 borttagningar
  1. 660
    22
      dsp/cmDspPgmKr.c

+ 660
- 22
dsp/cmDspPgmKr.c Visa fil

@@ -645,7 +645,7 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
645 645
 }
646 646
 */
647 647
 
648
-
648
+/*
649 649
 cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
650 650
 {
651 651
   cmDspRC_t       rc         = kOkDspRC;
@@ -696,7 +696,8 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
696 696
   cmDspInst_t* amp  = cmDspSysAllocInst(h,"ActiveMeas",  NULL,  1, 100 );
697 697
   cmDspInst_t* modp = cmDspSysAllocInst(h,"ScMod",       NULL,  2, r.modFn, "m1" );
698 698
 
699
-  cmDspInst_t* achan       = cmDspSysAllocInst(h, "AvailCh",     NULL, 1, xfadeChCnt );
699
+  cmDspInst_t* achan0      = cmDspSysAllocInst(h, "AvailCh",     NULL, 1, xfadeChCnt );
700
+  cmDspInst_t* achan1      = cmDspSysAllocInst(h, "AvailCh",     NULL, 1, xfadeChCnt );
700 701
   cmDspInst_t* xf_even_rt  = cmDspSysAllocInst(h, "Router",      NULL,  2,  2, 0 );
701 702
   cmDspInst_t* xf_dyn_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  2, 0 );
702 703
   cmDspInst_t* xf_tempo_rt = cmDspSysAllocInst(h, "Router",      NULL,  2,  2, 0 );
@@ -925,22 +926,22 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
925 926
   cmDspSysConnectAudio(h, php,  "out", wtp,  "phs" );   // phs -> wt
926 927
 
927 928
   cmDspSysConnectAudio(h, wtp,  "out",   kr00, "in"  );  // wt -> kr
928
-  cmDspSysConnectAudio(h, kr00, "out",   fad0,"in-0");  
929
-  cmDspSysConnectAudio(h, fad0,"out-0", mix0, "in-0");
929
+  cmDspSysConnectAudio(h, kr00, "out",   fad0, "in-0");  
930
+  cmDspSysConnectAudio(h, fad0, "out-0", mix0, "in-0");
930 931
   cmDspSysConnectAudio(h, wtp,  "out",   kr01, "in"  );  // wt -> kr
931
-  cmDspSysConnectAudio(h, kr01, "out",   fad0,"in-1");  
932
-  cmDspSysConnectAudio(h, fad0,"out-1", mix0, "in-1");
932
+  cmDspSysConnectAudio(h, kr01, "out",   fad0, "in-1");  
933
+  cmDspSysConnectAudio(h, fad0, "out-1", mix0, "in-1");
933 934
   cmDspSysConnectAudio(h, mix0, "out",   cmp0, "in");
934 935
   cmDspSysConnectAudio(h, cmp0, "out",   ao0p, "in" );    // comp -> aout
935 936
 
936
-  cmDspSysConnectAudio(h, wtp,  "out",   kr10,  "in"  );  // wt -> kr
937
+  cmDspSysConnectAudio(h, wtp,  "out",   kr10, "in"  );  // wt -> kr
937 938
   cmDspSysConnectAudio(h, kr10, "out",   fad1, "in-0");
938
-  cmDspSysConnectAudio(h, fad1,"out-0", mix1,  "in-0");
939
-  cmDspSysConnectAudio(h, wtp,  "out",   kr11,  "in"  );  // wt -> kr
939
+  cmDspSysConnectAudio(h, fad1, "out-0", mix1, "in-0");
940
+  cmDspSysConnectAudio(h, wtp,  "out",   kr11, "in"  );  // wt -> kr
940 941
   cmDspSysConnectAudio(h, kr11, "out",   fad1, "in-1");  
941
-  cmDspSysConnectAudio(h, fad1,"out-1", mix1,  "in-1");
942
-  cmDspSysConnectAudio(h, mix1, "out",   cmp1,  "in");
943
-  cmDspSysConnectAudio(h, cmp1, "out",   ao1p,  "in" );   // comp -> aout
942
+  cmDspSysConnectAudio(h, fad1, "out-1", mix1, "in-1");
943
+  cmDspSysConnectAudio(h, mix1, "out",   cmp1, "in");
944
+  cmDspSysConnectAudio(h, cmp1, "out",   ao1p, "in" );   // comp -> aout
944 945
 
945 946
   // wave-table to time-line cursor
946 947
   cmDspSysInstallCb(   h, wtp, "fidx",tlp,  "curs", NULL); 
@@ -955,6 +956,8 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
955 956
   cmDspSysInstallCb(h, pts, "on",  wtp, "cmd",   NULL );
956 957
   cmDspSysInstallCb(h, pts, "on",  modp,"cmd",   NULL );
957 958
   cmDspSysInstallCb(h, onb, "sym", amCmd, "rewind", NULL );
959
+  cmDspSysInstallCb(h, onb, "sym", achan0, "trig", NULL );
960
+  cmDspSysInstallCb(h, onb, "sym", achan1, "trig", NULL );
958 961
 
959 962
   // stop connections
960 963
   cmDspSysInstallCb(h, wtp,  "done",offb,"in",  NULL ); // 'done' from WT simulates pressing Stop btn.
@@ -1062,14 +1065,15 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
1062 1065
   //  Cross fade connections for measurments
1063 1066
   //
1064 1067
 
1065
-  // xfade router channel selection
1066
-  cmDspSysInstallCb( h, achan, "ch",  xf_even_rt,  "sel", NULL );   
1067
-  cmDspSysInstallCb( h, achan, "ch",  xf_dyn_rt,   "sel", NULL );
1068
-  cmDspSysInstallCb( h, achan, "ch",  xf_tempo_rt, "sel", NULL );
1069
-  cmDspSysInstallCb( h, achan, "ch",  xf_cost_rt,  "sel", NULL );
1068
+  // xfade router channel selection (achan0 controls the meas routers - achan1.ch is left unconnected)
1069
+  cmDspSysInstallCb( h, achan0, "ch",  xf_even_rt,  "sel", NULL );   
1070
+  cmDspSysInstallCb( h, achan0, "ch",  xf_dyn_rt,   "sel", NULL );
1071
+  cmDspSysInstallCb( h, achan0, "ch",  xf_tempo_rt, "sel", NULL );
1072
+  cmDspSysInstallCb( h, achan0, "ch",  xf_cost_rt,  "sel", NULL );
1070 1073
    
1071 1074
   // cross fade router input 
1072
-  cmDspSysInstallCb( h, amp,    "scloc",  achan,   "trig", NULL );
1075
+  cmDspSysInstallCb( h, amp,    "scloc",  achan0,   "trig", NULL );
1076
+  cmDspSysInstallCb( h, amp,    "scloc",  achan1,   "trig", NULL );
1073 1077
   cmDspSysInstallCb( h, amp,    "even",   xf_even_rt, "f-in", NULL );
1074 1078
   cmDspSysInstallCb( h, amp,    "dyn",    xf_dyn_rt,  "f-in", NULL );
1075 1079
   cmDspSysInstallCb( h, amp,    "tempo",  xf_tempo_rt,"f-in", NULL );
@@ -1086,10 +1090,15 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
1086 1090
   cmDspSysInstallCb(h, xf_cost_rt,   "f-out-1",   cost_sr_01, "val_in", NULL );
1087 1091
 
1088 1092
   // active-channel to cross-fade connections
1089
-  cmDspSysInstallCb(h, achan, "gate-0",  fad0, "gate-0", NULL );
1090
-  cmDspSysInstallCb(h, fad0, "state-0", achan, "dis-0",  NULL );
1091
-  cmDspSysInstallCb(h, achan, "gate-1",  fad1, "gate-1", NULL );
1092
-  cmDspSysInstallCb(h, fad1, "state-1", achan, "dis-1",  NULL );
1093
+  cmDspSysInstallCb(h, achan0, "gate-0",  fad0, "gate-0", NULL );
1094
+  cmDspSysInstallCb(h, achan0, "gate-1",  fad0, "gate-1", NULL );
1095
+  cmDspSysInstallCb(h, fad0, "state-0", achan0, "dis-0",  NULL );
1096
+  cmDspSysInstallCb(h, fad0, "state-1", achan0, "dis-1",  NULL );
1097
+
1098
+  cmDspSysInstallCb(h, achan1, "gate-0",  fad1, "gate-0", NULL );
1099
+  cmDspSysInstallCb(h, achan1, "gate-1",  fad1, "gate-1", NULL );
1100
+  cmDspSysInstallCb(h, fad1, "state-0", achan1, "dis-0",  NULL );
1101
+  cmDspSysInstallCb(h, fad1, "state-1", achan1, "dis-1",  NULL );
1093 1102
 
1094 1103
 
1095 1104
   // =========================================================================
@@ -1377,6 +1386,635 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
1377 1386
 
1378 1387
   return rc;
1379 1388
 }
1389
+*/
1390
+
1391
+cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
1392
+{
1393
+  cmDspRC_t       rc         = kOkDspRC;
1394
+  cmCtx_t*        cmCtx      = cmDspSysPgmCtx(h);
1395
+  cmErr_t         err;
1396
+  krRsrc_t        r;
1397
+  unsigned        wtLoopCnt  = 1;                            // 1=play once (-1=loop forever)
1398
+  unsigned        wtInitMode = 0;                            // initial wt mode is 'silence'
1399
+  unsigned        wtSmpCnt   = floor(cmDspSysSampleRate(h)); // wt length == srate
1400
+  int             krWndSmpCnt = 2048;
1401
+  int             krHopFact   = 4;
1402
+
1403
+  unsigned        xfadeChCnt  = 2;
1404
+  double          xfadeMs     = 50;
1405
+  bool            xfadeInitFl = true;
1406
+  double          mixGain     = 1.0;
1407
+
1408
+  unsigned        measRtChCnt = 4; // note: router channel 4 is not connected
1409
+
1410
+  bool            cmpBypassFl  = false;
1411
+  double          cmpInGain    = 3.0;
1412
+  double          cmpThreshDb  = -40.0;
1413
+  double          cmpRatio_num = 5.0;
1414
+  double          cmpAtkMs     = 20.0;
1415
+  double          cmpRlsMs     = 100.0;
1416
+  double          cmpMakeup    = 1.0;
1417
+  double          cmpWndMaxMs  = 1000.0;
1418
+  double          cmpWndMs     = 200.0;
1419
+
1420
+
1421
+
1422
+  memset(&r,0,sizeof(r));
1423
+  cmErrSetup(&err,&cmCtx->rpt,"Kr Timeline");
1424
+
1425
+  if( krLoadRsrc(h,&err,&r) != kOkDspRC )
1426
+    return rc;
1427
+
1428
+  unsigned   preGrpSymId     = cmDspSysPresetRegisterGroup(h,"tl");
1429
+  unsigned   compPreGrpSymId = cmDspSysPresetRegisterGroup(h,"tl_cmp"); 
1430
+
1431
+  cmDspInst_t* tlp  = cmDspSysAllocInst(h,"TimeLine",    "tl",  2, r.tlFn, r.tlPrefixPath );
1432
+  cmDspInst_t* scp  = cmDspSysAllocInst(h,"Score",       "sc",  1, r.scFn );
1433
+  cmDspInst_t* php  = cmDspSysAllocInst(h,"Phasor",      NULL,  1, cmDspSysSampleRate(h) );
1434
+  cmDspInst_t* wtp  = cmDspSysAllocInst(h,"WaveTable",   NULL,  4, wtSmpCnt, wtInitMode, NULL, wtLoopCnt );
1435
+  cmDspInst_t* pts  = cmDspSysAllocInst(h,"PortToSym",   NULL,  2, "on", "off" );
1436
+  cmDspInst_t* mfp  = cmDspSysAllocInst(h,"MidiFilePlay",NULL,  0 );
1437
+  cmDspInst_t* sfp  = cmDspSysAllocInst(h,"ScFol",       NULL,  1, r.scFn );
1438
+  cmDspInst_t* amp  = cmDspSysAllocInst(h,"ActiveMeas",  NULL,  1, 100 );
1439
+  cmDspInst_t* modp = cmDspSysAllocInst(h,"ScMod",       NULL,  2, r.modFn, "m1" );
1440
+
1441
+  cmDspInst_t* achan0      = cmDspSysAllocInst(h, "AvailCh",     NULL, 1, xfadeChCnt );
1442
+  cmDspInst_t* achan1      = cmDspSysAllocInst(h, "AvailCh",     NULL, 1, xfadeChCnt );
1443
+
1444
+
1445
+  cmDspInst_t* even_sr_00  = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4,  0.8,   1.1, 0.0, 1.0 );
1446
+  cmDspInst_t* even_rt_00  = cmDspSysAllocInst(h, "Router",      NULL,  2,  measRtChCnt, measRtChCnt-1 );
1447
+  cmDspInst_t* dyn_sr_00   = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4,  0.0,   4.0, 0.01, 1.0 );
1448
+  cmDspInst_t* dyn_rt_00   = cmDspSysAllocInst(h, "Router",      NULL,  2,  measRtChCnt, measRtChCnt-1 );
1449
+  cmDspInst_t* tempo_sr_00 = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4, 80.0, 120.0, 0.01, 1.0 );
1450
+  cmDspInst_t* tempo_rt_00 = cmDspSysAllocInst(h, "Router",      NULL,  2,  measRtChCnt, measRtChCnt-1 );
1451
+  cmDspInst_t* cost_sr_00  = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4,  0.0,    1.0, 0.001, 1.0 );
1452
+  cmDspInst_t* cost_rt_00  = cmDspSysAllocInst(h, "Router",      NULL,  2,  measRtChCnt, measRtChCnt-1 );
1453
+  cmDspInst_t* thrh_sr_00  = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4,  0.0, 1.0, 0.01, 100.0 );
1454
+  cmDspInst_t* upr_sr_00   = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4,  0.0, 1.0, -1.0, 5.0 );
1455
+  cmDspInst_t* lwr_sr_00   = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4,  0.0, 1.0, -5.0, 5.0 );
1456
+
1457
+
1458
+  cmDspInst_t* even_sr_10  = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4,  0.8,   1.1, 0.0, 1.0 );
1459
+  cmDspInst_t* even_rt_10  = cmDspSysAllocInst(h, "Router",      NULL,  2,  measRtChCnt, measRtChCnt-1 );
1460
+  cmDspInst_t* dyn_sr_10   = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4,  0.0,   4.0, 0.01, 1.0 );
1461
+  cmDspInst_t* dyn_rt_10   = cmDspSysAllocInst(h, "Router",      NULL,  2,  measRtChCnt, measRtChCnt-1 );
1462
+  cmDspInst_t* tempo_sr_10 = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4, 80.0, 120.0, 0.01, 1.0 );
1463
+  cmDspInst_t* tempo_rt_10 = cmDspSysAllocInst(h, "Router",      NULL,  2,  measRtChCnt, measRtChCnt-1 );
1464
+  cmDspInst_t* cost_sr_10  = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4,  0.0,    1.0, 0.001, 1.0 );
1465
+  cmDspInst_t* cost_rt_10  = cmDspSysAllocInst(h, "Router",      NULL,  2,  measRtChCnt, measRtChCnt-1 );
1466
+  cmDspInst_t* thrh_sr_10  = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4,  0.0, 1.0, 0.01, 100.0 );
1467
+  cmDspInst_t* upr_sr_10   = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4,  0.0, 1.0, -1.0, 5.0 );
1468
+  cmDspInst_t* lwr_sr_10   = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4,  0.0, 1.0, -5.0, 5.0 );
1469
+
1470
+
1471
+  unsigned paramRtChCnt = 2;
1472
+  cmDspInst_t* mod_rt_00   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
1473
+  cmDspInst_t* thr_rt_00   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
1474
+  cmDspInst_t* upr_rt_00   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
1475
+  cmDspInst_t* lwr_rt_00   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
1476
+
1477
+  cmDspInst_t* mod_rt_10   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
1478
+  cmDspInst_t* thr_rt_10   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
1479
+  cmDspInst_t* upr_rt_10   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
1480
+  cmDspInst_t* lwr_rt_10   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
1481
+
1482
+
1483
+
1484
+  cmDspInst_t* kr00 = cmDspSysAllocInst(h, "Kr",         NULL,   2, krWndSmpCnt, krHopFact );
1485
+  cmDspInst_t* kr01 = cmDspSysAllocInst(h, "Kr",         NULL,   2, krWndSmpCnt, krHopFact );
1486
+  cmDspInst_t* fad0 = cmDspSysAllocInst(h, "Xfader",     NULL,   3, xfadeChCnt,  xfadeMs, xfadeInitFl ); 
1487
+  cmDspInst_t* mix0 = cmDspSysAllocInst(h, "AMix",       NULL,   3, xfadeChCnt, mixGain, mixGain );
1488
+  cmDspInst_t* cmp0 =  cmDspSysAllocInst(h,"Compressor", NULL,   8, cmpBypassFl, cmpThreshDb, cmpRatio_num, cmpAtkMs, cmpRlsMs, cmpMakeup, cmpWndMs, cmpWndMaxMs ); 
1489
+  cmDspInst_t* ao0p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 0 );
1490
+  
1491
+  cmDspInst_t* kr10 = cmDspSysAllocInst(h, "Kr",         NULL,   2, krWndSmpCnt, krHopFact );
1492
+  cmDspInst_t* kr11 = cmDspSysAllocInst(h, "Kr",         NULL,   2, krWndSmpCnt, krHopFact );
1493
+  cmDspInst_t* fad1 = cmDspSysAllocInst(h, "Xfader",     NULL,   3, xfadeChCnt,  xfadeMs, xfadeInitFl ); 
1494
+  cmDspInst_t* mix1 = cmDspSysAllocInst(h, "AMix",       NULL,   3, xfadeChCnt, mixGain, mixGain );
1495
+  cmDspInst_t* cmp1 =  cmDspSysAllocInst(h,"Compressor", NULL,   8, cmpBypassFl, cmpThreshDb, cmpRatio_num, cmpAtkMs, cmpRlsMs, cmpMakeup, cmpWndMs, cmpWndMaxMs ); 
1496
+  cmDspInst_t* ao1p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 1 );
1497
+
1498
+  //cmDspInst_t* af0p = cmDspSysAllocInst(h,"AudioFileOut",NULL,  2, "/home/kevin/temp/debug0.wav",1);
1499
+
1500
+  cmDspSysNewPage(h,"Controls");
1501
+  cmDspInst_t* onb  = cmDspSysAllocInst(h,"Button", "start",  2, kButtonDuiId, 1.0 );
1502
+  cmDspInst_t* offb = cmDspSysAllocInst(h,"Button", "stop",   2, kButtonDuiId, 1.0 );
1503
+  cmDspInst_t* prtb = cmDspSysAllocInst(h,"Button", "print",  2, kButtonDuiId, 1.0 );
1504
+  cmDspInst_t* qtb  = cmDspSysAllocInst(h,"Button", "quiet",  2, kButtonDuiId, 1.0 );
1505
+  cmDspInst_t* prp  = cmDspSysAllocInst(h,"Printer", NULL,   1, ">" );
1506
+  cmDspInst_t* prd  = cmDspSysAllocInst(h,"Printer", NULL,   1, "DYN:" );
1507
+  cmDspInst_t* pre  = cmDspSysAllocInst(h,"Printer", NULL,   1, "EVEN:" );
1508
+  cmDspInst_t* prt  = cmDspSysAllocInst(h,"Printer", NULL,   1, "TEMPO:");
1509
+  cmDspInst_t* prc  = cmDspSysAllocInst(h,"Printer", NULL,   1, "COST:");
1510
+  //cmDspInst_t* prv  = cmDspSysAllocInst(h,"Printer", NULL,   1, "Value:");
1511
+
1512
+  //--------------- Preset controls
1513
+  cmDspInst_t* preset    = cmDspSysAllocInst(   h, "Preset", NULL, 1, preGrpSymId );
1514
+  cmDspInst_t* presetLbl = cmDspSysAllocInst(   h, "Text",   "Preset",      1, "" );
1515
+  cmDspInst_t* storeBtn  = cmDspSysAllocButton( h, "store",  0);
1516
+  cmDspInst_t* recallBtn = cmDspSysAllocButton( h, "recall", 0);
1517
+  cmDspSysInstallCb(   h, presetLbl, "val", preset, "label",NULL);
1518
+  cmDspSysInstallCb(   h, storeBtn,  "sym", preset, "cmd", NULL );
1519
+  cmDspSysInstallCb(   h, recallBtn, "sym", preset, "cmd", NULL );
1520
+
1521
+  cmDspInst_t* prePath    = cmDspSysAllocInst(   h, "Fname",  "prePath",   3, true,NULL,r.tlPrefixPath);
1522
+  
1523
+
1524
+  //--------------- Recorded evaluation and Active Measurement related controls
1525
+  cmDspInst_t* clrBtn  = cmDspSysAllocButton( h, "clear",  0);
1526
+  cmDspInst_t* prtBtn  = cmDspSysAllocButton( h, "dump",  0);
1527
+  cmDspInst_t* mlst    = cmDspSysAllocInst(   h, "MsgList",   NULL, 3, "meas", r.measFn, 2);
1528
+  cmDspInst_t* amCmd   = cmDspSysAllocInst(   h, "PortToSym", NULL, 2, "add", "rewind" );  
1529
+
1530
+  cmDspSysInstallCb( h, clrBtn, "sym",    amp, "cmd",  NULL );
1531
+  cmDspSysInstallCb( h, prtBtn, "sym",    amp, "cmd",  NULL );
1532
+  cmDspSysInstallCb( h, amCmd, "add",     amp, "cmd",  NULL );
1533
+  cmDspSysInstallCb( h, amCmd, "rewind",  amp, "cmd",  NULL );
1534
+  cmDspSysInstallCb( h, mlst,   "loc",    amp, "loc", NULL );
1535
+  cmDspSysInstallCb( h, mlst,   "typeId", amp, "type",NULL );
1536
+  cmDspSysInstallCb( h, mlst,   "val",    amp, "val", NULL );
1537
+  cmDspSysInstallCb( h, mlst,   "cost",   amp, "cst", NULL );
1538
+  cmDspSysInstallCb( h, mlst,   "typeId", amCmd, "add", NULL );
1539
+  cmDspSysInstallCb( h, sfp,    "out",    amp, "sfloc", NULL );
1540
+  cmDspSysInstallCb( h, amp,    "even",   pre, "in", NULL );
1541
+  cmDspSysInstallCb( h, amp,    "dyn",    prd, "in", NULL );
1542
+  cmDspSysInstallCb( h, amp,    "tempo",  prt, "in", NULL );
1543
+  cmDspSysInstallCb( h, amp,    "cost",   prc, "in", NULL );
1544
+
1545
+  cmDspSysNewColumn(h,0);
1546
+
1547
+  double dfltOffset = 2.0; // 30.0;
1548
+
1549
+  // ------   Spectral distortion controls 0
1550
+  cmDspInst_t* md00p = cmDspSysAllocScalarP( h,preGrpSymId,NULL, "Mode-00",      0.0, 4.0, 1.0, 1.0);
1551
+  cmDspInst_t* ws00p = cmDspSysAllocMsgListP(h,preGrpSymId,NULL, "wndSmpCnt-00", NULL, "wndSmpCnt", 2);
1552
+  cmDspInst_t* hf00p = cmDspSysAllocMsgListP(h,preGrpSymId,NULL, "hopFact-00",   NULL, "hopFact",   2);
1553
+  cmDspInst_t* th00p = cmDspSysAllocScalarP( h,preGrpSymId,NULL, "threshold-00", 0.0, 100.0, 1.0,  60.0 );
1554
+  cmDspInst_t* us00p = cmDspSysAllocScalarP( h,preGrpSymId,NULL, "upr slope-00", 0.0,  10.0, 0.01,  0.0 ); 
1555
+  cmDspInst_t* ls00p = cmDspSysAllocScalarP( h,preGrpSymId,NULL, "lwr slope-00", 0.3,  10.0, 0.01,  2.0 );
1556
+  cmDspInst_t* of00p = cmDspSysAllocScalarP( h,preGrpSymId,NULL, "offset-00",    0.0, 100.0, 0.01, dfltOffset );
1557
+  cmDspInst_t* iv00p = cmDspSysAllocScalarP( h,preGrpSymId,NULL, "invert-00",    0.0,   1.0, 1.0,   0.0 );  
1558
+  cmDspInst_t* wet00p  = cmDspSysAllocScalarP(h,preGrpSymId,NULL, "wet-00",       0.0,   1.0,0.001,  1.0 );  
1559
+
1560
+
1561
+  cmDspSysNewColumn(h,0);
1562
+
1563
+
1564
+  // ------   Spectral distortion controls 1
1565
+  cmDspInst_t* md10p  = cmDspSysAllocScalarP( h,preGrpSymId,NULL, "Mode-10",      0.0, 4.0, 1.0, 1.0);
1566
+  cmDspInst_t* ws10p  = cmDspSysAllocMsgListP(h,preGrpSymId,NULL, "wndSmpCnt-10", NULL, "wndSmpCnt", 2);
1567
+  cmDspInst_t* hf10p  = cmDspSysAllocMsgListP(h,preGrpSymId,NULL, "hopFact-10",   NULL, "hopFact",   2);
1568
+  cmDspInst_t* th10p  = cmDspSysAllocScalarP( h,preGrpSymId,NULL, "threshold-10", 0.0, 100.0, 1.0,  60.0 );
1569
+  cmDspInst_t* us10p  = cmDspSysAllocScalarP( h,preGrpSymId,NULL, "upr slope-10", 0.0,  10.0, 0.01,  0.0 ); 
1570
+  cmDspInst_t* ls10p  = cmDspSysAllocScalarP( h,preGrpSymId,NULL, "lwr slope-10", 0.3,  10.0, 0.01,  2.0 );
1571
+  cmDspInst_t* of10p  = cmDspSysAllocScalarP( h,preGrpSymId,NULL, "offset-10",    0.0, 100.0, 0.01, dfltOffset );
1572
+  cmDspInst_t* iv10p  = cmDspSysAllocScalarP( h,preGrpSymId,NULL, "invert-10",    0.0,   1.0, 1.0,   0.0 );  
1573
+  cmDspInst_t* wet10p  = cmDspSysAllocScalarP( h,preGrpSymId,NULL, "wet-10",       0.0,    1.0,0.001,  1.0 );  
1574
+
1575
+  cmDspSysNewColumn(h,0);
1576
+
1577
+  cmDspInst_t* ogain0 = cmDspSysAllocInst(h,"Scalar", "Out Gain-0",   5, kNumberDuiId, 0.0,   10.0,0.01,   3.0 );  
1578
+  cmDspInst_t* ogain1 = cmDspSysAllocInst(h,"Scalar", "Out Gain-1",   5, kNumberDuiId, 0.0,   10.0,0.01,   3.0 );  
1579
+
1580
+  //cmDspInst_t* reload = cmDspSysAllocInst(h,"Button", "Reload",     2, kButtonDuiId, 0.0 );
1581
+
1582
+  cmDspSysNewPage(h,"Sc/Rgn");
1583
+
1584
+  // -------- Measurement Scale/Ranges controls 0
1585
+  cmDspInst_t* min_dyn_0   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, "Min In Dyn 0",      0.0, 10.0, 1.0, 0.0);
1586
+  cmDspInst_t* max_dyn_0   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, "Max In Dyn 0",      0.0, 10.0, 1.0, 4.0);
1587
+  cmDspInst_t* menu_dyn_0  = cmDspSysAllocMsgListP(h,preGrpSymId, NULL, "DynSel 0", NULL, "measMenu", measRtChCnt-1);
1588
+
1589
+  cmDspInst_t* min_even_0   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, "Min In Even 0",    0.0, 1.0, 0.001, 0.75);
1590
+  cmDspInst_t* max_even_0   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, "Max In Even 0",    0.0, 3.0, 0.001, 1.0);
1591
+  cmDspInst_t* menu_even_0  = cmDspSysAllocMsgListP(h,preGrpSymId, NULL, "EvenSel 0", NULL, "measMenu", measRtChCnt-1);
1592
+
1593
+  cmDspSysNewColumn(h,0);
1594
+  cmDspInst_t* min_tempo_0   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, "Min In Tempo 0",   0.0, 200.0, 1.0, 80.0);
1595
+  cmDspInst_t* max_tempo_0   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, "Max In Tempo 0",   0.0, 200.0, 1.0, 120.0);
1596
+  cmDspInst_t* menu_tempo_0  = cmDspSysAllocMsgListP(h,preGrpSymId, NULL, "TempoSel 0", NULL, "measMenu", measRtChCnt-1);
1597
+
1598
+  cmDspInst_t* min_cost_0   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, "Min In Cost 0",      0.0, 1.0, 0.01, 0.0);
1599
+  cmDspInst_t* max_cost_0   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, "Max In Cost 0",      0.0, 1.0, 0.01, 1.0);
1600
+  cmDspInst_t* menu_cost_0  = cmDspSysAllocMsgListP(h,preGrpSymId, NULL, "CostSel 0", NULL, "measMenu", measRtChCnt-1);
1601
+
1602
+  // -------- Parameter Scale/Ranges controls 0
1603
+  cmDspSysNewColumn(h,0);
1604
+  cmDspInst_t* min_thrh_0   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, "Min Thresh 0",      0.0, 100.0, 1.0, 30.0);
1605
+  cmDspInst_t* max_thrh_0   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, "Max Thresh 0",      0.0, 100.0, 1.0, 80.0);
1606
+
1607
+  cmDspInst_t* min_upr_0   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, "Min Upr 0",          -1.0, 1.0, 0.001, -0.5);
1608
+  cmDspInst_t* max_upr_0   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, "Max Upr 0",          -1.0, 1.0, 0.001, 0.5);
1609
+
1610
+  cmDspInst_t* min_lwr_0   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, "Min Lwr 0",          0.0, -1.0, 5.0, 1.0);
1611
+  cmDspInst_t* max_lwr_0   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, "Max Lwr 0",          0.0, -1.0, 5.0, 3.0);
1612
+
1613
+
1614
+  // -------- Measurement Scale/Ranges controls 0
1615
+  cmDspSysNewColumn(h,0);
1616
+  cmDspInst_t* min_dyn_1   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, "Min In Dyn 1",      0.0, 10.0, 1.0, 0.0);
1617
+  cmDspInst_t* max_dyn_1   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, "Max In Dyn 1",      0.0, 10.0, 1.0, 4.0);
1618
+  cmDspInst_t* menu_dyn_1  = cmDspSysAllocMsgListP(h,preGrpSymId, NULL, "DynSel 1", NULL, "measMenu", measRtChCnt-1);
1619
+
1620
+  cmDspInst_t* min_even_1   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, "Min In Even 1",    0.0, 1.0, 0.001, 0.75);
1621
+  cmDspInst_t* max_even_1   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, "Max In Even 1",    0.0, 3.0, 0.001, 1.0);
1622
+  cmDspInst_t* menu_even_1  = cmDspSysAllocMsgListP(h,preGrpSymId, NULL, "EvenSel 1", NULL, "measMenu", measRtChCnt-1);
1623
+
1624
+  cmDspSysNewColumn(h,0);
1625
+  cmDspInst_t* min_tempo_1   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, "Min In Tempo 1",   0.0, 200.0, 1.0, 80.0);
1626
+  cmDspInst_t* max_tempo_1   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, "Max In Tempo 1",   0.0, 200.0, 1.0, 120.0);
1627
+  cmDspInst_t* menu_tempo_1  = cmDspSysAllocMsgListP(h,preGrpSymId, NULL, "TempoSel 1", NULL, "measMenu", measRtChCnt-1);
1628
+
1629
+  cmDspInst_t* min_cost_1   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, "Min In Cost 1",      0.0, 1.0, 0.01, 0.0);
1630
+  cmDspInst_t* max_cost_1   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, "Max In Cost 1",      0.0, 1.0, 0.01, 1.0);
1631
+  cmDspInst_t* menu_cost_1  = cmDspSysAllocMsgListP(h,preGrpSymId, NULL, "CostSel 1", NULL, "measMenu", measRtChCnt-1);
1632
+
1633
+  // -------- Parameter Scale/Ranges controls 0
1634
+  cmDspSysNewColumn(h,0);
1635
+  cmDspInst_t* min_thrh_1   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, "Min Thresh 1",      0.0, 100.0, 1.0, 30.0);
1636
+  cmDspInst_t* max_thrh_1   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, "Max Thresh 1",      0.0, 100.0, 1.0, 80.0);
1637
+
1638
+  cmDspInst_t* min_upr_1   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, "Min Upr 1",          -1.0, 1.0, 0.001, -0.5);
1639
+  cmDspInst_t* max_upr_1   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, "Max Upr 1",          -1.0, 1.0, 0.001, 0.5);
1640
+
1641
+  cmDspInst_t* min_lwr_1   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, "Min Lwr 1",          0.0, -1.0, 5.0, 1.0);
1642
+  cmDspInst_t* max_lwr_1   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, "Max Lwr 1",          0.0, -1.0, 5.0, 3.0);
1643
+
1644
+
1645
+  if((rc = cmDspSysLastRC(h)) != kOkDspRC )
1646
+    return rc;
1647
+
1648
+  // phasor->wt->aout
1649
+  cmDspSysConnectAudio(h, php,  "out", wtp,  "phs" );   // phs -> wt
1650
+
1651
+  cmDspSysConnectAudio(h, wtp,  "out",   kr00, "in"  );  // wt -> kr
1652
+  cmDspSysConnectAudio(h, kr00, "out",   fad0, "in-0");  
1653
+  cmDspSysConnectAudio(h, fad0, "out-0", mix0, "in-0");
1654
+  cmDspSysConnectAudio(h, wtp,  "out",   kr01, "in"  );  // wt -> kr
1655
+  cmDspSysConnectAudio(h, kr01, "out",   fad0, "in-1");  
1656
+  cmDspSysConnectAudio(h, fad0, "out-1", mix0, "in-1");
1657
+  cmDspSysConnectAudio(h, mix0, "out",   cmp0, "in");
1658
+  cmDspSysConnectAudio(h, cmp0, "out",   ao0p, "in" );    // comp -> aout
1659
+
1660
+  cmDspSysConnectAudio(h, wtp,  "out",   kr10, "in"  );  // wt -> kr
1661
+  cmDspSysConnectAudio(h, kr10, "out",   fad1, "in-0");
1662
+  cmDspSysConnectAudio(h, fad1, "out-0", mix1, "in-0");
1663
+  cmDspSysConnectAudio(h, wtp,  "out",   kr11, "in"  );  // wt -> kr
1664
+  cmDspSysConnectAudio(h, kr11, "out",   fad1, "in-1");  
1665
+  cmDspSysConnectAudio(h, fad1, "out-1", mix1, "in-1");
1666
+  cmDspSysConnectAudio(h, mix1, "out",   cmp1, "in");
1667
+  cmDspSysConnectAudio(h, cmp1, "out",   ao1p, "in" );   // comp -> aout
1668
+
1669
+  // wave-table to time-line cursor
1670
+  cmDspSysInstallCb(   h, wtp, "fidx",tlp,  "curs", NULL); 
1671
+
1672
+  cmDspSysInstallCb(h, prePath, "out", tlp, "path", NULL );
1673
+
1674
+  // start connections
1675
+  cmDspSysInstallCb(h, onb, "sym", tlp, "reset", NULL );
1676
+  cmDspSysInstallCb(h, onb, "sym", scp, "send",  NULL );
1677
+  cmDspSysInstallCb(h, onb, "sym", mfp, "sel",   NULL );
1678
+  cmDspSysInstallCb(h, onb, "sym", pts, "on",    NULL );
1679
+  cmDspSysInstallCb(h, pts, "on",  wtp, "cmd",   NULL );
1680
+  cmDspSysInstallCb(h, pts, "on",  modp,"cmd",   NULL );
1681
+  cmDspSysInstallCb(h, onb, "sym", amCmd, "rewind", NULL );
1682
+  cmDspSysInstallCb(h, onb, "sym", achan0, "trig", NULL );
1683
+  cmDspSysInstallCb(h, onb, "sym", achan1, "trig", NULL );
1684
+
1685
+  // stop connections
1686
+  cmDspSysInstallCb(h, wtp,  "done",offb,"in",  NULL ); // 'done' from WT simulates pressing Stop btn.
1687
+  cmDspSysInstallCb(h, tlp,  "mfn", pts, "off", NULL ); // Prevents WT start on new audio file from TL.
1688
+  cmDspSysInstallCb(h, offb, "sym", mfp, "sel", NULL ); 
1689
+  cmDspSysInstallCb(h, offb, "sym", pts, "off", NULL );
1690
+  cmDspSysInstallCb(h, pts,  "off", wtp, "cmd", NULL );
1691
+  cmDspSysInstallCb(h, pts,  "off", modp,"cmd", NULL );
1692
+
1693
+  // time-line to wave-table selection 
1694
+  cmDspSysInstallCb(h, tlp, "absi", wtp, "beg", NULL );  
1695
+  cmDspSysInstallCb(h, tlp, "aesi", wtp, "end", NULL );
1696
+  cmDspSysInstallCb(h, tlp, "afn",  wtp, "fn",  NULL );
1697
+
1698
+  // time-line to MIDI file player selection
1699
+  cmDspSysInstallCb(h, tlp, "mbsi", mfp, "bsi",   NULL );
1700
+  cmDspSysInstallCb(h, tlp, "mesi", mfp, "esi",   NULL );
1701
+  cmDspSysInstallCb(h, tlp, "mfn",  mfp, "fn",    NULL );
1702
+  
1703
+  cmDspSysInstallCb(h, scp, "sel",    sfp, "index",  NULL ); // score to score follower - to set initial search location
1704
+  cmDspSysInstallCb(h, scp, "sel",    modp,"reset", NULL );
1705
+  
1706
+  //cmDspSysInstallCb(h, reload,"out",  modp, "reload", NULL );
1707
+
1708
+
1709
+  // MIDI file player to score follower
1710
+  cmDspSysInstallCb(h, mfp, "smpidx", sfp, "smpidx", NULL );
1711
+  cmDspSysInstallCb(h, mfp, "d1",     sfp, "d1",     NULL );
1712
+  cmDspSysInstallCb(h, mfp, "d0",     sfp, "d0",     NULL );
1713
+  cmDspSysInstallCb(h, mfp, "status", sfp, "status", NULL );
1714
+
1715
+  // score follower to modulator and printers
1716
+  cmDspSysInstallCb(h, sfp, "out",  modp,    "index", NULL );
1717
+  cmDspSysInstallCb(h, sfp, "out",  prp,     "in",  NULL );
1718
+
1719
+  cmDspSysInstallCb(h, prtb, "sym", sfp, "cmd", NULL );
1720
+  cmDspSysInstallCb(h, qtb,  "sym", sfp, "cmd", NULL );
1721
+
1722
+
1723
+  cmDspSysInstallCb(h, ws00p,     "out",   kr00, "wndn", NULL );   // wndSmpCnt->kr
1724
+  cmDspSysInstallCb(h, hf00p,     "out",   kr00, "hopf", NULL );   // hopFact->kr
1725
+  cmDspSysInstallCb(h, of00p,     "val",   kr00, "offs", NULL );   // offset->kr
1726
+  cmDspSysInstallCb(h, iv00p,     "val",   kr00, "invt", NULL );   // invert->kr
1727
+  cmDspSysInstallCb(h, wet00p,    "val",   kr00, "wet", NULL );    //  wet->kr
1728
+
1729
+  cmDspSysInstallCb(h, ws00p,     "out",   kr01, "wndn", NULL );   // wndSmpCnt->kr
1730
+  cmDspSysInstallCb(h, hf00p,     "out",   kr01, "hopf", NULL );   // hopFact->kr
1731
+  cmDspSysInstallCb(h, of00p,     "val",   kr01, "offs", NULL );   // offset->kr
1732
+  cmDspSysInstallCb(h, iv00p,     "val",   kr01, "invt", NULL );   // invert->kr
1733
+  cmDspSysInstallCb(h, wet00p,    "val",   kr01, "wet", NULL );    //  wet->kr
1734
+
1735
+  cmDspSysInstallCb(h, ws10p,     "out",   kr10, "wndn", NULL );   // wndSmpCnt->kr
1736
+  cmDspSysInstallCb(h, hf10p,     "out",   kr10, "hopf", NULL );   // hopFact->kr
1737
+  cmDspSysInstallCb(h, of10p,     "val",   kr10, "offs", NULL );   // offset->kr
1738
+  cmDspSysInstallCb(h, iv10p,     "val",   kr10, "invt", NULL );   // invert->kr
1739
+  cmDspSysInstallCb(h, wet10p,    "val",   kr10, "wet", NULL );    //  wet->kr
1740
+
1741
+  cmDspSysInstallCb(h, ws10p,     "out",   kr11, "wndn", NULL );   // wndSmpCnt->kr
1742
+  cmDspSysInstallCb(h, hf10p,     "out",   kr11, "hopf", NULL );   // hopFact->kr
1743
+  cmDspSysInstallCb(h, of10p,     "val",   kr11, "offs", NULL );   // offset->kr
1744
+  cmDspSysInstallCb(h, iv10p,     "val",   kr11, "invt", NULL );   // invert->kr
1745
+  cmDspSysInstallCb(h, wet10p,    "val",   kr11, "wet", NULL );    //  wet->kr
1746
+
1747
+  cmDspSysInstallCb(h, ogain0, "val", ao0p, "gain", NULL );   // output gain control
1748
+  cmDspSysInstallCb(h, ogain1, "val", ao1p, "gain", NULL );
1749
+
1750
+  // Printer connections
1751
+  cmDspSysInstallCb(h, tlp, "afn",  prp, "in",  NULL );
1752
+  cmDspSysInstallCb(h, tlp, "mfn",  prp, "in",  NULL );
1753
+  cmDspSysInstallCb(h, tlp, "sel",  prp, "in",  NULL );
1754
+
1755
+  cmDspSysInstallCb(h, modp, "thr0",  th00p, "val", NULL );
1756
+  cmDspSysInstallCb(h, modp, "mint0", min_thrh_0, "val", NULL );
1757
+  cmDspSysInstallCb(h, modp, "maxt0", max_thrh_0, "val", NULL );
1758
+  cmDspSysInstallCb(h, modp, "minu0", min_upr_0, "val", NULL );
1759
+  cmDspSysInstallCb(h, modp, "maxu0", max_upr_0, "val", NULL );
1760
+  cmDspSysInstallCb(h, modp, "minl0", min_lwr_0, "val", NULL );
1761
+  cmDspSysInstallCb(h, modp, "maxl0", max_lwr_0, "val", NULL );
1762
+
1763
+  cmDspSysInstallCb(h, modp, "thr1",  th10p, "val", NULL );
1764
+  cmDspSysInstallCb(h, modp, "mint1", min_thrh_1, "val", NULL );
1765
+  cmDspSysInstallCb(h, modp, "maxt1", max_thrh_1, "val", NULL );
1766
+  cmDspSysInstallCb(h, modp, "minu1", min_upr_1, "val", NULL );
1767
+  cmDspSysInstallCb(h, modp, "maxu1", max_upr_1, "val", NULL );
1768
+  cmDspSysInstallCb(h, modp, "minl1", min_lwr_1, "val", NULL );
1769
+  cmDspSysInstallCb(h, modp, "maxl1", max_lwr_1, "val", NULL );
1770
+
1771
+  // =========================================================================
1772
+  //  Cross fade connections for measurments
1773
+  //
1774
+
1775
+  // active measure loc to xfad channel trigger
1776
+  cmDspSysInstallCb( h, amp,    "scloc",  achan0,   "trig", NULL );
1777
+  cmDspSysInstallCb( h, amp,    "scloc",  achan1,   "trig", NULL );
1778
+
1779
+  // xfade router channel selection 
1780
+  cmDspSysInstallCb( h, achan0, "ch",  mod_rt_00, "sel", NULL );   
1781
+  cmDspSysInstallCb( h, achan0, "ch",  thr_rt_00, "sel", NULL );
1782
+  cmDspSysInstallCb( h, achan0, "ch",  upr_rt_00, "sel", NULL );
1783
+  cmDspSysInstallCb( h, achan0, "ch",  lwr_rt_00, "sel", NULL );
1784
+
1785
+  cmDspSysInstallCb( h, achan1, "ch",  mod_rt_10, "sel", NULL );   
1786
+  cmDspSysInstallCb( h, achan1, "ch",  thr_rt_10, "sel", NULL );
1787
+  cmDspSysInstallCb( h, achan1, "ch",  upr_rt_10, "sel", NULL );
1788
+  cmDspSysInstallCb( h, achan1, "ch",  lwr_rt_10, "sel", NULL );
1789
+
1790
+   
1791
+
1792
+  // active measure to meas->param mapping routers
1793
+  cmDspSysInstallCb(h, amp,  "even",  even_sr_00, "val_in", NULL );
1794
+  cmDspSysInstallCb(h, amp,  "even",  even_sr_10, "val_in", NULL );
1795
+  cmDspSysInstallCb(h, amp,  "dyn",   dyn_sr_00,  "val_in", NULL );
1796
+  cmDspSysInstallCb(h, amp,  "dyn",   dyn_sr_10,  "val_in", NULL );
1797
+  cmDspSysInstallCb(h, amp,  "tempo", tempo_sr_00,"val_in", NULL );
1798
+  cmDspSysInstallCb(h, amp,  "tempo", tempo_sr_10,"val_in", NULL );
1799
+  cmDspSysInstallCb(h, amp,  "cost",  cost_sr_00, "val_in", NULL );
1800
+  cmDspSysInstallCb(h, amp,  "cost",  cost_sr_10, "val_in", NULL );
1801
+
1802
+  // active-channel to cross-fade connections
1803
+  cmDspSysInstallCb(h, achan0, "gate-0",  fad0, "gate-0", NULL );
1804
+  cmDspSysInstallCb(h, achan0, "gate-1",  fad0, "gate-1", NULL );
1805
+  cmDspSysInstallCb(h, fad0,   "state-0", achan0, "dis-0",  NULL );
1806
+  cmDspSysInstallCb(h, fad0,   "state-1", achan0, "dis-1",  NULL );
1807
+
1808
+  cmDspSysInstallCb(h, achan1, "gate-0",  fad1, "gate-0", NULL );
1809
+  cmDspSysInstallCb(h, achan1, "gate-1",  fad1, "gate-1", NULL );
1810
+  cmDspSysInstallCb(h, fad1,   "state-0", achan1, "dis-0",  NULL );
1811
+  cmDspSysInstallCb(h, fad1,   "state-1", achan1, "dis-1",  NULL );
1812
+
1813
+
1814
+  // =========================================================================
1815
+  //  Scale Range Connections 00
1816
+  //
1817
+
1818
+  // DYN -> scaleRange -> Router -> var scaleRange
1819
+  cmDspSysInstallCb(h, min_dyn_0,  "val",     dyn_sr_00,  "min_in",  NULL );
1820
+  cmDspSysInstallCb(h, max_dyn_0,  "val",     dyn_sr_00,  "max_in",  NULL );
1821
+  cmDspSysInstallCb(h, dyn_sr_00,   "val_out", dyn_rt_00,  "f-in",    NULL );
1822
+  cmDspSysInstallCb(h, menu_dyn_0, "out",     dyn_rt_00,  "sel",     NULL );
1823
+  cmDspSysInstallCb(h, dyn_rt_00,   "f-out-0", thrh_sr_00, "val_in",  NULL );
1824
+  cmDspSysInstallCb(h, dyn_rt_00,   "f-out-1", upr_sr_00,  "val_in",  NULL );
1825
+  cmDspSysInstallCb(h, dyn_rt_00,   "f-out-2", lwr_sr_00,  "val_in",  NULL );
1826
+
1827
+  // EVEN -> scaleRange -> Router  -> var scaleRange
1828
+  cmDspSysInstallCb(h, min_even_0,  "val",     even_sr_00,  "min_in",  NULL );
1829
+  cmDspSysInstallCb(h, max_even_0,  "val",     even_sr_00,  "max_in",  NULL );
1830
+  cmDspSysInstallCb(h, even_sr_00,   "val_out", even_rt_00,  "f-in",    NULL );
1831
+  cmDspSysInstallCb(h, menu_even_0, "out",     even_rt_00,  "sel",     NULL );
1832
+  cmDspSysInstallCb(h, even_rt_00,   "f-out-0", thrh_sr_00, "val_in",  NULL );
1833
+  cmDspSysInstallCb(h, even_rt_00,   "f-out-1", upr_sr_00,  "val_in",  NULL );
1834
+  cmDspSysInstallCb(h, even_rt_00,   "f-out-2", lwr_sr_00,  "val_in",  NULL );
1835
+
1836
+  // TEMPO -> scaleRange -> Router  -> var scaleRange
1837
+  cmDspSysInstallCb(h, min_tempo_0,  "val",     tempo_sr_00,  "min_in",  NULL );
1838
+  cmDspSysInstallCb(h, max_tempo_0,  "val",     tempo_sr_00,  "max_in",  NULL );
1839
+  cmDspSysInstallCb(h, tempo_sr_00,   "val_out", tempo_rt_00,  "f-in",    NULL );
1840
+  cmDspSysInstallCb(h, menu_tempo_0, "out",     tempo_rt_00,  "sel",     NULL );
1841
+  cmDspSysInstallCb(h, tempo_rt_00,   "f-out-0", thrh_sr_00, "val_in",  NULL );
1842
+  cmDspSysInstallCb(h, tempo_rt_00,   "f-out-1", upr_sr_00,  "val_in",  NULL );
1843
+  cmDspSysInstallCb(h, tempo_rt_00,   "f-out-2", lwr_sr_00,  "val_in",  NULL );
1844
+
1845
+  // COST -> scaleRange -> Router  -> var scaleRange 
1846
+  cmDspSysInstallCb(h, min_cost_0,  "val",     cost_sr_00,  "min_in",  NULL );
1847
+  cmDspSysInstallCb(h, max_cost_0,  "val",     cost_sr_00,  "max_in",  NULL );
1848
+  cmDspSysInstallCb(h, cost_sr_00,   "val_out", cost_rt_00,  "f-in",    NULL );
1849
+  cmDspSysInstallCb(h, menu_cost_0, "out",     cost_rt_00,  "sel",     NULL );
1850
+  cmDspSysInstallCb(h, cost_rt_00,   "f-out-0", thrh_sr_00, "val_in",  NULL );
1851
+  cmDspSysInstallCb(h, cost_rt_00,   "f-out-1", upr_sr_00,  "val_in",  NULL );
1852
+  cmDspSysInstallCb(h, cost_rt_00,   "f-out-2", lwr_sr_00,  "val_in",  NULL );
1853
+
1854
+  // MODE -> FX
1855
+  cmDspSysInstallCb(h, md00p,      "val",  mod_rt_00,  "f-in",      NULL );
1856
+  cmDspSysInstallCb(h, mod_rt_00, "f-out-0", kr00, "mode", NULL );   // mode->kr
1857
+  cmDspSysInstallCb(h, mod_rt_00, "f-out-1", kr01, "mode", NULL );   // mode->kr
1858
+
1859
+
1860
+  // THRESH scaleRange -> FX
1861
+  cmDspSysInstallCb(h, min_thrh_0, "val",     thrh_sr_00, "min_out", NULL );
1862
+  cmDspSysInstallCb(h, max_thrh_0, "val",     thrh_sr_00, "max_out", NULL );
1863
+  cmDspSysInstallCb(h, thrh_sr_00, "val_out", th00p,      "val",     NULL );
1864
+  cmDspSysInstallCb(h, th00p,      "val",     thr_rt_00,  "f-in",      NULL );
1865
+  cmDspSysInstallCb(h, thr_rt_00,  "f-out-0",   kr00,       "thrh",    NULL );   // thresh->kr
1866
+  cmDspSysInstallCb(h, thr_rt_00,  "f-out-1",   kr01,       "thrh",    NULL );   // thresh->kr
1867
+
1868
+  // UPR scaleRange -> FX
1869
+  cmDspSysInstallCb(h, min_upr_0, "val",     upr_sr_00, "min_out", NULL );
1870
+  cmDspSysInstallCb(h, max_upr_0, "val",     upr_sr_00, "max_out", NULL );
1871
+  cmDspSysInstallCb(h, upr_sr_00, "val_out", us00p,     "val",     NULL );
1872
+  cmDspSysInstallCb(h, us00p,     "val",     upr_rt_00, "f-in",      NULL );
1873
+  cmDspSysInstallCb(h, upr_rt_00, "f-out-0",   kr00,      "uprs",    NULL );   // uprSlope->kr
1874
+  cmDspSysInstallCb(h, upr_rt_00, "f-out-1",   kr01,      "uprs",    NULL );   // uprSlope->kr
1875
+
1876
+
1877
+  // LWR scaleRange -> FX
1878
+  cmDspSysInstallCb(h, min_lwr_0, "val",     lwr_sr_00, "min_out", NULL );
1879
+  cmDspSysInstallCb(h, max_lwr_0, "val",     lwr_sr_00, "max_out", NULL );
1880
+  cmDspSysInstallCb(h, lwr_sr_00, "val_out", ls00p,     "val",     NULL );
1881
+  cmDspSysInstallCb(h, ls00p,     "val",     lwr_rt_00, "f-in",      NULL );
1882
+  cmDspSysInstallCb(h, lwr_rt_00, "f-out-0",   kr00,      "lwrs",    NULL );   // lwrSlope->kr
1883
+  cmDspSysInstallCb(h, lwr_rt_00, "f-out-1",   kr01,      "lwrs",    NULL );   // lwrSlope->kr
1884
+
1885
+
1886
+
1887
+  // =========================================================================
1888
+  //  Scale Range Connections 10
1889
+  //
1890
+
1891
+  // DYN -> scaleRange -> Router -> var scaleRange
1892
+  cmDspSysInstallCb(h, min_dyn_1,  "val",     dyn_sr_10,  "min_in",  NULL );
1893
+  cmDspSysInstallCb(h, max_dyn_1,  "val",     dyn_sr_10,  "max_in",  NULL );
1894
+  cmDspSysInstallCb(h, dyn_sr_10,   "val_out", dyn_rt_10,  "f-in",    NULL );
1895
+  cmDspSysInstallCb(h, menu_dyn_1, "out",     dyn_rt_10,  "sel",     NULL );
1896
+  cmDspSysInstallCb(h, dyn_rt_10,   "f-out-0", thrh_sr_10, "val_in",  NULL );
1897
+  cmDspSysInstallCb(h, dyn_rt_10,   "f-out-1", upr_sr_10,  "val_in",  NULL );
1898
+  cmDspSysInstallCb(h, dyn_rt_10,   "f-out-2", lwr_sr_10,  "val_in",  NULL );
1899
+
1900
+  // EVEN -> scaleRange -> Router  -> var scaleRange
1901
+  cmDspSysInstallCb(h, min_even_1,  "val",     even_sr_10,  "min_in",  NULL );
1902
+  cmDspSysInstallCb(h, max_even_1,  "val",     even_sr_10,  "max_in",  NULL );
1903
+  cmDspSysInstallCb(h, even_sr_10,   "val_out", even_rt_10,  "f-in",    NULL );
1904
+  cmDspSysInstallCb(h, menu_even_1, "out",     even_rt_10,  "sel",     NULL );
1905
+  cmDspSysInstallCb(h, even_rt_10,   "f-out-0", thrh_sr_10, "val_in",  NULL );
1906
+  cmDspSysInstallCb(h, even_rt_10,   "f-out-1", upr_sr_10,  "val_in",  NULL );
1907
+  cmDspSysInstallCb(h, even_rt_10,   "f-out-2", lwr_sr_10,  "val_in",  NULL );
1908
+
1909
+  // TEMPO -> scaleRange -> Router  -> var scaleRange
1910
+  cmDspSysInstallCb(h, min_tempo_1,  "val",     tempo_sr_10,  "min_in",  NULL );
1911
+  cmDspSysInstallCb(h, max_tempo_1,  "val",     tempo_sr_10,  "max_in",  NULL );
1912
+  cmDspSysInstallCb(h, tempo_sr_10,   "val_out", tempo_rt_10,  "f-in",    NULL );
1913
+  cmDspSysInstallCb(h, menu_tempo_1, "out",     tempo_rt_10,  "sel",     NULL );
1914
+  cmDspSysInstallCb(h, tempo_rt_10,   "f-out-0", thrh_sr_10, "val_in",  NULL );
1915
+  cmDspSysInstallCb(h, tempo_rt_10,   "f-out-1", upr_sr_10,  "val_in",  NULL );
1916
+  cmDspSysInstallCb(h, tempo_rt_10,   "f-out-2", lwr_sr_10,  "val_in",  NULL );
1917
+
1918
+  // COST -> scaleRange -> Router  -> var scaleRange 
1919
+  cmDspSysInstallCb(h, min_cost_1,  "val",     cost_sr_10,  "min_in",  NULL );
1920
+  cmDspSysInstallCb(h, max_cost_1,  "val",     cost_sr_10,  "max_in",  NULL );
1921
+  cmDspSysInstallCb(h, cost_sr_10,   "val_out", cost_rt_10,  "f-in",    NULL );
1922
+  cmDspSysInstallCb(h, menu_cost_1, "out",     cost_rt_10,  "sel",     NULL );
1923
+  cmDspSysInstallCb(h, cost_rt_10,   "f-out-0", thrh_sr_10, "val_in",  NULL );
1924
+  cmDspSysInstallCb(h, cost_rt_10,   "f-out-1", upr_sr_10,  "val_in",  NULL );
1925
+  cmDspSysInstallCb(h, cost_rt_10,   "f-out-2", lwr_sr_10,  "val_in",  NULL );
1926
+
1927
+  // MODE -> FX
1928
+  cmDspSysInstallCb(h, md10p,      "val",      mod_rt_10,  "f-in",      NULL );
1929
+  cmDspSysInstallCb(h, mod_rt_10, "f-out-0", kr10, "mode", NULL );   // mode->kr
1930
+  cmDspSysInstallCb(h, mod_rt_10, "f-out-1", kr11, "mode", NULL );   // mode->kr
1931
+
1932
+  // THRESH scaleRange -> FX
1933
+  cmDspSysInstallCb(h, min_thrh_1, "val",      thrh_sr_10, "min_out", NULL );
1934
+  cmDspSysInstallCb(h, max_thrh_1, "val",      thrh_sr_10, "max_out", NULL );
1935
+  cmDspSysInstallCb(h, thrh_sr_10, "val_out",  th10p,      "val",     NULL );
1936
+  cmDspSysInstallCb(h, th10p,      "val",      thr_rt_10,  "f-in",      NULL );
1937
+  cmDspSysInstallCb(h, thr_rt_10, "f-out-0", kr10, "thrh", NULL );   // thresh->kr
1938
+  cmDspSysInstallCb(h, thr_rt_10, "f-out-1", kr11, "thrh", NULL );   // thresh->kr
1939
+
1940
+  // UPR scaleRange -> FX
1941
+  cmDspSysInstallCb(h, min_upr_1, "val",      upr_sr_10,  "min_out", NULL );
1942
+  cmDspSysInstallCb(h, max_upr_1, "val",      upr_sr_10,  "max_out", NULL );
1943
+  cmDspSysInstallCb(h, upr_sr_10,  "val_out", us10p,      "val",     NULL );
1944
+  cmDspSysInstallCb(h, us10p,      "val",     upr_rt_10,  "f-in",      NULL );
1945
+  cmDspSysInstallCb(h, upr_rt_10, "f-out-0", kr10, "uprs", NULL );   // uprSlope->kr
1946
+  cmDspSysInstallCb(h, upr_rt_10, "f-out-1", kr11, "uprs", NULL );   // uprSlope->kr
1947
+
1948
+  // LWR scaleRange -> FX
1949
+  cmDspSysInstallCb(h, min_lwr_1, "val",     lwr_sr_10, "min_out", NULL );
1950
+  cmDspSysInstallCb(h, max_lwr_1, "val",     lwr_sr_10, "max_out", NULL );
1951
+  cmDspSysInstallCb(h, lwr_sr_10, "val_out", ls10p,     "val",     NULL );
1952
+  cmDspSysInstallCb(h, ls10p,     "val",     lwr_rt_10, "f-in",      NULL );
1953
+  cmDspSysInstallCb(h, lwr_rt_10, "f-out-0", kr10, "lwrs", NULL );   // lwrSlope->kr
1954
+  cmDspSysInstallCb(h, lwr_rt_10, "f-out-1", kr11, "lwrs", NULL );   // lwrSlope->kr
1955
+
1956
+  
1957
+
1958
+
1959
+  cmDspSysNewPage(h,"Compressor");
1960
+
1961
+  cmDspInst_t* cmp0_byp   = cmDspSysAllocCheckP(  h,  compPreGrpSymId, NULL, "Bypass0", 1.0 );
1962
+  cmDspInst_t* cmp0_igain = cmDspSysAllocScalarP( h,  compPreGrpSymId, NULL, "In Gain0", 0.0,   10.0, 0.1, cmpInGain );
1963
+  cmDspInst_t* cmp0_thr   = cmDspSysAllocScalarP( h,  compPreGrpSymId, NULL, "ThreshDb0", -100.0, 0.0, 0.1, cmpThreshDb);
1964
+  cmDspInst_t* cmp0_rat   = cmDspSysAllocScalarP( h,  compPreGrpSymId, NULL, "Ratio0",    0.1, 100, 0.1, cmpRatio_num);
1965
+  cmDspInst_t* cmp0_atk   = cmDspSysAllocScalarP( h,  compPreGrpSymId, NULL, "Atk Ms0",   0.0, 1000.0, 0.1, cmpAtkMs);
1966
+  cmDspInst_t* cmp0_rls   = cmDspSysAllocScalarP( h,  compPreGrpSymId, NULL, "Rls Ms0",   0.0, 1000.0, 0.1, cmpRlsMs);
1967
+  cmDspInst_t* cmp0_mkup  = cmDspSysAllocScalarP( h,  compPreGrpSymId, NULL, "Makeup0",   0.0, 10.0,   0.01, cmpMakeup);
1968
+  cmDspInst_t* cmp0_wnd   = cmDspSysAllocScalarP( h,  compPreGrpSymId, NULL, "Wnd Ms0",   1.0, cmpWndMaxMs, 1.0, cmpWndMs );
1969
+  cmDspInst_t* cmp0_mtr   = cmDspSysAllocInst(h,"Meter","Env0", 3, 0.0, 0.0, 1.0);
1970
+
1971
+  cmDspSysInstallCb(h, cmp0_byp,  "out", cmp0, "bypass", NULL );
1972
+  cmDspSysInstallCb(h, cmp0_igain,"val", cmp0, "igain", NULL );
1973
+  cmDspSysInstallCb(h, cmp0_thr,  "val", cmp0, "thr", NULL );
1974
+  cmDspSysInstallCb(h, cmp0_rat,  "val", cmp0, "ratio", NULL );
1975
+  cmDspSysInstallCb(h, cmp0_atk,  "val", cmp0, "atk", NULL );
1976
+  cmDspSysInstallCb(h, cmp0_rls,  "val", cmp0, "rls", NULL );
1977
+  cmDspSysInstallCb(h, cmp0_mkup, "val", cmp0, "ogain", NULL );
1978
+  cmDspSysInstallCb(h, cmp0_wnd,  "val", cmp0, "wnd", NULL );
1979
+  cmDspSysInstallCb(h, cmp0,      "env", cmp0_mtr, "in", NULL );
1980
+
1981
+  cmDspSysNewColumn(h,0);
1982
+  cmDspInst_t* cmp1_byp   = cmDspSysAllocCheckP(  h, compPreGrpSymId, NULL, "Bypass1", 1.0 );
1983
+  cmDspInst_t* cmp1_igain = cmDspSysAllocScalarP( h, compPreGrpSymId, NULL, "In Gain1",  0.0,   10.0, 0.1, cmpInGain);
1984
+  cmDspInst_t* cmp1_thr   = cmDspSysAllocScalarP( h, compPreGrpSymId, NULL, "ThreshDb1", -100.0, 0.0, 0.1, cmpThreshDb);
1985
+  cmDspInst_t* cmp1_rat   = cmDspSysAllocScalarP( h, compPreGrpSymId, NULL, "Ratio1",    0.1, 100, 0.1, cmpRatio_num);
1986
+  cmDspInst_t* cmp1_atk   = cmDspSysAllocScalarP( h, compPreGrpSymId, NULL, "Atk Ms1",   0.0, 1000.0, 0.1, cmpAtkMs);
1987
+  cmDspInst_t* cmp1_rls   = cmDspSysAllocScalarP( h, compPreGrpSymId, NULL, "Rls Ms1",   0.0, 1000.0, 0.1, cmpRlsMs);
1988
+  cmDspInst_t* cmp1_mkup  = cmDspSysAllocScalarP( h, compPreGrpSymId, NULL, "Makeup1",   0.0, 10.0,   0.01, cmpMakeup);
1989
+  cmDspInst_t* cmp1_wnd   = cmDspSysAllocScalarP( h, compPreGrpSymId, NULL, "Wnd Ms1",   1.0, cmpWndMaxMs, 1.0, cmpWndMs );
1990
+  cmDspInst_t* cmp1_mtr   = cmDspSysAllocInst(h,"Meter","Env1", 3, 0.0, 0.0, 1.0);
1991
+
1992
+  cmDspSysInstallCb(h, cmp1_byp,  "out", cmp1, "bypass", NULL );
1993
+  cmDspSysInstallCb(h, cmp1_igain,"val", cmp1, "igain", NULL );
1994
+  cmDspSysInstallCb(h, cmp1_thr,  "val", cmp1, "thr", NULL );
1995
+  cmDspSysInstallCb(h, cmp1_rat,  "val", cmp1, "ratio", NULL );
1996
+  cmDspSysInstallCb(h, cmp1_atk,  "val", cmp1, "atk", NULL );
1997
+  cmDspSysInstallCb(h, cmp1_rls,  "val", cmp1, "rls", NULL );
1998
+  cmDspSysInstallCb(h, cmp1_mkup, "val", cmp1, "ogain", NULL );
1999
+  cmDspSysInstallCb(h, cmp1_wnd,  "val", cmp1, "wnd", NULL );
2000
+  cmDspSysInstallCb(h, cmp1,      "env", cmp1_mtr, "in", NULL );
2001
+
2002
+  //--------------- Compressor Preset controls
2003
+  cmDspSysNewColumn(h,0);
2004
+  cmDspInst_t* comp_preset    = cmDspSysAllocInst(   h, "Preset", NULL, 1, compPreGrpSymId );
2005
+  cmDspInst_t* comp_presetLbl = cmDspSysAllocInst(   h, "Text",   "Comp_Preset",      1, "" );
2006
+  cmDspInst_t* comp_storeBtn  = cmDspSysAllocButton( h, "comp_store",  0);
2007
+  cmDspInst_t* comp_recallBtn = cmDspSysAllocButton( h, "comp_recall", 0);
2008
+  cmDspInst_t* comp_pts       = cmDspSysAllocInst(   h, "PortToSym", NULL, 2, "store", "recall");
2009
+
2010
+  cmDspSysInstallCb(   h, comp_presetLbl, "val",    comp_preset, "label",NULL);
2011
+  cmDspSysInstallCb(   h, comp_storeBtn,  "out",    comp_pts,    "store", NULL );
2012
+  cmDspSysInstallCb(   h, comp_recallBtn, "out",    comp_pts,    "recall", NULL );
2013
+  cmDspSysInstallCb(   h, comp_pts,       "store",  comp_preset, "cmd", NULL );
2014
+  cmDspSysInstallCb(   h, comp_pts,       "recall", comp_preset, "cmd", NULL );
2015
+
2016
+  return rc;
2017
+}
1380 2018
 
1381 2019
 
1382 2020
 

Laddar…
Avbryt
Spara