瀏覽代碼

cmDspPgmKr.c:Added compressor to _cmDspSysPgm_TimeLine()

master
kevin 11 年之前
父節點
當前提交
6552c90322
共有 1 個檔案被更改,包括 181 行新增55 行删除
  1. 181
    55
      dsp/cmDspPgmKr.c

+ 181
- 55
dsp/cmDspPgmKr.c 查看文件

@@ -73,6 +73,20 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
73 73
   double          xfadMs      = 200;
74 74
   bool            xfadAllOnFl  = true;
75 75
 
76
+  unsigned        measRtChCnt = 4; // note: router channel 4 is not connected
77
+
78
+  bool            cmpBypassFl  = false;
79
+  double          cmpInGain    = 3.0;
80
+  double          cmpThreshDb  = -40.0;
81
+  double          cmpRatio_num = 5.0;
82
+  double          cmpAtkMs     = 20.0;
83
+  double          cmpRlsMs     = 100.0;
84
+  double          cmpMakeup    = 1.0;
85
+  double          cmpWndMaxMs  = 1000.0;
86
+  double          cmpWndMs     = 200.0;
87
+
88
+
89
+
76 90
   memset(&r,0,sizeof(r));
77 91
   cmErrSetup(&err,&cmCtx->rpt,"Kr Timeline");
78 92
 
@@ -85,11 +99,33 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
85 99
   cmDspInst_t* wtp  = cmDspSysAllocInst(h,"WaveTable",   NULL,  4, wtSmpCnt, wtInitMode, NULL, wtLoopCnt );
86 100
   cmDspInst_t* pts  = cmDspSysAllocInst(h,"PortToSym",   NULL,  2, "on", "off" );
87 101
   cmDspInst_t* mfp  = cmDspSysAllocInst(h,"MidiFilePlay",NULL,  0 );
102
+  //cmDspInst_t* mip  = cmDspSysAllocInst(h,"MidiIn",      NULL,  0 );
88 103
   cmDspInst_t* sfp  = cmDspSysAllocInst(h,"ScFol",       NULL,  1, r.scFn );
89
-  cmDspInst_t* srp  = cmDspSysAllocInst(h,"ScaleRange",  NULL,  0 );
90 104
   cmDspInst_t* modp = cmDspSysAllocInst(h,"ScMod",       NULL,  2, r.modFn, "m1" );
105
+
106
+  cmDspInst_t* even_sr  = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4,  0.8,   1.1, 0.0, 1.0 );
107
+  cmDspInst_t* even_rt  = cmDspSysAllocInst(h, "Router",      NULL,  2,  measRtChCnt, measRtChCnt-1 );
108
+
109
+
110
+  cmDspInst_t* dyn_sr   = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4,  0.0,   4.0, 0.01, 1.0 );
111
+  cmDspInst_t* dyn_rt  = cmDspSysAllocInst(h,  "Router",      NULL,  2,  measRtChCnt, measRtChCnt-1 );
112
+
113
+  cmDspInst_t* tempo_sr = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4, 80.0, 120.0, 0.01, 1.0 );
114
+  cmDspInst_t* tempo_rt  = cmDspSysAllocInst(h,"Router",      NULL,  2,  measRtChCnt, measRtChCnt-1 );
115
+
116
+  cmDspInst_t* cost_sr  = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4,  0.0,    1.0, 0.001, 1.0 );
117
+  cmDspInst_t* cost_rt  = cmDspSysAllocInst(h, "Router",      NULL,  2,  measRtChCnt, measRtChCnt-1 );
118
+
119
+  cmDspInst_t* thrh_sr  = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4,  0.0, 1.0, 0.01, 100.0 );
120
+  cmDspInst_t* upr_sr   = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4,  0.0, 1.0, -1.0, 5.0 );
121
+  cmDspInst_t* lwr_sr   = cmDspSysAllocInst(h, "ScaleRange",  NULL,  4,  0.0, 1.0, -5.0, 5.0 );
122
+
91 123
   cmDspInst_t* kr0p = cmDspSysAllocInst(h,"Kr",          NULL,   2, krWndSmpCnt, krHopFact );
92 124
   cmDspInst_t* kr1p = cmDspSysAllocInst(h,"Kr",          NULL,   2, krWndSmpCnt, krHopFact );
