Quellcode durchsuchen

Re-enabled performance measurement code. Replaced cmDspPgmKrChain.c with cmDspPgmKrChain2.c

master
kevin vor 6 Jahren
Ursprung
Commit
cffa6a6e45
8 geänderte Dateien mit 307 neuen und 36 gelöschten Zeilen
  1. 2
    2
      Makefile.am
  2. 6
    11
      cmProc4.c
  3. 1
    1
      dsp/cmDspKr.c
  4. 4
    4
      dsp/cmDspPgmKr.c
  5. 1
    1
      dsp/cmDspPgmKrChain.h
  6. 279
    0
      dsp/cmDspPgmKrChain2.c
  7. 8
    11
      dsp/cmDspPgmKrTimeLineLite.c
  8. 6
    6
      dsp/cmDspPgmKrTksb.c

+ 2
- 2
Makefile.am Datei anzeigen

@@ -57,8 +57,8 @@ cmSRC += src/libcm/dsp/cmDspStore.c src/libcm/dsp/cmDspBuiltIn.c  src/libcm/dsp/
57 57
 cmHDR += src/libcm/dsp/cmDspPgm.h src/libcm/dsp/cmDspPgmPP.h src/libcm/dsp/cmDspPgmPPMain.h
58 58
 cmSRC += src/libcm/dsp/cmDspPgm.c src/libcm/dsp/cmDspPgmPP.c src/libcm/dsp/cmDspPgmPPMain.c
59 59
 
60
-cmHDR +=  src/libcm/dsp/cmDspKr.h src/libcm/dsp/cmDspPgmKr.h  src/libcm/dsp/cmDspPgmKrChain.h 
61
-cmSRC +=  src/libcm/dsp/cmDspKr.c src/libcm/dsp/cmDspPgmKr.c  src/libcm/dsp/cmDspPgmKrChain.c src/libcm/dsp/cmDspPgmKrTksb.c src/libcm/dsp/cmDspPgmKrTimeLineLite.c
60
+cmHDR +=  src/libcm/dsp/cmDspKr.h src/libcm/dsp/cmDspPgmKr.h  src/libcm/dsp/cmDspPgmKrChain.h  
61
+cmSRC +=  src/libcm/dsp/cmDspKr.c src/libcm/dsp/cmDspPgmKr.c  src/libcm/dsp/cmDspPgmKrChain2.c src/libcm/dsp/cmDspPgmKrTksb.c src/libcm/dsp/cmDspPgmKrTimeLineLite.c
62 62
 
63 63
 cmHDR += src/libcm/cmAudDsp.h src/libcm/cmAudDspIF.h src/libcm/cmAudDspLocal.h
64 64
 cmSRC += src/libcm/cmAudDsp.c src/libcm/cmAudDspIF.c src/libcm/cmAudDspLocal.c

+ 6
- 11
cmProc4.c Datei anzeigen

@@ -1981,6 +1981,7 @@ typedef struct
1981 1981
   unsigned smpIdx;   // time of assoc'd MIDI event
1982 1982
   unsigned cnt;      // 
1983 1983
   double   val;      //
1984
+  unsigned pitch;
1984 1985
 } _cmScMeasTimeEle_t;
1985 1986
 
1986 1987
 typedef struct
