Sfoglia il codice sorgente

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

master
kevin 10 anni fa
parent
commit
c11c875f29
1 ha cambiato i file con 31 aggiunte e 4 eliminazioni
  1. 31
    4
      dsp/cmDspPgmKr.c

+ 31
- 4
dsp/cmDspPgmKr.c Vedi File

@@ -97,10 +97,13 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
97 97
   double          cmpWndMaxMs  = 1000.0;
98 98
   double          cmpWndMs     = 200.0;
99 99
 
100
+  bool            splitFragFl = true;
100 101
   double          recdPlayInitAllocSecs    = 10.0;
101 102
   double          recdPlayMaxLaSecs        = 2.0;
102 103
   double          recdPlayCurLaSecs        = 0.1;
103 104
   double          recdPlayFadeRateDbPerSec = 4.0;
105
+  double          fragMixGain              = splitFragFl ? 0.0 : mixGain;
106
+
104 107
 
105 108
   memset(&r,0,sizeof(r));
106 109
   cmErrSetup(&err,&cmCtx->rpt,"Kr Timeline");
@@ -177,17 +180,24 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
177 180
   cmDspInst_t* kr00 = cmDspSysAllocInst(h, "Kr",         NULL,   2, krWndSmpCnt, krHopFact );
178 181
   cmDspInst_t* kr01 = cmDspSysAllocInst(h, "Kr",         NULL,   2, krWndSmpCnt, krHopFact );
179 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 184
   cmDspInst_t* cmp0 =  cmDspSysAllocInst(h,"Compressor", NULL,   8, cmpBypassFl, cmpThreshDb, cmpRatio_num, cmpAtkMs, cmpRlsMs, cmpMakeup, cmpWndMs, cmpWndMaxMs ); 
182 185
   cmDspInst_t* ao0p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 0 );
183 186
   
184 187
   cmDspInst_t* kr10 = cmDspSysAllocInst(h, "Kr",         NULL,   2, krWndSmpCnt, krHopFact );
185 188
   cmDspInst_t* kr11 = cmDspSysAllocInst(h, "Kr",         NULL,   2, krWndSmpCnt, krHopFact );
186 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 191
   cmDspInst_t* cmp1 =  cmDspSysAllocInst(h,"Compressor", NULL,   8, cmpBypassFl, cmpThreshDb, cmpRatio_num, cmpAtkMs, cmpRlsMs, cmpMakeup, cmpWndMs, cmpWndMaxMs ); 
189 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 202
   cmDspSysNewPage(h,"Controls");
193 203
   cmDspInst_t* liveb= cmDspSysAllocInst(h,"Button", "live",    2, kCheckDuiId,  0.0 );
@@ -292,8 +302,13 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
292 302
 
293 303
   cmDspInst_t* igain0 = cmDspSysAllocInst(h,"Scalar", "In Gain-0",    5, kNumberDuiId, 0.0,   10.0,0.01,   1.0 );  
294 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 308
   cmDspInst_t* ogain0 = cmDspSysAllocInst(h,"Scalar", "Out Gain-0",   5, kNumberDuiId, 0.0,   10.0,0.01,   3.0 );  
296 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 312
   cmDspInst_t* xfadMs = cmDspSysAllocInst(h,"Scalar", "Xfade Ms",     5, kNumberDuiId, 0.0,   1000.0,0.01, 50.0 );  
298 313
 
299 314
   // Audio file recording
@@ -411,6 +426,12 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
411 426
   cmDspSysConnectAudio(h, cmp0, "out", afop, "in0" );    // comp -> audio_file_out
412 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 435
   // wave-table to time-line cursor
415 436
   cmDspSysInstallCb(   h, wtp, "fidx",tlp,  "curs", NULL); 
416 437
 
@@ -542,10 +563,16 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
542 563
   cmDspSysInstallCb(h, iv10p,     "val",   kr11, "invt", NULL );   // invert->kr
543 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 571
   cmDspSysInstallCb(h, igain1, "val", ai1p, "gain", NULL );
547 572
   cmDspSysInstallCb(h, ogain0, "val", ao0p, "gain", NULL );   // output gain control
548 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 576
   cmDspSysInstallCb(h, xfadMs, "val", fad0, "ms", NULL );
550 577
   cmDspSysInstallCb(h, xfadMs, "val", fad1, "ms", NULL );
551 578
 
@@ -826,7 +853,7 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
826 853
   cmDspSysInstallCb(   h, comp_recallBtn, "out",    comp_pts,    "recall", NULL );
827 854
   cmDspSysInstallCb(   h, comp_pts,       "store",  comp_preset, "cmd", NULL );
828 855
   cmDspSysInstallCb(   h, comp_pts,       "recall", comp_preset, "cmd", NULL );
829
-
856
+  
830 857
   return rc;
831 858
 }
832 859
 

Loading…
Annulla
Salva