125
+
126
+  cmDspInst_t* cmp0 =  cmDspSysAllocInst(h,"Compressor", NULL, 8, cmpBypassFl, cmpThreshDb, cmpRatio_num, cmpAtkMs, cmpRlsMs, cmpMakeup, cmpWndMs, cmpWndMaxMs ); 
127
+  cmDspInst_t* cmp1 =  cmDspSysAllocInst(h,"Compressor", NULL, 8, cmpBypassFl, cmpThreshDb, cmpRatio_num, cmpAtkMs, cmpRlsMs, cmpMakeup, cmpWndMs, cmpWndMaxMs ); 
128
+
93 129
   cmDspInst_t* xfad = cmDspSysAllocInst(h,"Xfader",      NULL,   3, xfadOutChCnt, xfadMs, xfadAllOnFl );
94 130
  
95 131
 
@@ -106,7 +142,7 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
106 142
   cmDspInst_t* prd  = cmDspSysAllocInst(h,"Printer", NULL,   1, "DYN:" );
107 143
   cmDspInst_t* pre  = cmDspSysAllocInst(h,"Printer", NULL,   1, "EVEN:" );
108 144
   cmDspInst_t* prt  = cmDspSysAllocInst(h,"Printer", NULL,   1, "TEMPO:");
109
-  //cmDspInst_t* prc  = cmDspSysAllocInst(h,"Printer", NULL,   1, "COST:");
145
+  cmDspInst_t* prc  = cmDspSysAllocInst(h,"Printer", NULL,   1, "COST:");
110 146
   //cmDspInst_t* prv  = cmDspSysAllocInst(h,"Printer", NULL,   1, "Value:");
111 147
   cmDspSysNewColumn(h,0);
112 148
 
@@ -138,25 +174,32 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
138 174
   cmDspInst_t* ogain = cmDspSysAllocInst(h,"Scalar", "Out Gain",   5, kNumberDuiId, 0.0,   10.0,0.01,   3.0 );  
139 175
   //cmDspInst_t* reload = cmDspSysAllocInst(h,"Button", "Reload",     2, kButtonDuiId, 0.0 );
140 176
 
141
-  cmDspInst_t* imin_dyn   = cmDspSysAllocScalar( h, "Min In Dyn",      0.0, 10.0, 1.0, 0.0);
142
-  cmDspInst_t* imax_dyn   = cmDspSysAllocScalar( h, "Max In Dyn",      0.0, 10.0, 1.0, 4.0);
143
-  cmDspInst_t* omin_dyn   = cmDspSysAllocScalar( h, "Min Out Dyn",     0.0, 100.0, 0.5, 0.0);
144
-  cmDspInst_t* omax_dyn   = cmDspSysAllocScalar( h, "Max Out Dyn",     0.0, 100.0, 0.5, 100.0);
177
+  cmDspInst_t* min_dyn   = cmDspSysAllocScalar( h, "Min In Dyn",      0.0, 10.0, 1.0, 0.0);
178
+  cmDspInst_t* max_dyn   = cmDspSysAllocScalar( h, "Max In Dyn",      0.0, 10.0, 1.0, 4.0);
179
+  cmDspInst_t* menu_dyn   = cmDspSysAllocInst(  h, "MsgList","DynSel", 3, "measMenu", NULL, measRtChCnt-1);
145 180
 
146
-  cmDspInst_t* imin_even   = cmDspSysAllocScalar( h, "Min In Even",      0.0, 10.0, 0.01, 0.0);
147
-  cmDspInst_t* imax_even   = cmDspSysAllocScalar( h, "Max In Even",      0.0, 10.0, 0.01, 1.0);
148
-  cmDspInst_t* omin_even   = cmDspSysAllocScalar( h, "Min Out Even",     0.0, 100.0, 0.5, 0.0);
149
-  cmDspInst_t* omax_even   = cmDspSysAllocScalar( h, "Max Out Even",     0.0, 100.0, 0.5, 100.0);
181
+  cmDspInst_t* min_even   = cmDspSysAllocScalar( h, "Min In Even",    0.0, 1.0, 0.001, 0.75);
182
+  cmDspInst_t* max_even   = cmDspSysAllocScalar( h, "Max In Even",    0.0, 3.0, 0.001, 1.0);
183
+  cmDspInst_t* menu_even   = cmDspSysAllocInst(  h, "MsgList","EvenSel", 3, "measMenu", NULL, measRtChCnt-1);
150 184
 
