Browse Source

cmDspPgmKr.c: Added option to direct fragments to independent audio outputs.

master
kevin 11 years ago
parent
commit
c11c875f29
1 changed files with 31 additions and 4 deletions
  1. 31
    4
      dsp/cmDspPgmKr.c

+ 31
- 4
dsp/cmDspPgmKr.c View File

97
   double          cmpWndMaxMs  = 1000.0;
97
   double          cmpWndMaxMs  = 1000.0;
98
   double          cmpWndMs     = 200.0;
98
   double          cmpWndMs     = 200.0;
99
 
99
 
100
+  bool            splitFragFl = true;
100
   double          recdPlayInitAllocSecs    = 10.0;
101
   double          recdPlayInitAllocSecs    = 10.0;
101
   double          recdPlayMaxLaSecs        = 2.0;
102
   double          recdPlayMaxLaSecs        = 2.0;
102
   double          recdPlayCurLaSecs        = 0.1;
103
   double          recdPlayCurLaSecs        = 0.1;
103
   double          recdPlayFadeRateDbPerSec = 4.0;
104
   double          recdPlayFadeRateDbPerSec = 4.0;
105
+  double          fragMixGain              = splitFragFl ? 0.0 : mixGain;
106
+
104
 
107
 
105
   memset(&r,0,sizeof(r));
108
   memset(&r,0,sizeof(r));
106
   cmErrSetup(&err,&cmCtx->rpt,"Kr Timeline");
109
   cmErrSetup(&err,&cmCtx->rpt,"Kr Timeline");
177
   cmDspInst_t* kr00 = cmDspSysAllocInst(h, "Kr",         NULL,   2, krWndSmpCnt, krHopFact );
180
   cmDspInst_t* kr00 = cmDspSysAllocInst(h, "Kr",         NULL,   2, krWndSmpCnt, krHopFact );
178
   cmDspInst_t* kr01 = cmDspSysAllocInst(h, "Kr",         NULL,   2, krWndSmpCnt, krHopFact );
181
   cmDspInst_t* kr01 = cmDspSysAllocInst(h, "Kr",         NULL,   2, krWndSmpCnt, krHopFact );
179
   cmDspInst_t* fad0 = cmDspSysAllocInst(h, "Xfader",     NULL,   3, xfadeChCnt,  xfadeMs, xfadeInitFl ); 
182
   cmDspInst_t* fad0 = cmDspSysAllocInst(h, "Xfader",     NULL,   3, xfadeChCnt,  xfadeMs, xfadeInitFl ); 
180
-  cmDspInst_t* mix0 = cmDspSysAllocInst(h, "AMix",       NULL,   4, xfadeChCnt+1, mixGain, mixGain, mixGain );
183
+  cmDspInst_t* mix0 = cmDspSysAllocInst(h, "AMix",       NULL,   4, xfadeChCnt+1, mixGain, mixGain, fragMixGain );
181
   cmDspInst_t* cmp0 =  cmDspSysAllocInst(h,"Compressor", NULL,   8, cmpBypassFl, cmpThreshDb, cmpRatio_num, cmpAtkMs, cmpRlsMs, cmpMakeup, cmpWndMs, cmpWndMaxMs ); 
184
   cmDspInst_t* cmp0 =  cmDspSysAllocInst(h,"Compressor", NULL,   8, cmpBypassFl, cmpThreshDb, cmpRatio_num, cmpAtkMs, cmpRlsMs, cmpMakeup, cmpWndMs, cmpWndMaxMs ); 
182
   cmDspInst_t* ao0p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 0 );
185
   cmDspInst_t* ao0p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 0 );
183
   
186
   
184
   cmDspInst_t* kr10 = cmDspSysAllocInst(h, "Kr",         NULL,   2, krWndSmpCnt, krHopFact );
187
   cmDspInst_t* kr10 = cmDspSysAllocInst(h, "Kr",         NULL,   2, krWndSmpCnt, krHopFact );
185
   cmDspInst_t* kr11 = cmDspSysAllocInst(h, "Kr",         NULL,   2, krWndSmpCnt, krHopFact );
188
   cmDspInst_t* kr11 = cmDspSysAllocInst(h, "Kr",         NULL,   2, krWndSmpCnt, krHopFact );
186
   cmDspInst_t* fad1 = cmDspSysAllocInst(h, "Xfader",     NULL,   3, xfadeChCnt,  xfadeMs, xfadeInitFl ); 
