Browse Source

cmDspPgmKrChain2.c,cmDspPgmKrTimeLineLiteAf.c : many changes to refine output.

master
kevin 3 years ago
parent
commit
4edc0c968d
2 changed files with 37 additions and 23 deletions
  1. 13
    4
      src/dsp/cmDspPgmKrChain2.c
  2. 24
    19
      src/dsp/cmDspPgmKrTimeLineLiteAf.c

+ 13
- 4
src/dsp/cmDspPgmKrChain2.c View File

@@ -105,6 +105,7 @@ void _cmDspSys_TlXformChain( cmDspSysH_t h, cmDspTlXform_t* c,  unsigned preGrpS
105 105
   unsigned paramRtChCnt = 2;
106 106
   cmDspInst_t* wnd_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
107 107
   cmDspInst_t* hop_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
108
+  cmDspInst_t* ign_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
108 109
   cmDspInst_t* cel_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
109 110
   cmDspInst_t* exp_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
110 111
   cmDspInst_t* mix_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
@@ -118,7 +119,9 @@ void _cmDspSys_TlXformChain( cmDspSysH_t h, cmDspTlXform_t* c,  unsigned preGrpS
118 119
   cmDspInst_t* kr1  = cmDspSysAllocInst(h, "Kr2",        NULL,   2, krWndSmpCnt, krHopFact );
119 120
   cmDspInst_t* xfad = cmDspSysAllocInst(h, "Xfader",     NULL,   3, xfadeChCnt,  xfadeMs, xfadeInitFl ); 
120 121
   cmDspInst_t* mix  = cmDspSysAllocInst(h, "AMix",       NULL,   3, xfadeChCnt,  mixGain, mixGain );
121
-  cmDspInst_t* cmp  = cmDspSysAllocInst(h, "Compressor", NULL,   8, cmpBypassFl, cmpThreshDb, cmpRatio_num, cmpAtkMs, cmpRlsMs, cmpMakeup, cmpWndMs, cmpWndMaxMs ); 
122
+  cmDspInst_t* cmp  = cmDspSysAllocInst(h, "Compressor", NULL,   8, cmpBypassFl, cmpThreshDb, cmpRatio_num, cmpAtkMs, cmpRlsMs, cmpMakeup, cmpWndMs, cmpWndMaxMs );
123
+
124
+  
122 125
 
123 126
   // Internal audio connections
124 127
   cmDspSysConnectAudio(h, kr0,  "out",   xfad, "in-0");
@@ -158,6 +161,7 @@ void _cmDspSys_TlXformChain( cmDspSysH_t h, cmDspTlXform_t* c,  unsigned preGrpS
158 161
   cmDspSysNewColumn(h,0);
159 162
   cmDspInst_t* wnd_ctl = cmDspSysAllocMsgListP(h,preGrpSymId,NULL, lbl("WndSmpCnt"), NULL, "wndSmpCnt", 2);
160 163
   cmDspInst_t* hop_ctl = cmDspSysAllocMsgListP(h,preGrpSymId,NULL, lbl("HopFact"),   NULL, "hopFact",   2);
164
+  cmDspInst_t* ign_ctl = cmDspSysAllocScalarP( h,preGrpSymId,NULL, lbl("In Gain"),   0.0,  10.0, 0.001, 1.0 );
161 165
   cmDspInst_t* cel_ctl = cmDspSysAllocScalarP( h,preGrpSymId,NULL, lbl("Ceiling"),   0.0, 100.0, 0.1,  30.0 );
162 166
   cmDspInst_t* exp_ctl = cmDspSysAllocScalarP( h,preGrpSymId,NULL, lbl("Expo"),    -10.0,  10.0, 0.01,  2.0 );
163 167
   cmDspInst_t* mix_ctl = cmDspSysAllocScalarP( h,preGrpSymId,NULL, lbl("Mix"),       0.0,   1.0, 0.01,  0.0 );    
@@ -166,7 +170,6 @@ void _cmDspSys_TlXformChain( cmDspSysH_t h, cmDspTlXform_t* c,  unsigned preGrpS
166 170
   cmDspInst_t* lwr_ctl = cmDspSysAllocScalarP( h,preGrpSymId,NULL, lbl("Lwr slope"), 0.3,  10.0, 0.01,  2.0 );
167 171
   cmDspInst_t* wet_ctl = cmDspSysAllocScalarP( h,preGrpSymId,NULL, lbl("Wet Dry"),   0.0,   1.0, 0.001, 1.0 );
168 172
 
169
-  
170 173
   cmDspSysInstallCb(h, wnd_ctl, "out",         wnd_rt, "f-in",    NULL );
171 174
   cmDspSysInstallCb(h, achan,   "ch",          wnd_rt, "sel",     NULL );   // ach->rt sel
172 175
   cmDspSysInstallCb(h, wnd_rt,  "f-out-0",     kr0,    "wndn",    NULL );   // wndn->kr
@@ -176,7 +179,12 @@ void _cmDspSys_TlXformChain( cmDspSysH_t h, cmDspTlXform_t* c,  unsigned preGrpS
176 179
   cmDspSysInstallCb(h, achan,   "ch",          hop_rt, "sel",     NULL );   // ach->rt sel
177 180
   cmDspSysInstallCb(h, hop_rt,  "f-out-0",     kr0,    "hopf",    NULL );   // hopf->kr
178 181
   cmDspSysInstallCb(h, hop_rt,  "f-out-1",     kr1,    "hopf",    NULL );   // hopf->kr
179
-  
182
+
183
+  cmDspSysInstallCb(h, ign_ctl,     "val",     ign_rt, "f-in",    NULL );
184
+  cmDspSysInstallCb(h, achan,       "ch",      ign_rt, "sel",     NULL );   // ach->rt sel
185
+  cmDspSysInstallCb(h, ign_rt,      "f-out-0", kr0,    "igain",   NULL );   // ign->kr
186
+  cmDspSysInstallCb(h, ign_rt,      "f-out-1", kr1,    "igain",   NULL );   // ign->kr
187
+    
180 188
   cmDspSysInstallCb(h, thr_ctl,     "val",     thr_rt, "f-in",    NULL );
181 189
   cmDspSysInstallCb(h, achan,       "ch",      thr_rt, "sel",     NULL );   // ach->rt sel
182 190
   cmDspSysInstallCb(h, thr_rt,      "f-out-0", kr0,    "thrh",    NULL );   // thr->kr
@@ -260,6 +268,7 @@ void _cmDspSys_TlXformChain( cmDspSysH_t h, cmDspTlXform_t* c,  unsigned preGrpS
260 268
 
261 269
   
262 270
   cmDspSysInstallCb(h, modp, mlbl("hop"),  hop_ctl, "sel", NULL );
271
+  cmDspSysInstallCb(h, modp, mlbl("ign"),  ign_ctl, "val", NULL );
263 272
   cmDspSysInstallCb(h, modp, mlbl("ceil"), cel_ctl, "val", NULL );
264 273
   cmDspSysInstallCb(h, modp, mlbl("expo"), exp_ctl, "val", NULL );
265 274
   cmDspSysInstallCb(h, modp, mlbl("mix"),  mix_ctl, "val", NULL );
@@ -267,7 +276,7 @@ void _cmDspSys_TlXformChain( cmDspSysH_t h, cmDspTlXform_t* c,  unsigned preGrpS
267 276
   cmDspSysInstallCb(h, modp, mlbl("upr"),  upr_ctl, "val", NULL );
268 277
   cmDspSysInstallCb(h, modp, mlbl("lwr"),  lwr_ctl, "val", NULL );
269 278
   cmDspSysInstallCb(h, modp, mlbl("wet"),  wet_ctl, "val", NULL );
270
-  cmDspSysInstallCb(h, modp, mlbl("sw"),   achan,       "trig", NULL ); // See also: amp.sfloc->achan.trig
279
+  cmDspSysInstallCb(h, modp, mlbl("sw"),   achan,  "trig", NULL ); // See also: amp.sfloc->achan.trig
271 280
 
272 281
   
273 282
   c->achan = achan; 

+ 24
- 19
src/dsp/cmDspPgmKrTimeLineLiteAf.c View File

@@ -83,6 +83,9 @@ cmDspRC_t _cmDspSysPgm_TimeLineLiteAf(cmDspSysH_t h, void** userPtrPtr )
83 83
   unsigned   cmpPreGrpSymId  = cmDspSysPresetRegisterGroup(h,"tl_cmp"); 
84 84
 
85 85
   cmDspTlXform_t c0,c1;
86
+  memset(&c0,0,sizeof(c0));
87
+  memset(&c1,0,sizeof(c1));
88
+    
86 89
 
87 90
   cmDspSysNewPage(h,"Controls-0");
88 91
   _cmDspSys_TlXformChain(h, &c0, preGrpSymId, cmpPreGrpSymId, amp, modp, 0, 0 );
@@ -121,10 +124,10 @@ cmDspRC_t _cmDspSysPgm_TimeLineLiteAf(cmDspSysH_t h, void** userPtrPtr )
121 124
   cmDspInst_t* ogainW = cmDspSysAllocInst(h,"Scalar", "Wet Master",   5, kNumberDuiId, 0.0,   10.0,0.01,   1.0 );  
122 125
   cmDspInst_t* ogainD = cmDspSysAllocInst(h,"Scalar", "Dry Master",   5, kNumberDuiId, 0.0,   10.0,0.01,   1.0 );  
123 126
 
124
-  cmDspInst_t* gmult0  = cmDspSysAllocInst(h,"ScalarOp", NULL, 6, 2, "*", "in-0", 1.0, "in-1", 1.0 );
125
-  cmDspInst_t* gmult1  = cmDspSysAllocInst(h,"ScalarOp", NULL, 6, 2, "*", "in-0", 1.0, "in-1", 1.0 );
126
-  cmDspInst_t* gmult2  = cmDspSysAllocInst(h,"ScalarOp", NULL, 6, 2, "*", "in-0", 1.0, "in-1", 1.0 );
127
-  cmDspInst_t* gmult3  = cmDspSysAllocInst(h,"ScalarOp", NULL, 6, 2, "*", "in-0", 1.0, "in-1", 1.0 );
127
+  cmDspInst_t* gmult0  = cmDspSysAllocInst(h,"ScalarOp", NULL, 6, 2, "*$", "in-0", 1.0, "in-1", 1.0 );
128
+  cmDspInst_t* gmult1  = cmDspSysAllocInst(h,"ScalarOp", NULL, 6, 2, "*$", "in-0", 1.0, "in-1", 1.0 );
129
+  cmDspInst_t* gmult2  = cmDspSysAllocInst(h,"ScalarOp", NULL, 6, 2, "*$", "in-0", 1.0, "in-1", 1.0 );
130
+  cmDspInst_t* gmult3  = cmDspSysAllocInst(h,"ScalarOp", NULL, 6, 2, "*$", "in-0", 1.0, "in-1", 1.0 );
128 131
   
129 132
  
130 133
   
@@ -136,8 +139,10 @@ cmDspRC_t _cmDspSysPgm_TimeLineLiteAf(cmDspSysH_t h, void** userPtrPtr )
136 139
   cmDspInst_t* mi0p    = cmDspSysAllocInst(h,"AMeter","In 0",  0);
137 140
   cmDspInst_t* mi1p    = cmDspSysAllocInst(h,"AMeter","In 1",  0);
138 141
 
139
-  cmDspInst_t* meas     = cmDspSysAllocInst(h,"Scalar", "Begin Meas", 5, kNumberDuiId, 1.0, 1000.0, 1.0, 1.0 );  
140
-  cmDspInst_t* emeas    = cmDspSysAllocInst(h,"Scalar", "End   Meas", 5, kNumberDuiId, 1.0, 1000.0, 1.0, 1.0 );  
142
+  cmDspInst_t* meas    = cmDspSysAllocInst(h,"Scalar", "Begin Meas", 5, kNumberDuiId, 1.0, 1000.0, 1.0, 1.0 );  
143
+  cmDspInst_t* eloc    = cmDspSysAllocInst(h,"Scalar", "End   Loc",  5, kNumberDuiId, 1.0, 1000.0, 1.0, 1.0 );
144
+  cmDspInst_t* sfp_loc = cmDspSysAllocInst(h,"Label",  NULL, 1, "sf loc:");
145
+
141 146
   cmDspSysInstallCb( h, meas, "val", scp, "meas", NULL);
142 147
   cmDspSysInstallCb( h, meas, "val", tlp, "meas", NULL);
143 148
   
@@ -323,36 +328,36 @@ cmDspRC_t _cmDspSysPgm_TimeLineLiteAf(cmDspSysH_t h, void** userPtrPtr )
323 328
 
324 329
   // score follower to recd_play,modulator and printers
325 330
   cmDspSysInstallCb(h, sfp, "out",     modp,    "index", NULL );
326
-  cmDspSysInstallCb(h, sfp, "recent",  prp,     "in",  NULL );  // report 'recent' but only act on 'max' loc index
331
+  cmDspSysInstallCb(h, sfp, "recent",  sfp_loc,   "in",  NULL );  // report 'recent' but only act on 'max' loc index
327 332
 
328
-  cmDspSysInstallCb( h, emeas, "val", its,  "off-int", NULL);
333
+  cmDspSysInstallCb( h, eloc , "val", its,  "off-int", NULL);
329 334
   cmDspSysInstallCb( h, sfp,   "out", its,  "in",  NULL);
330 335
   cmDspSysInstallCb( h, its,   "out", offb, "in",  NULL);
331 336
   cmDspSysInstallCb( h, its,   "out", prp, "in",  NULL);
332 337
   
333 338
 
334
-  cmDspSysInstallCb(h, modp, "dgain0",  ogain0, "val",  NULL );
339
+  cmDspSysInstallCb(h, modp, "dgain0",  ogain0, "val",  NULL ); // mod -> ogain
335 340
   cmDspSysInstallCb(h, modp, "dgain1",  ogain1, "val",  NULL );
336 341
   cmDspSysInstallCb(h, modp, "wgain0",  ogain2, "val",  NULL );
337 342
   cmDspSysInstallCb(h, modp, "wgain1",  ogain3, "val",  NULL );
338 343
 
339 344
 
340
-  cmDspSysInstallCb(h, ogain0,  "val", gmult0, "in-0", NULL );
341
-  cmDspSysInstallCb(h, ogainD,  "val", gmult0, "in-1", NULL );
342
-  
345
+  cmDspSysInstallCb(h, ogain0,  "val", gmult0, "in-0", NULL ); // ogain scalars -> gmult 0
343 346
   cmDspSysInstallCb(h, ogain1,  "val", gmult1, "in-0", NULL );
344
-  cmDspSysInstallCb(h, ogainD,  "val", gmult1, "in-1", NULL );
345
-  
346 347
   cmDspSysInstallCb(h, ogain2,  "val", gmult2, "in-0", NULL );
347
-  cmDspSysInstallCb(h, ogainW,  "val", gmult2, "in-1", NULL );
348 348
   cmDspSysInstallCb(h, ogain3,  "val", gmult3, "in-0", NULL );
349
+  
350
+  cmDspSysInstallCb(h, ogainD,  "val", gmult0, "in-1", NULL ); // master scalars -> gmult 1
351
+  cmDspSysInstallCb(h, ogainD,  "val", gmult1, "in-1", NULL );
352
+  cmDspSysInstallCb(h, ogainW,  "val", gmult2, "in-1", NULL );
349 353
   cmDspSysInstallCb(h, ogainW,  "val", gmult3, "in-1", NULL );
350 354
   
351
-  cmDspSysInstallCb(h, gmult0, "out", lmix, "gain-0", NULL );   // output gain control - dry 0
352
-  cmDspSysInstallCb(h, gmult1, "out", rmix, "gain-0", NULL );   //                       dry 1
353
-  cmDspSysInstallCb(h, gmult2, "out", lmix, "gain-1", NULL );   //                       wet 0
354
-  cmDspSysInstallCb(h, gmult3, "out", rmix, "gain-1", NULL );   //                       wet 1
355
+  cmDspSysInstallCb(h, gmult0, "out", lmix, "gain-0", NULL );   // gmult -> wdmix - l dry 
356
+  cmDspSysInstallCb(h, gmult1, "out", rmix, "gain-0", NULL );   //                  r dry
357
+  cmDspSysInstallCb(h, gmult2, "out", lmix, "gain-1", NULL );   //                  l wet
358
+  cmDspSysInstallCb(h, gmult3, "out", rmix, "gain-1", NULL );   //                  r wet
355 359
 
360
+  //cmDspSysInstallCb(h, gmult2, "out", prp, "in", NULL );
356 361
 
357 362
   return rc;
358 363
 }

Loading…
Cancel
Save