151
-  cmDspInst_t* imin_tempo   = cmDspSysAllocScalar( h, "Min In Tempo",      0.0, 200.0, 1.0, 80.0);
152
-  cmDspInst_t* imax_tempo   = cmDspSysAllocScalar( h, "Max In Tempo",      0.0, 200.0, 1.0, 120.0);
153
-  cmDspInst_t* omin_tempo   = cmDspSysAllocScalar( h, "Min Out Tempo",     0.0, 100.0, 0.5, 0.0);
154
-  cmDspInst_t* omax_tempo   = cmDspSysAllocScalar( h, "Max Out Tempo",     0.0, 100.0, 0.5, 100.0);
185
+  cmDspSysNewColumn(h,0);
186
+  cmDspInst_t* min_tempo   = cmDspSysAllocScalar( h, "Min In Tempo",   0.0, 200.0, 1.0, 80.0);
187
+  cmDspInst_t* max_tempo   = cmDspSysAllocScalar( h, "Max In Tempo",   0.0, 200.0, 1.0, 120.0);
188
+  cmDspInst_t* menu_tempo   = cmDspSysAllocInst(  h, "MsgList","TempoSel", 3, "measMenu", NULL, measRtChCnt-1);
155 189
 
156
-  cmDspInst_t* imin_cost   = cmDspSysAllocScalar( h, "Min In Cost",      0.0, 200.0, 1.0, 80.0);
157
-  cmDspInst_t* imax_cost   = cmDspSysAllocScalar( h, "Max In Cost",      0.0, 200.0, 1.0, 120.0);
158
-  cmDspInst_t* omin_cost   = cmDspSysAllocScalar( h, "Min Out Cost",     0.0, 100.0, 0.5, 0.0);
159
-  cmDspInst_t* omax_cost   = cmDspSysAllocScalar( h, "Max Out Cost",     0.0, 100.0, 0.5, 100.0);
190
+  cmDspInst_t* min_cost   = cmDspSysAllocScalar( h, "Min In Cost",      0.0, 1.0, 0.01, 0.0);
191
+  cmDspInst_t* max_cost   = cmDspSysAllocScalar( h, "Max In Cost",      0.0, 1.0, 0.01, 1.0);
192
+  cmDspInst_t* menu_cost   = cmDspSysAllocInst(  h, "MsgList","CostSel", 3, "measMenu", NULL, measRtChCnt-1);
193
+
194
+  cmDspSysNewColumn(h,0);
195
+  cmDspInst_t* min_thrh   = cmDspSysAllocScalar( h, "Min Thresh",      0.0, 100.0, 1.0, 30.0);
196
+  cmDspInst_t* max_thrh   = cmDspSysAllocScalar( h, "Max Thresh",      0.0, 100.0, 1.0, 80.0);
197
+
198
+  cmDspInst_t* min_upr   = cmDspSysAllocScalar( h, "Min Upr",          -1.0, 1.0, 0.001, -0.5);
199
+  cmDspInst_t* max_upr   = cmDspSysAllocScalar( h, "Max Upr",          -1.0, 1.0, 0.001, 0.5);
200
+
201
+  cmDspInst_t* min_lwr   = cmDspSysAllocScalar( h, "Min Lwr",          0.0, -1.0, 5.0, 1.0);
202
+  cmDspInst_t* max_lwr   = cmDspSysAllocScalar( h, "Max Lwr",          0.0, -1.0, 5.0, 3.0);
160 203
 
161 204
 
162 205
   if((rc = cmDspSysLastRC(h)) != kOkDspRC )
@@ -165,7 +208,7 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
165 208
   // phasor->wt->aout
166 209
   cmDspSysConnectAudio(h, php,  "out", wtp,  "phs" );   // phs -> wt
167 210
 
168
-  if(1)
211
+  if(0)
169 212
   {
170 213
     cmDspSysConnectAudio(h, wtp,  "out", kr0p,  "in"  );  // wt->kr
171 214
     cmDspSysConnectAudio(h, wtp,  "out", kr1p,  "in"  );
@@ -177,9 +220,13 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
177 220
   }
178 221
   else