@@ -2050,7 +2051,7 @@ unsigned _cmScMeasTimeAlign( cmScMeas* p, cmScMeasSet_t* sp, cmScMatchMidi_t* m,
2050 2051
         {
2051 2052
           a[j].smpIdx += m[i].smpIdx;
2052 2053
           a[j].cnt    += 1;
2053
-
2054
+          a[j].pitch   = m[i].pitch;
2054 2055
           if( a[j].cnt == 1 )
2055 2056
             matchN += 1;  // only cnt one match per sc loc.
2056 2057
           break;
@@ -2139,7 +2140,10 @@ double _cmScMeasEven( cmScMeas* p, cmScMeasSet_t* sp, cmScMatchMidi_t* m, unsign
2139 2140
   // calc avg. delta time
2140 2141
   double d_avg  = 0;
2141 2142
   for(i=0; i<bn-1; ++i)
2143
+  {
2142 2144
     d_avg  += b[i].val;
2145
+    //printf("loc:%i %f\n",b[i].scLocIdx,b[i].val);
2146
+  }
2143 2147
 
2144 2148
   d_avg /= (bn-1);
2145 2149
 
@@ -3360,27 +3364,18 @@ cmRC_t _cmScModExecCross( cmScModulator* p, cmScModEntry_t* ep )
3360 3364
 {
3361 3365
   cmRC_t rc = cmOkRC;
3362 3366
   double x  = 0.0;
3363
-  //double x0 = 0.0, x1 = 0.0;
3364 3367
   double y0 = 0.0, y1 = 0.0;
3365 3368
 
3366 3369
   if((rc = _cmScModGetCrossParam(p, ep, &ep->arg, "src var", &x )) != cmOkRC )
3367 3370
     return rc;
3368 3371
     
3369
-  //if((rc = _cmScModGetCrossParam(p, ep, &ep->beg, "src min", &x0 )) != cmOkRC )
3370
-  //  return rc;
3371
-
3372
-  //if((rc = _cmScModGetCrossParam(p, ep, &ep->end, "src max", &x1 )) != cmOkRC )
3373
-  //  return rc;
3374
-  
3375 3372
   if((rc = _cmScModGetCrossParam(p, ep, &ep->min, "dst min", &y0 )) != cmOkRC )
3376 3373
     return rc;
3377 3374
   
3378 3375
   if((rc = _cmScModGetCrossParam(p, ep, &ep->max, "dst max", &y1 )) != cmOkRC )
3379 3376
     return rc;
3380 3377
 
3381
-  //double xx = x0 + (x-x0) / (x1-x0);
3382
-
3383
-  printf("%s x:%f y0:%f y1:%f\n",__FUNCTION__,x,y0,y1);
3378
+  //printf("%s x:%f y0:%f y1:%f\n",__FUNCTION__,x,y0,y1);
3384 3379
   
3385 3380
   ep->varPtr->value =  y0 + x * (y1-y0);
3386 3381
 

+ 1
- 1
dsp/cmDspKr.c Datei anzeigen

@@ -1649,7 +1649,7 @@ cmDspRC_t _cmDspScModRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t*
1649 1649
   if( p->minInVarId <= evt->dstVarId && evt->dstVarId <= p->maxInVarId )
1650 1650
   {
1651 1651
     double v = cmDspDouble(inst,evt->dstVarId);
1652
-    printf("%s : %i %f\n",__FUNCTION__,evt->dstVarId,v);
1652
+    //printf("%s : %i %f\n",__FUNCTION__,evt->dstVarId,v);
1653 1653
     cmScModulatorSetValue( p->mp, p->inVarIdMap[ evt->dstVarId - p->inVarIdOffs ], v );
1654 1654
   }
1655 1655
   

+ 4
- 4
dsp/cmDspPgmKr.c Datei anzeigen

@@ -167,12 +167,12 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
167 167
   cmDspTlXform_t c0,c1,c2,c3;
168 168
 
169 169
   cmDspSysNewPage(h,"Controls-0");
170
-  _cmDspSys_TlXformChain(h, &c0, preGrpSymId, cmpPreGrpSymId, modp, 0, 0 );
170
+  _cmDspSys_TlXformChain(h, &c0, preGrpSymId, cmpPreGrpSymId, amp, modp, 0, 0 );
171 171
 
172 172
   if( useChain1Fl )
173 173
   {
174 174
     cmDspSysNewPage(h,"Controls-1");
175
-    _cmDspSys_TlXformChain(h, &c1, preGrpSymId, cmpPreGrpSymId, modp, 1, 1 );
175
+    _cmDspSys_TlXformChain(h, &c1, preGrpSymId, cmpPreGrpSymId, amp, modp, 1, 1 );
176 176
   }
177 177
 
178 178
   cmDspInst_t* mix0 = NULL;
@@ -181,10 +181,10 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
181 181
   if( fragFl )
182 182
   {
183 183
     cmDspSysNewPage(h,"Ctl-R/P-0");
184
-    _cmDspSys_TlXformChain(h, &c2, preGrpSymId, cmpPreGrpSymId, modr, 2, 0 );
184
+    _cmDspSys_TlXformChain(h, &c2, preGrpSymId, cmpPreGrpSymId, amp, modr, 2, 0 );
185 185
 
186 186
     cmDspSysNewPage(h,"Ctl-R/P-1");
187
-    _cmDspSys_TlXformChain(h, &c3, preGrpSymId, cmpPreGrpSymId, modr, 3, 1 );
187
+    _cmDspSys_TlXformChain(h, &c3, preGrpSymId, cmpPreGrpSymId, amp, modr, 3, 1 );
188 188
 
189 189
     mix0 = cmDspSysAllocInst(h,"AMix",        NULL,   3, 2, 1.0, 1.0 );
190 190
     mix1 = cmDspSysAllocInst(h,"AMix",        NULL,   3, 2, 1.0, 1.0 );

+ 1
- 1
dsp/cmDspPgmKrChain.h Datei anzeigen

@@ -31,7 +31,6 @@ typedef struct
31 31
   cmDspInst_t* kr0;  // audio input
32 32
   cmDspInst_t* kr1;
33 33
   cmDspInst_t* cmp;  // audio output
34
-  cmDspInst_t* even_ctl;
35 34
 } cmDspTlXform_t;
36 35
 
37 36
 
@@ -40,6 +39,7 @@ void _cmDspSys_TlXformChain(
40 39
   cmDspTlXform_t* c,
41 40
   unsigned        preGrpSymId,
42 41
   unsigned        cmpPreGrpSymId,
42
+  cmDspInst_t*    amp,
43 43
   cmDspInst_t*    modp,
44 44
   unsigned        ach,
45 45
   unsigned        mch );

+ 279
- 0
dsp/cmDspPgmKrChain2.c Datei anzeigen

@@ -0,0 +1,279 @@
1
+#include "cmPrefix.h"
2
+#include "cmGlobal.h"
3
+#include "cmFloatTypes.h"
4
+#include "cmRpt.h"
5
+#include "cmErr.h"
6
+#include "cmCtx.h"
7
+#include "cmMem.h"
8
+#include "cmMallocDebug.h"
9
+#include "cmLinkedHeap.h"
10
+#include "cmText.h"
11
+#include "cmFileSys.h"
12
+#include "cmSymTbl.h"
13
+#include "cmJson.h"
14
+#include "cmPrefs.h"
15
+#include "cmDspValue.h"
16
+#include "cmMsgProtocol.h"
17
+#include "cmThread.h"
18
+#include "cmUdpPort.h"
19
+#include "cmUdpNet.h"
20
+#include "cmTime.h"
21
+#include "cmAudioSys.h"
22
+#include "cmProcObj.h"
23
+#include "cmDspCtx.h"
24
+#include "cmDspClass.h"
25
+#include "cmDspSys.h"
26
+#include "cmDspPgm.h"
27
+
28
+
29
+#include "cmAudioFile.h"
30
+#include "cmProcObj.h"
31
+#include "cmProc.h"
32
+#include "cmProc3.h"
33
+
34
+#include "cmVectOpsTemplateMain.h"
35
+#include "cmVectOps.h"
36
+
37
+#include "cmDspPgmKrChain.h"
38
+
39
+#undef KR2
40
+
41
+
42
+cmDspRC_t krLoadRsrc(cmDspSysH_t h, cmErr_t* err, krRsrc_t* r)
43
+{
44
+  cmDspRC_t rc;
45
+  if((rc = cmDspSysLastRC(h)) != kOkDspRC )
46
+    return rc;
47
+
48
+  cmDspRsrcString(h,&r->tlFn,        "timeLineFn",   NULL);
49
+  cmDspRsrcString(h,&r->tlPrefixPath,"tlPrefixPath", NULL);
50
+  cmDspRsrcString(h,&r->scFn,        "scoreFn",      NULL);
51
+  cmDspRsrcString(h,&r->tksbFn,      "tksbFn",       NULL);
52
+  cmDspRsrcString(h,&r->modFn,       "modFn",        NULL);
53
+  cmDspRsrcString(h,&r->measFn,      "measFn",       NULL);
54
+  cmDspRsrcString(h,&r->recordDir,   "recordDir",    NULL);
55
+  cmDspRsrcString(h,&r->midiDevice,  "midiDevice",   NULL);
56
+  cmDspRsrcString(h,&r->midiOutPort, "midiOutPort",  NULL);
57
+  cmDspRsrcString(h,&r->midiOutPort2,"midiOutPort2", NULL);
58
+
59
+  if((rc = cmDspSysLastRC(h)) != kOkDspRC )
60
+    cmErrMsg(err,rc,"A KR DSP resource load failed.");
61
+    
62
+  return rc;
63
+}
64
+
65
+
66
+const cmChar_t* _mlbl(const cmChar_t* prefix, unsigned ch )
67
+{
68
+  static char s[128];
69
+  s[127]=0;
70
+  snprintf(s,127,"%s%i",prefix,ch);
71
+  return s;
72
+}
73
+
74
+#define mlbl(a)  _mlbl(a,mch)
75
+#define lbl(a) cmDspSysPrintLabel(a,ach)
76
+
77
+void _cmDspSys_TlXformChain( cmDspSysH_t h, cmDspTlXform_t* c,  unsigned preGrpSymId, unsigned cmpPreGrpSymId, cmDspInst_t* amp, cmDspInst_t* modp, unsigned ach, unsigned mch )
78
+{
79
+    
80
+  int             krWndSmpCnt = 2048;
81
+  int             krHopFact   = 4;
82
+
83
+  unsigned        xfadeChCnt  = 2;
84
+  double          xfadeMs     = 50;
85
+  bool            xfadeInitFl = true;
86
+  double          mixGain     = 1.0;
87
+
88
+  bool            cmpBypassFl  = false;
89
+  double          cmpInGain    = 3.0;
90
+  double          cmpThreshDb  = -40.0;
91
+  double          cmpRatio_num = 5.0;
92
+  double          cmpAtkMs     = 20.0;
93
+  double          cmpRlsMs     = 100.0;
94
+  double          cmpMakeup    = 1.0;
95
+  double          cmpWndMaxMs  = 1000.0;
96
+  double          cmpWndMs     = 200.0;
97
+
98
+
99
+  cmDspInst_t* achan = cmDspSysAllocInst(h, "AvailCh",     NULL, 1, xfadeChCnt );
100
+  
101
+
102
+ 
103
+  // Parameter-> kr routers (routers used to cross-fade between the two kr units)
104
+  unsigned paramRtChCnt = 2;
105
+  cmDspInst_t* wnd_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
106
+  cmDspInst_t* hop_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
107
+  cmDspInst_t* cel_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
108
+  cmDspInst_t* exp_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
109
+  cmDspInst_t* mix_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
110
+  cmDspInst_t* thr_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
111
+  cmDspInst_t* upr_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
112
+  cmDspInst_t* lwr_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
113
+  cmDspInst_t* wet_rt   = cmDspSysAllocInst(h, "Router",      NULL,  2,  paramRtChCnt, paramRtChCnt-1 );
114
+
115
+  // Audio processors
116
+  cmDspInst_t* kr0  = cmDspSysAllocInst(h, "Kr2",        NULL,   2, krWndSmpCnt, krHopFact );
117
+  cmDspInst_t* kr1  = cmDspSysAllocInst(h, "Kr2",        NULL,   2, krWndSmpCnt, krHopFact );
118
+  cmDspInst_t* xfad = cmDspSysAllocInst(h, "Xfader",     NULL,   3, xfadeChCnt,  xfadeMs, xfadeInitFl ); 
119
+  cmDspInst_t* mix  = cmDspSysAllocInst(h, "AMix",       NULL,   3, xfadeChCnt,  mixGain, mixGain );
120
+  cmDspInst_t* cmp  = cmDspSysAllocInst(h, "Compressor", NULL,   8, cmpBypassFl, cmpThreshDb, cmpRatio_num, cmpAtkMs, cmpRlsMs, cmpMakeup, cmpWndMs, cmpWndMaxMs ); 
121
+
122
+  // Internal audio connections
123
+  cmDspSysConnectAudio(h, kr0,  "out",   xfad, "in-0");
124
+  cmDspSysConnectAudio(h, kr1,  "out",   xfad, "in-1");
125
+  cmDspSysConnectAudio(h, xfad, "out-0", mix,  "in-0");
126
+  cmDspSysConnectAudio(h, xfad, "out-1", mix,  "in-1");
127
+  cmDspSysConnectAudio(h, mix,  "out",   cmp,  "in" );
128
+
129
+  // active channel <-> cross-fade connections
130
+  cmDspSysInstallCb(h, achan,  "reset",   xfad, "reset", NULL);
131
+  cmDspSysInstallCb(h, achan,  "gate-0",  xfad, "gate-0", NULL );
132
+  cmDspSysInstallCb(h, achan,  "gate-1",  xfad, "gate-1", NULL );
133
+  cmDspSysInstallCb(h, xfad,   "state-0", achan, "dis-0",  NULL );
134
+  cmDspSysInstallCb(h, xfad,   "state-1", achan, "dis-1",  NULL );
135
+
136
+  
137
+  //  Measurement Number Controls
138
+  cmDspInst_t* val_dynm_ctl   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Dynm Meas"),       0.0, 10.0, 1.0, 1.0);  
139
+  cmDspInst_t* val_even_ctl   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Even Meas"),      0.0, 3.0, 0.001, 0.5);  
140
+  cmDspInst_t* val_tmpo_ctl   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Tempo Meas"),     0.0, 200.0, 1.0, 100.0);  
141
+  cmDspInst_t* val_cost_ctl   = cmDspSysAllocScalarP( h,preGrpSymId, NULL, lbl("Cost Meas"),        0.0, 1.0, 0.01, 0.5);  
142
+
143
+  // active measure to measurement UI controls
144
+  cmDspSysInstallCb(h, amp,          "dyn",    val_dynm_ctl,  "val", NULL );
145
+  cmDspSysInstallCb(h, amp,          "even",    val_even_ctl,  "val", NULL );
146
+  cmDspSysInstallCb(h, amp,          "tempo",   val_tmpo_ctl,  "val", NULL );
147
+  cmDspSysInstallCb(h, amp,          "cost",    val_cost_ctl,  "val", NULL );
148
+
149
+  // measurement UI controls to scMod
150
+  cmDspSysInstallCb(h, val_dynm_ctl, "val",     modp, "dyn",  NULL );  
151
+  cmDspSysInstallCb(h, val_even_ctl, "val",     modp, "even",  NULL );  
152
+  cmDspSysInstallCb(h, val_tmpo_ctl, "val",     modp, "tempo", NULL );
153
+  cmDspSysInstallCb(h, val_cost_ctl, "val",     modp, "cost",  NULL );
154
+
155
+  
156
+  // Parameter number controls 
157
+  cmDspSysNewColumn(h,0);
158
+  cmDspInst_t* wnd_ctl = cmDspSysAllocMsgListP(h,preGrpSymId,NULL, lbl("WndSmpCnt"), NULL, "wndSmpCnt", 2);
159
+  cmDspInst_t* hop_ctl = cmDspSysAllocMsgListP(h,preGrpSymId,NULL, lbl("HopFact"),   NULL, "hopFact",   2);
160
+  cmDspInst_t* cel_ctl = cmDspSysAllocScalarP( h,preGrpSymId,NULL, lbl("Ceiling"),   0.0, 100.0, 0.1,  30.0 );
161
+  cmDspInst_t* exp_ctl = cmDspSysAllocScalarP( h,preGrpSymId,NULL, lbl("Expo"),    -10.0,  10.0, 0.01,  2.0 );
162
+  cmDspInst_t* mix_ctl = cmDspSysAllocScalarP( h,preGrpSymId,NULL, lbl("Mix"),       0.0,   1.0, 0.01,  0.0 );    
163
+  cmDspInst_t* thr_ctl = cmDspSysAllocScalarP( h,preGrpSymId,NULL, lbl("Threshold"), 0.0, 100.0, 1.0,  60.0 );
164
+  cmDspInst_t* upr_ctl = cmDspSysAllocScalarP( h,preGrpSymId,NULL, lbl("Upr slope"), 0.0,  10.0, 0.01,  0.0 ); 
165
+  cmDspInst_t* lwr_ctl = cmDspSysAllocScalarP( h,preGrpSymId,NULL, lbl("Lwr slope"), 0.3,  10.0, 0.01,  2.0 );
166
+  cmDspInst_t* wet_ctl = cmDspSysAllocScalarP( h,preGrpSymId,NULL, lbl("Wet Dry"),   0.0,   1.0, 0.001, 1.0 );
167
+
168
+  
169
+  cmDspSysInstallCb(h, wnd_ctl, "out",         wnd_rt, "f-in",    NULL );
170
+  cmDspSysInstallCb(h, achan,   "ch",          wnd_rt, "sel",     NULL );   // ach->rt sel
171
+  cmDspSysInstallCb(h, wnd_rt,  "f-out-0",     kr0,    "wndn",    NULL );   // wndn->kr
172
+  cmDspSysInstallCb(h, wnd_rt,  "f-out-1",     kr1,    "wndn",    NULL );   // wndn->kr
173
+
174
+  cmDspSysInstallCb(h, hop_ctl, "out",         hop_rt, "f-in",    NULL );
175
+  cmDspSysInstallCb(h, achan,   "ch",          hop_rt, "sel",     NULL );   // ach->rt sel
176
+  cmDspSysInstallCb(h, hop_rt,  "f-out-0",     kr0,    "hopf",    NULL );   // hopf->kr
177
+  cmDspSysInstallCb(h, hop_rt,  "f-out-1",     kr1,    "hopf",    NULL );   // hopf->kr
178
+  
179
+  cmDspSysInstallCb(h, thr_ctl,     "val",     thr_rt, "f-in",    NULL );
180
+  cmDspSysInstallCb(h, achan,       "ch",      thr_rt, "sel",     NULL );   // ach->rt sel
181
+  cmDspSysInstallCb(h, thr_rt,      "f-out-0", kr0,    "thrh",    NULL );   // thr->kr
182
+  cmDspSysInstallCb(h, thr_rt,      "f-out-1", kr1,    "thrh",    NULL );   // thr->kr
183
+
184
+  cmDspSysInstallCb(h, upr_ctl,     "val",     upr_rt, "f-in",    NULL );
185
+  cmDspSysInstallCb(h, achan,       "ch",      upr_rt, "sel",     NULL );   // ach->rt sel
186
+  cmDspSysInstallCb(h, upr_rt,      "f-out-0", kr0,    "uprs",    NULL );   // upr->kr
187
+  cmDspSysInstallCb(h, upr_rt,      "f-out-1", kr1,    "uprs",    NULL );   // upr->kr
188
+
189
+  cmDspSysInstallCb(h, lwr_ctl,     "val",     lwr_rt, "f-in",    NULL );
190
+  cmDspSysInstallCb(h, achan,       "ch",      lwr_rt, "sel",     NULL );   // ach->rt sel
191
+  cmDspSysInstallCb(h, lwr_rt,      "f-out-0", kr0,    "lwrs",    NULL );   // lwr->kr
192
+  cmDspSysInstallCb(h, lwr_rt,      "f-out-1", kr1,    "lwrs",    NULL );   // lwr->kr
193
+  
194
+  cmDspSysInstallCb(h, wet_ctl,     "val",     wet_rt, "f-in",    NULL );
195
+  cmDspSysInstallCb(h, achan,       "ch",      wet_rt, "sel",     NULL );   // ach->rt sel
196
+  cmDspSysInstallCb(h, wet_rt,      "f-out-0", kr0,    "wet",     NULL );   // wet->kr
197
+  cmDspSysInstallCb(h, wet_rt,      "f-out-1", kr1,    "wet",     NULL );   // wet->kr
198
+
199
+  cmDspSysInstallCb(h, cel_ctl,     "val",     cel_rt, "f-in",    NULL );
200
+  cmDspSysInstallCb(h, achan,       "ch",      cel_rt, "sel",     NULL );   // ach->rt sel
201
+  cmDspSysInstallCb(h, cel_rt,      "f-out-0", kr0,    "ceil",    NULL );   // cel->kr
202
+  cmDspSysInstallCb(h, cel_rt,      "f-out-1", kr1,    "ceil",    NULL );   // cel->kr
203
+
204
+  cmDspSysInstallCb(h, exp_ctl,     "val",     exp_rt, "f-in",    NULL );
205
+  cmDspSysInstallCb(h, achan,       "ch",      exp_rt, "sel",     NULL );   // ach->rt sel
206
+  cmDspSysInstallCb(h, exp_rt,      "f-out-0", kr0,    "expo",    NULL );   // exp->kr
207
+  cmDspSysInstallCb(h, exp_rt,      "f-out-1", kr1,    "expo",    NULL );   // exp->kr
208
+
209
+  cmDspSysInstallCb(h, mix_ctl,     "val",     mix_rt, "f-in",    NULL );
210
+  cmDspSysInstallCb(h, achan,       "ch",      mix_rt, "sel",     NULL );   // ach->rt sel
211
+  cmDspSysInstallCb(h, mix_rt,      "f-out-0", kr0,    "mix",    NULL );   // mix->kr
212
+  cmDspSysInstallCb(h, mix_rt,      "f-out-1", kr1,    "mix",    NULL );   // mix->kr
213
+  
214
+  
215
+
216
+  cmDspSysNewColumn(h,0);
217
+  cmDspInst_t* cmp_byp   = cmDspSysAllocCheckP(  h, cmpPreGrpSymId, NULL, lbl("Bypass"), 1.0 );
218
+  cmDspInst_t* cmp_igain = cmDspSysAllocScalarP( h, cmpPreGrpSymId, NULL, lbl("In Gain"),  0.0,   10.0, 0.1, cmpInGain);
219
+  cmDspInst_t* cmp_thr   = cmDspSysAllocScalarP( h, cmpPreGrpSymId, NULL, lbl("ThreshDb"), -100.0, 0.0, 0.1, cmpThreshDb);
220
+  cmDspInst_t* cmp_rat   = cmDspSysAllocScalarP( h, cmpPreGrpSymId, NULL, lbl("Ratio"),    0.1, 100, 0.1, cmpRatio_num);
221
+  cmDspInst_t* cmp_atk   = cmDspSysAllocScalarP( h, cmpPreGrpSymId, NULL, lbl("Atk Ms"),   0.0, 1000.0, 0.1, cmpAtkMs);
222
+  cmDspInst_t* cmp_rls   = cmDspSysAllocScalarP( h, cmpPreGrpSymId, NULL, lbl("Rls Ms"),   0.0, 1000.0, 0.1, cmpRlsMs);
223
+  cmDspInst_t* cmp_mkup  = cmDspSysAllocScalarP( h, cmpPreGrpSymId, NULL, lbl("Makeup"),   0.0, 10.0,   0.01, cmpMakeup);
224
+  cmDspInst_t* cmp_wnd   = cmDspSysAllocScalarP( h, cmpPreGrpSymId, NULL, lbl("Wnd Ms"),   1.0, cmpWndMaxMs, 1.0, cmpWndMs );
225
+  cmDspInst_t* cmp_mtr   = cmDspSysAllocInst(h,"Meter",lbl("Env"), 3, 0.0, 0.0, 1.0);
226
+
227
+  cmDspSysInstallCb(h, cmp_byp,  "out", cmp, "bypass", NULL );
228
+  cmDspSysInstallCb(h, cmp_igain,"val", cmp, "igain", NULL );
229
+  cmDspSysInstallCb(h, cmp_thr,  "val", cmp, "thr", NULL );
230
+  cmDspSysInstallCb(h, cmp_rat,  "val", cmp, "ratio", NULL );
231
+  cmDspSysInstallCb(h, cmp_atk,  "val", cmp, "atk", NULL );
232
+  cmDspSysInstallCb(h, cmp_rls,  "val", cmp, "rls", NULL );
233
+  cmDspSysInstallCb(h, cmp_mkup, "val", cmp, "ogain", NULL );
234
+  cmDspSysInstallCb(h, cmp_wnd,  "val", cmp, "wnd", NULL );
235
+  cmDspSysInstallCb(h, cmp,      "env", cmp_mtr, "in", NULL );
236
+
237
+  cmDspSysInstallCb(h, modp, mlbl("cbyp"),    cmp_byp,  "in", NULL );
238
+  cmDspSysInstallCb(h, modp, mlbl("cigain"),  cmp_igain,"val", NULL );
239
+  cmDspSysInstallCb(h, modp, mlbl("cthrsh"),  cmp_thr,  "val", NULL );
240
+  cmDspSysInstallCb(h, modp, mlbl("cratio"),  cmp_rat,  "val", NULL );
241
+  cmDspSysInstallCb(h, modp, mlbl("catkms"),  cmp_atk,  "val", NULL );
242
+  cmDspSysInstallCb(h, modp, mlbl("crlsms"),  cmp_rls,  "val", NULL );
243
+  cmDspSysInstallCb(h, modp, mlbl("cmakeup"), cmp_mkup, "val", NULL );
244
+  cmDspSysInstallCb(h, modp, mlbl("cwndms"),  cmp_wnd,  "val", NULL );
245
+
246
+  // 
247
+  cmDspInst_t* xfadMs = cmDspSysAllocInst(h,"Scalar", lbl("Xfade Ms"),     5, kNumberDuiId, 0.0,   1000.0,0.01, 50.0 );  
248
+  cmDspSysInstallCb(h, xfadMs, "val", xfad, "ms", NULL );
249
+  cmDspSysInstallCb(h, modp, mlbl("xfad"), xfadMs,  "val", NULL);
250
+
251
+  //cmDspInst_t* sw_btn = cmDspSysAllocButton( h, lbl("switch"), 0);
252
+  //cmDspSysInstallCb( h, sw_btn, "sym",  achan, "trig", NULL ); 
253
+
254
+  
255
+  
256
+  // TODO: FIX THIS: can't send window length (e.g. 1024,2048, ... ) to a 'MsgList' with 4 elements
257
+  // since it expects an index betweeen 0 and 3.  CRASH!
258
+  //cmDspSysInstallCb(h, modp, mlbl("win"),  wnd_ctl, "sel",  NULL );
259
+
260
+  
261
+  cmDspSysInstallCb(h, modp, mlbl("hop"),  hop_ctl, "sel", NULL );
262
+  cmDspSysInstallCb(h, modp, mlbl("ceil"), cel_ctl, "val", NULL );
263
+  cmDspSysInstallCb(h, modp, mlbl("expo"), exp_ctl, "val", NULL );
264
+  cmDspSysInstallCb(h, modp, mlbl("mix"),  mix_ctl, "val", NULL );
265
+  cmDspSysInstallCb(h, modp, mlbl("thr"),  thr_ctl, "val", NULL );
266
+  cmDspSysInstallCb(h, modp, mlbl("upr"),  upr_ctl, "val", NULL );
267
+  cmDspSysInstallCb(h, modp, mlbl("lwr"),  lwr_ctl, "val", NULL );
268
+  cmDspSysInstallCb(h, modp, mlbl("wet"),  wet_ctl, "val", NULL );
269
+  cmDspSysInstallCb(h, modp, mlbl("sw"),   achan,       "trig", NULL ); // See also: amp.sfloc->achan.trig
270
+
271
+  
272
+  c->achan = achan; 
273
+  c->kr0   = kr0; 
274
+  c->kr1   = kr1;
275
+  c->cmp   = cmp;
276
+
277
+}
278
+
279
+

+ 8
- 11
dsp/cmDspPgmKrTimeLineLite.c Datei anzeigen

@@ -58,8 +58,6 @@ cmDspRC_t _cmDspSysPgm_TimeLineLite(cmDspSysH_t h, void** userPtrPtr )
58 58
   if( krLoadRsrc(h,&err,&r) != kOkDspRC )
59 59
     return rc;
60 60
 
61
-  
62
-
63 61
   cmDspInst_t* ai0 = cmDspSysAllocInst(h,"AudioIn",     NULL,  1, 0);
64 62
   cmDspInst_t* ai1 = cmDspSysAllocInst(h,"AudioIn",     NULL,  1, 1);
65 63
   //cmDspInst_t* mip = cmDspSysAllocInst(h,"MidiIn",      NULL,  2, "MOTU - Traveler mk3", "MIDI Port");
@@ -83,16 +81,16 @@ cmDspRC_t _cmDspSysPgm_TimeLineLite(cmDspSysH_t h, void** userPtrPtr )
83 81
   cmDspTlXform_t c0,c1;
84 82
 
85 83
   cmDspSysNewPage(h,"Controls-0");
86
-  _cmDspSys_TlXformChain(h, &c0, preGrpSymId, cmpPreGrpSymId, modp, 0, 0 );
84
+  _cmDspSys_TlXformChain(h, &c0, preGrpSymId, cmpPreGrpSymId, amp, modp, 0, 0 );
87 85
 
88 86
   cmDspSysNewPage(h,"Controls-1");
89
-  _cmDspSys_TlXformChain(h, &c1, preGrpSymId, cmpPreGrpSymId, modp, 1, 1 );
87
+  _cmDspSys_TlXformChain(h, &c1, preGrpSymId, cmpPreGrpSymId, amp, modp, 1, 1 );
90 88
 
91 89
 
92 90
   cmDspInst_t* ao0 = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 4 ); // 4 Piano     1 Output
93 91
   cmDspInst_t* ao1 = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 5 ); // 5          2
94
-  cmDspInst_t* ao2 = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 0 ); // 2 Transform 1 OUtput
95
-  cmDspInst_t* ao3 = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 1 ); // 3          2
92
+  cmDspInst_t* ao2 = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 2 ); // 2 Transform 1 OUtput
93
+  cmDspInst_t* ao3 = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 3 ); // 3          2
96 94
 