189
   cmDspInst_t* fad1 = cmDspSysAllocInst(h, "Xfader",     NULL,   3, xfadeChCnt,  xfadeMs, xfadeInitFl ); 
187
-  cmDspInst_t* mix1 = cmDspSysAllocInst(h, "AMix",       NULL,   4, xfadeChCnt+1, mixGain, mixGain, mixGain );
190
+  cmDspInst_t* mix1 = cmDspSysAllocInst(h, "AMix",       NULL,   4, xfadeChCnt+1, mixGain, mixGain, fragMixGain );
188
   cmDspInst_t* cmp1 =  cmDspSysAllocInst(h,"Compressor", NULL,   8, cmpBypassFl, cmpThreshDb, cmpRatio_num, cmpAtkMs, cmpRlsMs, cmpMakeup, cmpWndMs, cmpWndMaxMs ); 
191
   cmDspInst_t* cmp1 =  cmDspSysAllocInst(h,"Compressor", NULL,   8, cmpBypassFl, cmpThreshDb, cmpRatio_num, cmpAtkMs, cmpRlsMs, cmpMakeup, cmpWndMs, cmpWndMaxMs ); 
189
   cmDspInst_t* ao1p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 1 );
192
   cmDspInst_t* ao1p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 1 );
190
 
193
 
194
+  cmDspInst_t* ao2p = NULL;
195
+  cmDspInst_t* ao3p = NULL;
196
+  if( splitFragFl )
197
+  {
198
+    ao2p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 2 );
199
+    ao3p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 3 );
200
+  }
191
 
201
 
192
   cmDspSysNewPage(h,"Controls");
202
   cmDspSysNewPage(h,"Controls");
193
   cmDspInst_t* liveb= cmDspSysAllocInst(h,"Button", "live",    2, kCheckDuiId,  0.0 );
203
   cmDspInst_t* liveb= cmDspSysAllocInst(h,"Button", "live",    2, kCheckDuiId,  0.0 );
292
 
302
 
293
   cmDspInst_t* igain0 = cmDspSysAllocInst(h,"Scalar", "In Gain-0",    5, kNumberDuiId, 0.0,   10.0,0.01,   1.0 );  
303
   cmDspInst_t* igain0 = cmDspSysAllocInst(h,"Scalar", "In Gain-0",    5, kNumberDuiId, 0.0,   10.0,0.01,   1.0 );  
294
   cmDspInst_t* igain1 = cmDspSysAllocInst(h,"Scalar", "In Gain-1",    5, kNumberDuiId, 0.0,   10.0,0.01,   1.0 );  
304
   cmDspInst_t* igain1 = cmDspSysAllocInst(h,"Scalar", "In Gain-1",    5, kNumberDuiId, 0.0,   10.0,0.01,   1.0 );  
305
+
306
+  cmDspInst_t* lasecs = cmDspSysAllocInst(h,"Scalar", "LA Secs",      5, kNumberDuiId, 0.0,   recdPlayMaxLaSecs,0.01,   recdPlayCurLaSecs );  
307
+  cmDspInst_t* dbpsec = cmDspSysAllocInst(h,"Scalar", "Fade dBpSec",  5, kNumberDuiId, 0.0,   24.0, 0.01, recdPlayFadeRateDbPerSec);
295
   cmDspInst_t* ogain0 = cmDspSysAllocInst(h,"Scalar", "Out Gain-0",   5, kNumberDuiId, 0.0,   10.0,0.01,   3.0 );  
308
   cmDspInst_t* ogain0 = cmDspSysAllocInst(h,"Scalar", "Out Gain-0",   5, kNumberDuiId, 0.0,   10.0,0.01,   3.0 );  
296
   cmDspInst_t* ogain1 = cmDspSysAllocInst(h,"Scalar", "Out Gain-1",   5, kNumberDuiId, 0.0,   10.0,0.01,   3.0 );  
309
   cmDspInst_t* ogain1 = cmDspSysAllocInst(h,"Scalar", "Out Gain-1",   5, kNumberDuiId, 0.0,   10.0,0.01,   3.0 );  
310
+  cmDspInst_t* ogain2 = cmDspSysAllocInst(h,"Scalar", "Out Gain-2",   5, kNumberDuiId, 0.0,   10.0,0.01,   3.0 );  
311
+  cmDspInst_t* ogain3 = cmDspSysAllocInst(h,"Scalar", "Out Gain-3",   5, kNumberDuiId, 0.0,   10.0,0.01,   3.0 );  
297
   cmDspInst_t* xfadMs = cmDspSysAllocInst(h,"Scalar", "Xfade Ms",     5, kNumberDuiId, 0.0,   1000.0,0.01, 50.0 );  