179 222
   {
180
-    cmDspSysConnectAudio(h, wtp, "out", ao0p, "in"  );   // wt  -> aout0
181
-    cmDspSysConnectAudio(h, wtp, "out", ao1p, "in" );    // wt  -> aout1
182
-    //cmDspSysConnectAudio(h, wtp, "out", af0p, "in0" );   // wt  -> audio file
223
+    cmDspSysConnectAudio(h, wtp,  "out", kr0p,  "in"  );  // wt->kr
224
+    cmDspSysConnectAudio(h, wtp,  "out", kr1p,  "in"  );
225
+
226
+    cmDspSysConnectAudio(h, kr0p, "out", cmp0, "in"  );   // wt  -> aout0
227
+    cmDspSysConnectAudio(h, cmp0, "out", ao0p, "in" );
228
+    cmDspSysConnectAudio(h, kr1p, "out", cmp1, "in" );    // wt  -> aout1
229
+    cmDspSysConnectAudio(h, cmp1, "out", ao1p, "in" );
183 230
   }
184 231
 
185 232
   // wave-table to time-line cursor
@@ -218,7 +265,7 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
218 265
   //cmDspSysInstallCb(h, reload,"out",  modp, "reload", NULL );
219 266
 
220 267
 
221
-  // MIDI file play er to score follower
268
+  // MIDI file player to score follower
222 269
   if(1)
223 270
   {
224 271
     cmDspSysInstallCb(h, mfp, "smpidx", sfp, "smpidx", NULL );
@@ -226,6 +273,13 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
226 273
     cmDspSysInstallCb(h, mfp, "d0",     sfp, "d0",     NULL );
227 274
     cmDspSysInstallCb(h, mfp, "status", sfp, "status", NULL );
228 275
   }
276
+  else
277
+  {
278
+    //cmDspSysInstallCb(h, mip, "smpidx", sfp, "smpidx", NULL );
279
+    //cmDspSysInstallCb(h, mip, "d1",     sfp, "d1",     NULL );
280
+    //cmDspSysInstallCb(h, mip, "d0",     sfp, "d0",     NULL );
281
+    //cmDspSysInstallCb(h, mip, "status", sfp, "status", NULL );
282
+  }
229 283
 
230 284
   // score follower to modulator and printers
231 285
   cmDspSysInstallCb(h, sfp, "out",  modp, "index", NULL );
@@ -233,6 +287,7 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
233 287
   cmDspSysInstallCb(h, sfp, "even", pre, "in", NULL );
234 288
   cmDspSysInstallCb(h, sfp, "dyn",  prd, "in", NULL );
235 289
   cmDspSysInstallCb(h, sfp, "tempo",prt, "in", NULL );
290
+  cmDspSysInstallCb(h, sfp, "cost", prc, "in", NULL );
236 291
 
237 292
   cmDspSysInstallCb(h, prtb, "sym", sfp, "cmd", NULL );
238 293
   cmDspSysInstallCb(h, qtb,  "sym", sfp, "cmd", NULL );
@@ -286,39 +341,110 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
286 341
   cmDspSysInstallCb(h, modp, "wet1", wet1, "val", NULL );
287 342
   cmDspSysInstallCb(h, modp, "xf1",  xfad, "gate-1", NULL );
288 343
 