97 95
   cmDspSysNewPage(h,"Main");
98 96
   cmDspInst_t* onb     = cmDspSysAllocInst(h,"Button", "start",   2, kButtonDuiId, 1.0 );
@@ -202,15 +200,14 @@ cmDspRC_t _cmDspSysPgm_TimeLineLite(cmDspSysH_t h, void** userPtrPtr )
202 200
   // *****
203 201
 
204 202
   // active measure loc to xfad channel trigger
205
- 
203
+  /*
206 204
   cmDspSysInstallCb( h, amp,       "scloc",c0.achan, "trig", NULL );  // See Also: modp.sw ->achan.trig
207 205
   cmDspSysInstallCb( h, amp,       "scloc",c1.achan, "trig", NULL );
208 206
   cmDspSysInstallCb( h, recallBtn, "sym",  c0.achan, "trig", NULL ); 
209 207
   cmDspSysInstallCb( h, recallBtn, "sym",  c1.achan, "trig", NULL );
208
+  */
210 209
   
211 210
   cmDspSysInstallCb( h, amp,    "even",   pre,        "in",   NULL );  // active meas output to printers
212
-  //cmDspSysInstallCb( h, amp,    "even",   c0.even_ctl,  "val",   NULL );  
213
-  //cmDspSysInstallCb( h, amp,    "even",   c1.even_ctl,  "val",   NULL );
214 211
   cmDspSysInstallCb( h, amp,    "even",   modp,       "even", NULL );