312
   cmDspInst_t* xfadMs = cmDspSysAllocInst(h,"Scalar", "Xfade Ms",     5, kNumberDuiId, 0.0,   1000.0,0.01, 50.0 );  
298
 
313
 
299
   // Audio file recording
314
   // Audio file recording
411
   cmDspSysConnectAudio(h, cmp0, "out", afop, "in0" );    // comp -> audio_file_out
426
   cmDspSysConnectAudio(h, cmp0, "out", afop, "in0" );    // comp -> audio_file_out
412
   cmDspSysConnectAudio(h, cmp1, "out", afop, "in1" );
427
   cmDspSysConnectAudio(h, cmp1, "out", afop, "in1" );
413
 
428
 
429
+  if( splitFragFl )
430
+  {
431
+    cmDspSysConnectAudio(h, rpp, "out-0", ao2p, "in" );
432
+    cmDspSysConnectAudio(h, rpp, "out-1", ao3p, "in" );
433
+  }
434
+
414
   // wave-table to time-line cursor
435
   // wave-table to time-line cursor
415
   cmDspSysInstallCb(   h, wtp, "fidx",tlp,  "curs", NULL); 
436
   cmDspSysInstallCb(   h, wtp, "fidx",tlp,  "curs", NULL); 
416
 
437
 
542
   cmDspSysInstallCb(h, iv10p,     "val",   kr11, "invt", NULL );   // invert->kr
563
   cmDspSysInstallCb(h, iv10p,     "val",   kr11, "invt", NULL );   // invert->kr
543
   cmDspSysInstallCb(h, wet10p,    "val",   kr11, "wet", NULL );    //  wet->kr
564
   cmDspSysInstallCb(h, wet10p,    "val",   kr11, "wet", NULL );    //  wet->kr
544
 
565
 
545
-  cmDspSysInstallCb(h, igain0, "val", ai0p, "gain", NULL );   // output gain control
566
+ 
567
+  cmDspSysInstallCb(   h, lasecs, "val", rpp, "curla", NULL ); // recd/play control
568
+  cmDspSysInstallCb(   h, dbpsec, "val", rpp, "frate", NULL );
569
+
570
+  cmDspSysInstallCb(h, igain0, "val", ai0p, "gain", NULL );   // input gain control
546
   cmDspSysInstallCb(h, igain1, "val", ai1p, "gain", NULL );
571
   cmDspSysInstallCb(h, igain1, "val", ai1p, "gain", NULL );
547
   cmDspSysInstallCb(h, ogain0, "val", ao0p, "gain", NULL );   // output gain control
572
   cmDspSysInstallCb(h, ogain0, "val", ao0p, "gain", NULL );   // output gain control
548
   cmDspSysInstallCb(h, ogain1, "val", ao1p, "gain", NULL );
573
   cmDspSysInstallCb(h, ogain1, "val", ao1p, "gain", NULL );
574
+  cmDspSysInstallCb(h, ogain2, "val", ao2p, "gain", NULL );  
575
+  cmDspSysInstallCb(h, ogain3, "val", ao3p, "gain", NULL );
549
   cmDspSysInstallCb(h, xfadMs, "val", fad0, "ms", NULL );
576
   cmDspSysInstallCb(h, xfadMs, "val", fad0, "ms", NULL );
550
   cmDspSysInstallCb(h, xfadMs, "val", fad1, "ms", NULL );
577
   cmDspSysInstallCb(h, xfadMs, "val", fad1, "ms", NULL );
551
 
578
 
826
   cmDspSysInstallCb(   h, comp_recallBtn, "out",    comp_pts,    "recall", NULL );
853
   cmDspSysInstallCb(   h, comp_recallBtn, "out",    comp_pts,    "recall", NULL );
827
   cmDspSysInstallCb(   h, comp_pts,       "store",  comp_preset, "cmd", NULL );
854
   cmDspSysInstallCb(   h, comp_pts,       "store",  comp_preset, "cmd", NULL );
828
   cmDspSysInstallCb(   h, comp_pts,       "recall", comp_preset, "cmd", NULL );
855
   cmDspSysInstallCb(   h, comp_pts,       "recall", comp_preset, "cmd", NULL );
829
-
856
+  
830
   return rc;
857
   return rc;
831
 }
858
 }
832
 
859
 

Loading…
Cancel
Save