344
+  // DYN -> scaleRange -> Router -> var scaleRange
345
+  cmDspSysInstallCb(h, sfp,      "dyn",     dyn_sr,  "val_in",  NULL );
346
+  cmDspSysInstallCb(h, min_dyn,  "val",     dyn_sr,  "min_in",  NULL );
347
+  cmDspSysInstallCb(h, max_dyn,  "val",     dyn_sr,  "max_in",  NULL );
348
+  cmDspSysInstallCb(h, dyn_sr,   "val_out", dyn_rt,  "f-in",    NULL );
349
+  cmDspSysInstallCb(h, menu_dyn, "out",     dyn_rt,  "sel",     NULL );
350
+  cmDspSysInstallCb(h, dyn_rt,   "f-out-0", thrh_sr, "val_in",  NULL );
351
+  cmDspSysInstallCb(h, dyn_rt,   "f-out-1", upr_sr,  "val_in",  NULL );
352
+  cmDspSysInstallCb(h, dyn_rt,   "f-out-2", lwr_sr,  "val_in",  NULL );
353
+
354
+  // EVEN -> scaleRange -> Router  -> var scaleRange
355
+  cmDspSysInstallCb(h, sfp,      "even",     even_sr,  "val_in",  NULL );
356
+  cmDspSysInstallCb(h, min_even,  "val",     even_sr,  "min_in",  NULL );
357
+  cmDspSysInstallCb(h, max_even,  "val",     even_sr,  "max_in",  NULL );
358
+  cmDspSysInstallCb(h, even_sr,   "val_out", even_rt,  "f-in",    NULL );
359
+  cmDspSysInstallCb(h, menu_even, "out",     even_rt,  "sel",     NULL );
360
+  cmDspSysInstallCb(h, even_rt,   "f-out-0", thrh_sr, "val_in",  NULL );
361
+  cmDspSysInstallCb(h, even_rt,   "f-out-1", upr_sr,  "val_in",  NULL );
362
+  cmDspSysInstallCb(h, even_rt,   "f-out-2", lwr_sr,  "val_in",  NULL );
363
+
364
+  // TEMPO -> scaleRange -> Router  -> var scaleRange
365
+  cmDspSysInstallCb(h, sfp,      "tempo",     tempo_sr,  "val_in",  NULL );
366
+  cmDspSysInstallCb(h, min_tempo,  "val",     tempo_sr,  "min_in",  NULL );
367
+  cmDspSysInstallCb(h, max_tempo,  "val",     tempo_sr,  "max_in",  NULL );
368
+  cmDspSysInstallCb(h, tempo_sr,   "val_out", tempo_rt,  "f-in",    NULL );
369
+  cmDspSysInstallCb(h, menu_tempo, "out",     tempo_rt,  "sel",     NULL );
370
+  cmDspSysInstallCb(h, tempo_rt,   "f-out-0", thrh_sr, "val_in",  NULL );
371
+  cmDspSysInstallCb(h, tempo_rt,   "f-out-1", upr_sr,  "val_in",  NULL );
372
+  cmDspSysInstallCb(h, tempo_rt,   "f-out-2", lwr_sr,  "val_in",  NULL );
373
+
374
+  // COST -> scaleRange -> Router  -> var scaleRange 
375
+  cmDspSysInstallCb(h, sfp,      "cost",     cost_sr,  "val_in",  NULL );
376
+  cmDspSysInstallCb(h, min_cost,  "val",     cost_sr,  "min_in",  NULL );
377
+  cmDspSysInstallCb(h, max_cost,  "val",     cost_sr,  "max_in",  NULL );
378
+  cmDspSysInstallCb(h, cost_sr,   "val_out", cost_rt,  "f-in",    NULL );
379
+  cmDspSysInstallCb(h, menu_cost, "out",     cost_rt,  "sel",     NULL );
380
+  cmDspSysInstallCb(h, cost_rt,   "f-out-0", thrh_sr, "val_in",  NULL );
381
+  cmDspSysInstallCb(h, cost_rt,   "f-out-1", upr_sr,  "val_in",  NULL );
382
+  cmDspSysInstallCb(h, cost_rt,   "f-out-2", lwr_sr,  "val_in",  NULL );
383
+
384
+
385
+  // THRESH scaleRange -> FX
386
+  cmDspSysInstallCb(h, min_thrh, "val",     thrh_sr, "min_out", NULL );
387
+  cmDspSysInstallCb(h, max_thrh, "val",     thrh_sr, "max_out", NULL );
388
+  cmDspSysInstallCb(h, thrh_sr,  "val_out", th0p,    "val",     NULL );
389
+  cmDspSysInstallCb(h, thrh_sr,  "val_out", th1p,    "val",     NULL );
390
+
391
+
392
+  // UPR scaleRange -> FX
393
+  cmDspSysInstallCb(h, min_upr, "val",     upr_sr, "min_out", NULL );
394
+  cmDspSysInstallCb(h, max_upr, "val",     upr_sr, "max_out", NULL );
395
+  cmDspSysInstallCb(h, upr_sr,  "val_out", us0p,    "val",     NULL );
396
+  cmDspSysInstallCb(h, upr_sr,  "val_out", us1p,    "val",     NULL );
397
+
398
+
399
+  // LWR scaleRange -> FX
400
+  cmDspSysInstallCb(h, min_lwr, "val",     lwr_sr, "min_out", NULL );
401
+  cmDspSysInstallCb(h, max_lwr, "val",     lwr_sr, "max_out", NULL );
402
+  cmDspSysInstallCb(h, lwr_sr,  "val_out", ls0p,    "val",     NULL );
403
+  cmDspSysInstallCb(h, lwr_sr,  "val_out", ls1p,    "val",     NULL );
404
+
405
+
406
+  cmDspSysNewPage(h,"Compressor");
407
+  cmDspInst_t* cmp0_byp   = cmDspSysAllocCheck(  h, "Bypass0", 1.0 );
408
+  cmDspInst_t* cmp0_igain = cmDspSysAllocScalar( h, "In Gain0",  0.0,   10.0, 0.1, cmpInGain);
409
+  cmDspInst_t* cmp0_thr   = cmDspSysAllocScalar( h, "ThreshDb0", -100.0, 0.0, 0.1, cmpThreshDb);
410
+  cmDspInst_t* cmp0_rat   = cmDspSysAllocScalar( h, "Ratio0",    0.1, 100, 0.1, cmpRatio_num);
411
+  cmDspInst_t* cmp0_atk   = cmDspSysAllocScalar( h, "Atk Ms0",   0.0, 1000.0, 0.1, cmpAtkMs);
412
+  cmDspInst_t* cmp0_rls   = cmDspSysAllocScalar( h, "Rls Ms0",   0.0, 1000.0, 0.1, cmpRlsMs);
413
+  cmDspInst_t* cmp0_mkup  = cmDspSysAllocScalar( h, "Makeup0",   0.0, 10.0,   0.01, cmpMakeup);
414
+  cmDspInst_t* cmp0_wnd   = cmDspSysAllocScalar( h, "Wnd Ms0",   1.0, cmpWndMaxMs, 1.0, cmpWndMs );
415
+  cmDspInst_t* cmp0_mtr   = cmDspSysAllocInst(h,"Meter","Env0", 3, 0.0, 0.0, 1.0);
416
+
417
+  cmDspSysInstallCb(h, cmp0_byp,  "out", cmp0, "bypass", NULL );
418
+  cmDspSysInstallCb(h, cmp0_igain,"val", cmp0, "igain", NULL );
419
+  cmDspSysInstallCb(h, cmp0_thr,  "val", cmp0, "thr", NULL );
420
+  cmDspSysInstallCb(h, cmp0_rat,  "val", cmp0, "ratio", NULL );
421
+  cmDspSysInstallCb(h, cmp0_atk,  "val", cmp0, "atk", NULL );
422
+  cmDspSysInstallCb(h, cmp0_rls,  "val", cmp0, "rls", NULL );
423
+  cmDspSysInstallCb(h, cmp0_mkup, "val", cmp0, "ogain", NULL );
424
+  cmDspSysInstallCb(h, cmp0_wnd,  "val", cmp0, "wnd", NULL );
425
+  cmDspSysInstallCb(h, cmp0,      "env", cmp0_mtr, "in", NULL );
426
+
427
+  cmDspSysNewColumn(h,0);
428
+  cmDspInst_t* cmp1_byp   = cmDspSysAllocCheck(  h, "Bypass1", 1.0 );
429
+  cmDspInst_t* cmp1_igain = cmDspSysAllocScalar( h, "In Gain1",  0.0,   10.0, 0.1, cmpInGain);
430
+  cmDspInst_t* cmp1_thr   = cmDspSysAllocScalar( h, "ThreshDb1", -100.0, 0.0, 0.1, cmpThreshDb);
431
+  cmDspInst_t* cmp1_rat   = cmDspSysAllocScalar( h, "Ratio1",    0.1, 100, 0.1, cmpRatio_num);
432
+  cmDspInst_t* cmp1_atk   = cmDspSysAllocScalar( h, "Atk Ms1",   0.0, 1000.0, 0.1, cmpAtkMs);
433
+  cmDspInst_t* cmp1_rls   = cmDspSysAllocScalar( h, "Rls Ms1",   0.0, 1000.0, 0.1, cmpRlsMs);
434
+  cmDspInst_t* cmp1_mkup  = cmDspSysAllocScalar( h, "Makeup1",   0.0, 10.0,   0.01, cmpMakeup);
435
+  cmDspInst_t* cmp1_wnd   = cmDspSysAllocScalar( h, "Wnd Ms1",   1.0, cmpWndMaxMs, 1.0, cmpWndMs );
436
+  cmDspInst_t* cmp1_mtr   = cmDspSysAllocInst(h,"Meter","Env1", 3, 0.0, 0.0, 1.0);
437
+
438
+  cmDspSysInstallCb(h, cmp1_byp,  "out", cmp1, "bypass", NULL );
439
+  cmDspSysInstallCb(h, cmp1_igain,"val", cmp1, "igain", NULL );
440
+  cmDspSysInstallCb(h, cmp1_thr,  "val", cmp1, "thr", NULL );
441
+  cmDspSysInstallCb(h, cmp1_rat,  "val", cmp1, "ratio", NULL );
442
+  cmDspSysInstallCb(h, cmp1_atk,  "val", cmp1, "atk", NULL );
443
+  cmDspSysInstallCb(h, cmp1_rls,  "val", cmp1, "rls", NULL );
444
+  cmDspSysInstallCb(h, cmp1_mkup, "val", cmp1, "ogain", NULL );
445
+  cmDspSysInstallCb(h, cmp1_wnd,  "val", cmp1, "wnd", NULL );
446
+  cmDspSysInstallCb(h, cmp1,      "env", cmp1_mtr, "in", NULL );
289 447
 