215 212
 
216 213
   cmDspSysInstallCb( h, amp,    "dyn",    prd,        "in",   NULL );
@@ -304,8 +301,8 @@ cmDspRC_t _cmDspSysPgm_TimeLineLite(cmDspSysH_t h, void** userPtrPtr )
304 301
   cmDspSysInstallCb(h, modp, "wgain0",  ogain2, "val",  NULL );
305 302
   cmDspSysInstallCb(h, modp, "wgain1",  ogain3, "val",  NULL );
306 303
 
307
-  //cmDspSysInstallCb(h, ogain0, "val", ao0, "gain", NULL );   // output gain control - dry 0
308
-  //cmDspSysInstallCb(h, ogain1, "val", ao1, "gain", NULL );   //                       dry 1
304
+  cmDspSysInstallCb(h, ogain0, "val", ao0, "gain", NULL );   // output gain control - dry 0
305
+  cmDspSysInstallCb(h, ogain1, "val", ao1, "gain", NULL );   //                       dry 1
309 306
   cmDspSysInstallCb(h, ogain2, "val", ao2, "gain", NULL );   //                       wet 0
310 307
   cmDspSysInstallCb(h, ogain3, "val", ao3, "gain", NULL );   //                       wet 1
311 308
 

+ 6
- 6
dsp/cmDspPgmKrTksb.c Datei anzeigen

@@ -162,12 +162,12 @@ cmDspRC_t _cmDspSysPgm_Tksb(cmDspSysH_t h, void** userPtrPtr )
162 162
   cmDspTlXform_t c0,c1,c2,c3;
163 163
 
164 164
   cmDspSysNewPage(h,"Controls-0");
165
-  _cmDspSys_TlXformChain(h, &c0, preGrpSymId, cmpPreGrpSymId, modp, 0, 0 );
165
+  _cmDspSys_TlXformChain(h, &c0, preGrpSymId, cmpPreGrpSymId, amp, modp, 0, 0 );
166 166
 
167 167
   if( useChain1Fl )
168 168
   {
169 169
     cmDspSysNewPage(h,"Controls-1");
170
-    _cmDspSys_TlXformChain(h, &c1, preGrpSymId, cmpPreGrpSymId, modp, 1, 1 );
170
+    _cmDspSys_TlXformChain(h, &c1, preGrpSymId, cmpPreGrpSymId, amp, modp, 1, 1 );
171 171
   }
172 172
 
173 173
   cmDspInst_t* mix0 = NULL;
@@ -176,10 +176,10 @@ cmDspRC_t _cmDspSysPgm_Tksb(cmDspSysH_t h, void** userPtrPtr )
176 176
   if( fragFl )