290
-  cmDspSysInstallCb(h, sfp,      "dyn", srp, "val_in", NULL );
291
-  cmDspSysInstallCb(h, imin_dyn, "val", srp, "min_in",  NULL );
292
-  cmDspSysInstallCb(h, imax_dyn, "val", srp, "max_in",  NULL );
293
-  cmDspSysInstallCb(h, omin_dyn, "val", srp, "min_out", NULL );
294
-  cmDspSysInstallCb(h, omax_dyn, "val", srp, "max_out", NULL );
295
-  //cmDspSysInstallCb(h, srp, "val_out", th0p, "val", NULL );
296
-  //cmDspSysInstallCb(h, srp, "val_out", th1p, "val", NULL );
297
-
298
-  cmDspSysInstallCb(h, sfp,      "even", srp, "val_in", NULL );
299
-  cmDspSysInstallCb(h, imin_even, "val", srp, "min_in",  NULL );
300
-  cmDspSysInstallCb(h, imax_even, "val", srp, "max_in",  NULL );
301
-  cmDspSysInstallCb(h, omin_even, "val", srp, "min_out", NULL );
302
-  cmDspSysInstallCb(h, omax_even, "val", srp, "max_out", NULL );
303
-  //cmDspSysInstallCb(h, srp, "val_out", th0p, "val", NULL );
304
-  //cmDspSysInstallCb(h, srp, "val_out", th1p, "val", NULL );
305
-  
306
-  cmDspSysInstallCb(h, sfp,      "tempo", srp, "val_in", NULL );
307
-  cmDspSysInstallCb(h, imin_tempo, "val", srp, "min_in",  NULL );
308
-  cmDspSysInstallCb(h, imax_tempo, "val", srp, "max_in",  NULL );
309
-  cmDspSysInstallCb(h, omin_tempo, "val", srp, "min_out", NULL );
310
-  cmDspSysInstallCb(h, omax_tempo, "val", srp, "max_out", NULL );
311
-  //cmDspSysInstallCb(h, srp, "val_out", th0p, "val", NULL );
312
-  //cmDspSysInstallCb(h, srp, "val_out", th1p, "val", NULL );
313
-
314
-  cmDspSysInstallCb(h, sfp,      "cost", srp, "val_in", NULL );
315
-  cmDspSysInstallCb(h, imin_cost, "val", srp, "min_in",  NULL );
316
-  cmDspSysInstallCb(h, imax_cost, "val", srp, "max_in",  NULL );
317
-  cmDspSysInstallCb(h, omin_cost, "val", srp, "min_out", NULL );
318
-  cmDspSysInstallCb(h, omax_cost, "val", srp, "max_out", NULL );
319
-  //cmDspSysInstallCb(h, srp, "val_out", th0p, "val", NULL );
320
-  //cmDspSysInstallCb(h, srp, "val_out", th1p, "val", NULL );
321
-  
322 448
 
323 449
   return rc;
324 450
 }

Loading…
取消
儲存