177 177
   {
178 178
     cmDspSysNewPage(h,"Ctl-R/P-0");
179
-    _cmDspSys_TlXformChain(h, &c2, preGrpSymId, cmpPreGrpSymId, modr, 2, 0 );
179
+    _cmDspSys_TlXformChain(h, &c2, preGrpSymId, cmpPreGrpSymId, amp, modr, 2, 0 );
180 180
 
181 181
     cmDspSysNewPage(h,"Ctl-R/P-1");
182
-    _cmDspSys_TlXformChain(h, &c3, preGrpSymId, cmpPreGrpSymId, modr, 3, 1 );
182
+    _cmDspSys_TlXformChain(h, &c3, preGrpSymId, cmpPreGrpSymId, amp, modr, 3, 1 );
183 183
 
184 184
     mix0 = cmDspSysAllocInst(h,"AMix",        NULL,   3, 2, 1.0, 1.0 );
185 185
     mix1 = cmDspSysAllocInst(h,"AMix",        NULL,   3, 2, 1.0, 1.0 );
@@ -920,9 +920,9 @@ cmDspRC_t _cmDspSysPgm_TksbLite(cmDspSysH_t h, void** userPtrPtr )
920 920
   cmDspTlXform_t c0,c1;
921 921
 
922 922
   cmDspSysNewPage(h,"Controls-0");
923
-  _cmDspSys_TlXformChain(h, &c0, preGrpSymId, cmpPreGrpSymId, modp, 0, 0 );
923
+  _cmDspSys_TlXformChain(h, &c0, preGrpSymId, cmpPreGrpSymId, NULL, modp, 0, 0 );
924 924
   cmDspSysNewPage(h,"Controls-1");
925
-  _cmDspSys_TlXformChain(h, &c1, preGrpSymId, cmpPreGrpSymId, modp, 1, 1 );
925
+  _cmDspSys_TlXformChain(h, &c1, preGrpSymId, cmpPreGrpSymId, NULL, modp, 1, 1 );
926 926
 
927 927
 
928 928
   cmDspInst_t* ao0p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 2 );

Laden…
Abbrechen
Speichern