Pārlūkot izejas kodu

Merge branch 'master' of gitea.larke.org:klarke/libcm

master
kevin 4 gadus atpakaļ
vecāks
revīzija
2eb0fd0f60
5 mainītis faili ar 427 papildinājumiem un 67 dzēšanām
  1. 1
    1
      Makefile.am
  2. 59
    58
      dsp/cmDspPgm.c
  3. 1
    0
      dsp/cmDspPgmKr.h
  4. 13
    8
      dsp/cmDspPgmKrTimeLineLite.c
  5. 353
    0
      dsp/cmDspPgmKrTimeLineLiteAf.c

+ 1
- 1
Makefile.am Parādīt failu

@@ -61,7 +61,7 @@ cmHDR += src/libcm/dsp/cmDspPgm.h src/libcm/dsp/cmDspPgmPP.h src/libcm/dsp/cmDsp
61 61
 cmSRC += src/libcm/dsp/cmDspPgm.c src/libcm/dsp/cmDspPgmPP.c src/libcm/dsp/cmDspPgmPPMain.c
62 62
 
63 63
 cmHDR +=  src/libcm/dsp/cmDspKr.h src/libcm/dsp/cmDspPgmKr.h  src/libcm/dsp/cmDspPgmKrChain.h  
64
-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
64
+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 src/libcm/dsp/cmDspPgmKrTimeLineLiteAf.c
65 65
 
66 66
 cmHDR += src/libcm/cmAudDsp.h src/libcm/cmAudDspIF.h src/libcm/cmAudDspLocal.h
67 67
 cmSRC += src/libcm/cmAudDsp.c src/libcm/cmAudDspIF.c src/libcm/cmAudDspLocal.c

+ 59
- 58
dsp/cmDspPgm.c Parādīt failu

@@ -529,7 +529,7 @@ cmDspRC_t _cmDspSysPgm_Stereo_Fx( cmDspSysH_t h, void** userPtrPtr )
529 529
 //( { label:cmDspPgm_PlaySine file_desc:"Play a sine signal." kw:[spgm] }
530 530
 cmDspRC_t _cmDspSysPgm_PlaySine( cmDspSysH_t h, void** userPtrPtr )
531 531
 {
532
-  bool useBuiltInFl = false;
532
+  bool useBuiltInFl = true;
533 533
   double frqHz = 440.0;
534 534
 
535 535
   cmDspInst_t* chp = cmDspSysAllocInst( h,"Scalar", "Channel",  5, kNumberDuiId, 0.0,  100.0, 1.0,  0.0);
@@ -3273,63 +3273,64 @@ cmDspRC_t _cmDspSysPgm_BinEnc( cmDspSysH_t h, void** userPtrPtr )
3273 3273
 //(
3274 3274
 _cmDspSysPgm_t _cmDspSysPgmArray[] = 
3275 3275
 {
3276
-  { "reflect",       _cmDspSysPgm_ReflectCalc,  NULL, NULL },
3277
-  { "tksblite",      _cmDspSysPgm_TksbLite,     NULL, NULL }, 
3278
-  { "tksb",          _cmDspSysPgm_Tksb,         NULL, NULL },
3279
-  { "time_line",     _cmDspSysPgm_TimeLine,     NULL, NULL },
3280
-  { "time_line_lite",_cmDspSysPgm_TimeLineLite, NULL, NULL },  
3281
-  { "seq-bldr",      _cmDspSysPgm_TakeSeqBldr,  NULL, NULL },
3282
-  { "multi-out",     _cmDspSysPgm_MultiOut,     NULL, NULL },
3283
-  { "multi-in",      _cmDspSysPgm_MultiIn,     NULL, NULL },
3284
-  { "goertzel",      _cmDspSysPgm_Goertzel,     NULL, NULL },
3285
-  { "main",          _cmDspSysPgm_Main,         NULL, NULL },
3286
-  { "array",         _cmDspSysPgm_Array,        NULL, NULL },
3287
-  { "line",          _cmDspSysPgm_Line,         NULL, NULL },
3288
-  { "1Up",           _cmDspSysPgm_1Up,          NULL, NULL },
3289
-  { "PortToSym",     _cmDspSysPgm_PortToSym,    NULL, NULL },
3290
-  { "preset",        _cmDspSysPgm_Preset,       NULL, NULL },
3291
-  { "rsrcWr",        _cmDspSysPgm_RsrcWr,       NULL, NULL },
3292
-  { "router",        _cmDspSysPgm_Router,       NULL, NULL },
3293
-  { "1ofN",          _cmDspSysPgm_1ofN,         NULL, NULL },
3294
-  { "NofM",          _cmDspSysPgm_NofM,         NULL, NULL },
3295
-  { "whirl_net",     _cmDspSysPgm_WhirlNet,     NULL, NULL },
3296
-  { "thunk_net",     _cmDspSysPgm_ThunkNet,     NULL, NULL },
3297
-  { "seq",           _cmDspSysPgm_Seq,          NULL, NULL },
3298
-  { "dist_ds",       _cmDspSysPgm_DistDs,       NULL, NULL },
3299
-  { "bi_quad_eq",    _cmDspSysPgm_BiQuadEq,     NULL, NULL },
3300
-  { "compressor",    _cmDspSysPgm_Compressor,   NULL, NULL },
3301
-  { "adsr",          _cmDspSysPgm_Adsr,         NULL, NULL },
3302
-  { "msg delay",     _cmDspSysPgm_MsgDelay,     NULL, NULL },
3303
-  { "pickup rmod2",  _cmDspSysPgm_RingMod2,     NULL, NULL },
3304
-  { "pickup rmod",  _cmDspSysPgm_RingMod,       NULL, NULL },
3305
-  { "pickup tails", _cmDspSysPgm_NoiseTails,    NULL, NULL },
3306
-  { "tails_2",      _cmDspSysPgm_NoiseTails2,   NULL, NULL },
3307
-  { "pickups",     _cmDspSysPgm_Pickups0,       NULL, NULL },
3308
-  { "sync_recd",   _cmDspSysPgm_SyncRecd,       NULL, NULL },
3309
-  { "midi_test",   _cmDspSysPgm_Test_Midi,      NULL, NULL },
3310
-  { "pedal_test",  _cmDspSysPgm_Test_Pedals,    NULL, NULL },
3311
-  { "midi_file",   _cmDspSysPgm_MidiFilePlay,   NULL, NULL },
3312
-  { "2_thru",      _cmDspSysPgm_Stereo_Through, NULL, NULL },
3313
-  { "all_in_out",  _cmDspSysPgm_All_In_And_Out, NULL, NULL },
3314
-  { "guitar",      _cmDspSysPgmGuitar,          NULL, NULL },
3315
-  { "2_fx",        _cmDspSysPgm_Stereo_Fx,      NULL, NULL },
3316
-  { "sine",        _cmDspSysPgm_PlaySine,       NULL, NULL },
3317
-  { "file",        _cmDspSysPgm_PlayFile,       NULL, NULL },
3318
-  { "gate_detect", _cmDspSysPgm_GateDetect,     NULL, NULL },
3319
-  { "rt_record",   _cmDspSysPgm_RtRecord,       NULL, NULL },
3320
-  { "record",      _cmDspSysPgm_Record,         NULL, NULL },
3321
-  { "pitch_shift", _cmDspSysPgm_PitchShiftFile, NULL, NULL },
3322
-  { "loop_recd",   _cmDspSysPgm_LoopRecd,       NULL, NULL },
3323
-  { "ui_test",     _cmDspSysPgm_UiTest,         NULL, NULL },
3324
-  { "xfade_test",  _cmDspSysPgm_Xfade,          NULL, NULL },
3325
-  { "auto_gain",   _cmDspSysPgm_AutoGain,       NULL, NULL },
3326
-  { "comb filt",   _cmDspSysPgm_CombFilt,       NULL, NULL },
3327
-  { "scalar op",   _cmDspSysPgm_ScalarOp,       NULL, NULL },
3328
-  { "seg_line",    _cmDspSysPgm_SegLine,        NULL, NULL },
3329
-  { "avail_ch",    _cmDspSysPgm_AvailCh,        NULL, NULL },
3330
-  { "two-d",         _cmDspSysPgm_TwoD,         NULL, NULL },
3331
-  { "bin-enc",       _cmDspSysPgm_BinEnc,       NULL, NULL },
3332
-  { NULL , NULL, NULL, NULL }
3276
+  { "reflect",           _cmDspSysPgm_ReflectCalc,    NULL, NULL },
3277
+  { "tksblite",          _cmDspSysPgm_TksbLite,       NULL, NULL }, 
3278
+  { "tksb",              _cmDspSysPgm_Tksb,           NULL, NULL },
3279
+  { "time_line",         _cmDspSysPgm_TimeLine,       NULL, NULL },
3280
+  { "time_line_lite",    _cmDspSysPgm_TimeLineLite,   NULL, NULL },
3281
+  { "time_line_lite_af", _cmDspSysPgm_TimeLineLiteAf, NULL, NULL },
3282
+  { "seq-bldr",          _cmDspSysPgm_TakeSeqBldr,    NULL, NULL },
3283
+  { "multi-out",         _cmDspSysPgm_MultiOut,       NULL, NULL },
3284
+  { "multi-in",          _cmDspSysPgm_MultiIn,        NULL, NULL },
3285
+  { "goertzel",          _cmDspSysPgm_Goertzel,       NULL, NULL },
3286
+  { "main",              _cmDspSysPgm_Main,           NULL, NULL },
3287
+  { "array",             _cmDspSysPgm_Array,          NULL, NULL },
3288
+  { "line",              _cmDspSysPgm_Line,           NULL, NULL },
3289
+  { "1Up",               _cmDspSysPgm_1Up,            NULL, NULL },
3290
+  { "PortToSym",         _cmDspSysPgm_PortToSym,      NULL, NULL },
3291
+  { "preset",            _cmDspSysPgm_Preset,         NULL, NULL },
3292
+  { "rsrcWr",            _cmDspSysPgm_RsrcWr,         NULL, NULL },
3293
+  { "router",            _cmDspSysPgm_Router,         NULL, NULL },
3294
+  { "1ofN",              _cmDspSysPgm_1ofN,           NULL, NULL },
3295
+  { "NofM",              _cmDspSysPgm_NofM,           NULL, NULL },
3296
+  { "whirl_net",         _cmDspSysPgm_WhirlNet,       NULL, NULL },
3297
+  { "thunk_net",         _cmDspSysPgm_ThunkNet,       NULL, NULL },
3298
+  { "seq",               _cmDspSysPgm_Seq,            NULL, NULL },
3299
+  { "dist_ds",           _cmDspSysPgm_DistDs,         NULL, NULL },
3300
+  { "bi_quad_eq",        _cmDspSysPgm_BiQuadEq,       NULL, NULL },
3301
+  { "compressor",        _cmDspSysPgm_Compressor,     NULL, NULL },
3302
+  { "adsr",              _cmDspSysPgm_Adsr,           NULL, NULL },
3303
+  { "msg delay",         _cmDspSysPgm_MsgDelay,       NULL, NULL },
3304
+  { "pickup rmod2",      _cmDspSysPgm_RingMod2,       NULL, NULL },
3305
+  { "pickup rmod",       _cmDspSysPgm_RingMod,        NULL, NULL },
3306
+  { "pickup tails",      _cmDspSysPgm_NoiseTails,     NULL, NULL },
3307
+  { "tails_2",           _cmDspSysPgm_NoiseTails2,    NULL, NULL },
3308
+  { "pickups",           _cmDspSysPgm_Pickups0,       NULL, NULL },
3309
+  { "sync_recd",         _cmDspSysPgm_SyncRecd,       NULL, NULL },
3310
+  { "midi_test",         _cmDspSysPgm_Test_Midi,      NULL, NULL },
3311
+  { "pedal_test",        _cmDspSysPgm_Test_Pedals,    NULL, NULL },
3312
+  { "midi_file",         _cmDspSysPgm_MidiFilePlay,   NULL, NULL },
3313
+  { "2_thru",            _cmDspSysPgm_Stereo_Through, NULL, NULL },
3314
+  { "all_in_out",        _cmDspSysPgm_All_In_And_Out, NULL, NULL },
3315
+  { "guitar",            _cmDspSysPgmGuitar,          NULL, NULL },
3316
+  { "2_fx",              _cmDspSysPgm_Stereo_Fx,      NULL, NULL },
3317
+  { "sine",              _cmDspSysPgm_PlaySine,       NULL, NULL },
3318
+  { "file",              _cmDspSysPgm_PlayFile,       NULL, NULL },
3319
+  { "gate_detect",       _cmDspSysPgm_GateDetect,     NULL, NULL },
3320
+  { "rt_record",         _cmDspSysPgm_RtRecord,       NULL, NULL },
3321
+  { "record",            _cmDspSysPgm_Record,         NULL, NULL },
3322
+  { "pitch_shift",       _cmDspSysPgm_PitchShiftFile, NULL, NULL },
3323
+  { "loop_recd",         _cmDspSysPgm_LoopRecd,       NULL, NULL },
3324
+  { "ui_test",           _cmDspSysPgm_UiTest,         NULL, NULL },
3325
+  { "xfade_test",        _cmDspSysPgm_Xfade,          NULL, NULL },
3326
+  { "auto_gain",         _cmDspSysPgm_AutoGain,       NULL, NULL },
3327
+  { "comb filt",         _cmDspSysPgm_CombFilt,       NULL, NULL },
3328
+  { "scalar op",         _cmDspSysPgm_ScalarOp,       NULL, NULL },
3329
+  { "seg_line",          _cmDspSysPgm_SegLine,        NULL, NULL },
3330
+  { "avail_ch",          _cmDspSysPgm_AvailCh,        NULL, NULL },
3331
+  { "two-d",             _cmDspSysPgm_TwoD,           NULL, NULL },
3332
+  { "bin-enc",           _cmDspSysPgm_BinEnc,         NULL, NULL },
3333
+  { NULL ,                                            NULL, NULL, NULL }
3333 3334
 };
3334 3335
 
3335 3336
 _cmDspSysPgm_t* _cmDspSysPgmArrayBase()

+ 1
- 0
dsp/cmDspPgmKr.h Parādīt failu

@@ -7,6 +7,7 @@ extern "C" {
7 7
 
8 8
   cmDspRC_t _cmDspSysPgm_TimeLine( cmDspSysH_t h, void** userPtrPtr );
9 9
   cmDspRC_t _cmDspSysPgm_TimeLineLite( cmDspSysH_t h, void** userPtrPtr );
10
+  cmDspRC_t _cmDspSysPgm_TimeLineLiteAf( cmDspSysH_t h, void** userPtrPtr );
10 11
   cmDspRC_t _cmDspSysPgm_Tksb(cmDspSysH_t h, void** userPtrPtr );
11 12
   cmDspRC_t _cmDspSysPgm_TksbLite(cmDspSysH_t h, void** userPtrPtr );
12 13
   

+ 13
- 8
dsp/cmDspPgmKrTimeLineLite.c Parādīt failu

@@ -59,8 +59,11 @@ cmDspRC_t _cmDspSysPgm_TimeLineLite(cmDspSysH_t h, void** userPtrPtr )
59 59
   if( krLoadRsrc(h,&err,&r) != kOkDspRC )
60 60
     return rc;
61 61
 
62
-  cmDspInst_t* ai0 = cmDspSysAllocInst(h,"AudioIn",     NULL,  1, 2);
63
-  cmDspInst_t* ai1 = cmDspSysAllocInst(h,"AudioIn",     NULL,  1, 3);
62
+  int baseAudioInCh =  0; // 2;
63
+  int baseAudioOutCh = 0;//  2;
64
+
65
+  cmDspInst_t* ai0 = cmDspSysAllocInst(h,"AudioIn",     NULL,  1, baseAudioInCh + 0);
66
+  cmDspInst_t* ai1 = cmDspSysAllocInst(h,"AudioIn",     NULL,  1, baseAudioInCh + 1);
64 67
   //cmDspInst_t* mip = cmDspSysAllocInst(h,"MidiIn",      NULL,  2, "MOTU - Traveler mk3", "MIDI Port");
65 68
   //cmDspInst_t* mip = cmDspSysAllocInst(h,"MidiIn",      NULL,  2, "Apple Inc. - IAC Driver", "Bus 1");
66 69
   
@@ -71,8 +74,10 @@ cmDspRC_t _cmDspSysPgm_TimeLineLite(cmDspSysH_t h, void** userPtrPtr )
71 74
   cmDspInst_t* mfp  = cmDspSysAllocInst(h,"MidiFilePlay",NULL,  0 );
72 75
   cmDspInst_t* nmp  = cmDspSysAllocInst(h,"NanoMap",     NULL,  0 );
73 76
   cmDspInst_t* pic  = cmDspSysAllocInst(h,"Picadae",     NULL,  0 );
74
-  cmDspInst_t* mop  = cmDspSysAllocInst(h,"MidiOut",     NULL,  2, "Scarlett 18i20 USB","Scarlett 18i20 USB MIDI 1");
75
-  cmDspInst_t* mo2p = cmDspSysAllocInst(h,"MidiOut",     NULL,  2, "picadae","picadae MIDI 1");
77
+  //cmDspInst_t* mop  = cmDspSysAllocInst(h,"MidiOut",     NULL,  2, "Scarlett 18i20 USB","Scarlett 18i20 USB MIDI 1");
78
+  cmDspInst_t* mop  = cmDspSysAllocInst(h,"MidiOut",     NULL,  2, "Fastlane","Fastlane MIDI A" );
79
+  //cmDspInst_t* mo2p = cmDspSysAllocInst(h,"MidiOut",     NULL,  2, "picadae","picadae MIDI 1");
80
+  cmDspInst_t* mo2p = cmDspSysAllocInst(h,"MidiOut",     NULL,  2, "Fastlane","Fastlane MIDI B");
76 81
   cmDspInst_t* sfp  = cmDspSysAllocInst(h,"ScFol",       NULL,  5, r.scFn, sfBufCnt, sfMaxWndCnt, sfMinVel, sfEnaMeasFl );
77 82
   cmDspInst_t* amp  = cmDspSysAllocInst(h,"ActiveMeas",  NULL,  1, 100 );
78 83
   cmDspInst_t* modp = cmDspSysAllocInst(h,"ScMod",       NULL,  2, r.modFn, "m1" );
@@ -89,10 +94,10 @@ cmDspRC_t _cmDspSysPgm_TimeLineLite(cmDspSysH_t h, void** userPtrPtr )
89 94
   _cmDspSys_TlXformChain(h, &c1, preGrpSymId, cmpPreGrpSymId, amp, modp, 1, 1 );
90 95
 
91 96
 
92
-  cmDspInst_t* ao0 = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 4 ); // 4 Piano     1 Output
93
-  cmDspInst_t* ao1 = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 5 ); // 5          2
94
-  cmDspInst_t* ao2 = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 2 ); // 2 Transform 1 OUtput
95
-  cmDspInst_t* ao3 = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 3 ); // 3          2
97
+  cmDspInst_t* ao0 = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, baseAudioOutCh+2 ); // 4 Piano     1 Output
98
+  cmDspInst_t* ao1 = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, baseAudioOutCh+3 ); // 5          2
99
+  cmDspInst_t* ao2 = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, baseAudioOutCh+0 ); // 2 Transform 1 OUtput
100
+  cmDspInst_t* ao3 = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, baseAudioOutCh+1 ); // 3          2
96 101
 
97 102
   cmDspSysNewPage(h,"Main");
98 103
   cmDspInst_t* notesOffb= cmDspSysAllocInst(h,"Button", "notesOff",   2, kButtonDuiId, 1.0 );

+ 353
- 0
dsp/cmDspPgmKrTimeLineLiteAf.c Parādīt failu

@@ -0,0 +1,353 @@
1
+//( { file_desc:"'snap' Performance analysis Simplified Time Line program." kw:[snap]}
2
+
3
+#include "cmPrefix.h"
4
+#include "cmGlobal.h"
5
+#include "cmFloatTypes.h"
6
+#include "cmRpt.h"
7
+#include "cmErr.h"
8
+#include "cmCtx.h"
9
+#include "cmMem.h"
10
+#include "cmMallocDebug.h"
11
+#include "cmLinkedHeap.h"
12
+#include "cmText.h"
13
+#include "cmFileSys.h"
14
+#include "cmSymTbl.h"
15
+#include "cmJson.h"
16
+#include "cmPrefs.h"
17
+#include "cmDspValue.h"
18
+#include "cmMsgProtocol.h"
19
+#include "cmThread.h"
20
+#include "cmUdpPort.h"
21
+#include "cmUdpNet.h"
22
+#include "cmSerialPort.h"
23
+#include "cmTime.h"
24
+#include "cmAudioSys.h"
25
+#include "cmProcObj.h"
26
+#include "cmDspCtx.h"
27
+#include "cmDspClass.h"
28
+#include "cmDspSys.h"
29
+#include "cmDspPgm.h"
30
+
31
+#include "cmAudioFile.h"
32
+#include "cmProcObj.h"
33
+#include "cmProc.h"
34
+#include "cmProc3.h"
35
+
36
+#include "cmVectOpsTemplateMain.h"
37
+#include "cmVectOps.h"
38
+#include "cmDspPgmKrChain.h"
39
+//)
40
+
41
+//( { label:cmDspPgm_TimeLineLite file_desc:"Simplified score vs. the performance and generating related audio transforms." kw:[spgm] }
42
+
43
+cmDspRC_t _cmDspSysPgm_TimeLineLiteAf(cmDspSysH_t h, void** userPtrPtr )
44
+{
45
+  cmDspRC_t rc                       = kOkDspRC;
46
+  cmCtx_t*  cmCtx                    = cmDspSysPgmCtx(h);
47
+  cmErr_t   err;
48
+  krRsrc_t  r;
49
+
50
+  unsigned  sfBufCnt                 = 7;     // length of the MIDI event buffer
51
+  unsigned  sfMaxWndCnt              = 10;    // length of the score event buffer
52
+  unsigned  sfMinVel                 = 5;     // ignore MIDI events below this velocity
53
+  bool      sfEnaMeasFl              = true;
54
+
55
+ 
56
+  memset(&r,0,sizeof(r));
57
+  cmErrSetup(&err,&cmCtx->rpt,"Kr TimelineLite");
58
+
59
+  if( krLoadRsrc(h,&err,&r) != kOkDspRC )
60
+    return rc;
61
+
62
+  //int baseAudioInCh =  0; // 2;
63
+  int baseAudioOutCh = 0;//  2;
64
+
65
+  //cmDspInst_t* ai0 = cmDspSysAllocInst(h,"AudioIn",     NULL,  1, baseAudioInCh + 0);
66
+  //cmDspInst_t* ai1 = cmDspSysAllocInst(h,"AudioIn",     NULL,  1, baseAudioInCh + 1);
67
+  //cmDspInst_t* mip = cmDspSysAllocInst(h,"MidiIn",      NULL,  2, "MOTU - Traveler mk3", "MIDI Port");
68
+  //cmDspInst_t* mip = cmDspSysAllocInst(h,"MidiIn",      NULL,  2, "Apple Inc. - IAC Driver", "Bus 1");
69
+  
70
+  cmDspInst_t* tlp  = cmDspSysAllocInst(h,"TimeLine",    "tl",  2, r.tlFn, r.tlPrefixPath );
71
+  cmDspInst_t* scp  = cmDspSysAllocInst(h,"Score",       "sc",  1, r.scFn );
72
+  cmDspInst_t* pts  = cmDspSysAllocInst(h,"PortToSym",   NULL,  2, "on", "off" );
73
+
74
+  cmDspInst_t* php =  cmDspSysAllocInst(h,"Phasor",   NULL,  0 );
75
+  cmDspInst_t* wtp =  cmDspSysAllocInst(h,"WaveTable",NULL,  2, ((int)cmDspSysSampleRate(h)), 1 );
76
+
77
+  
78
+  cmDspInst_t* mfp  = cmDspSysAllocInst(h,"MidiFilePlay",NULL,  0 );
79
+  cmDspInst_t* nmp  = cmDspSysAllocInst(h,"NanoMap",     NULL,  0 );
80
+  //cmDspInst_t* pic  = cmDspSysAllocInst(h,"Picadae",     NULL,  0 );
81
+  cmDspInst_t* mop  = cmDspSysAllocInst(h,"MidiOut",     NULL,  2, "Fastlane","Fastlane MIDI A" );
82
+  cmDspInst_t* mo2p = cmDspSysAllocInst(h,"MidiOut",     NULL,  2, "Fastlane","Fastlane MIDI B");
83
+  cmDspInst_t* sfp  = cmDspSysAllocInst(h,"ScFol",       NULL,  5, r.scFn, sfBufCnt, sfMaxWndCnt, sfMinVel, sfEnaMeasFl );
84
+  cmDspInst_t* amp  = cmDspSysAllocInst(h,"ActiveMeas",  NULL,  1, 100 );
85
+  cmDspInst_t* modp = cmDspSysAllocInst(h,"ScMod",       NULL,  2, r.modFn, "m1" );
86
+ 
87
+  unsigned   preGrpSymId     = cmDspSysPresetRegisterGroup(h,"tl");
88
+  unsigned   cmpPreGrpSymId  = cmDspSysPresetRegisterGroup(h,"tl_cmp"); 
89
+
90
+  cmDspTlXform_t c0,c1;
91
+
92
+  cmDspSysNewPage(h,"Controls-0");
93
+  _cmDspSys_TlXformChain(h, &c0, preGrpSymId, cmpPreGrpSymId, amp, modp, 0, 0 );
94
+
95
+  cmDspSysNewPage(h,"Controls-1");
96
+  _cmDspSys_TlXformChain(h, &c1, preGrpSymId, cmpPreGrpSymId, amp, modp, 1, 1 );
97
+
98
+
99
+  cmDspInst_t* ao0 = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, baseAudioOutCh+2 ); // 4 Piano     1 Output
100
+  cmDspInst_t* ao1 = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, baseAudioOutCh+3 ); // 5          2
101
+  cmDspInst_t* ao2 = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, baseAudioOutCh+0 ); // 2 Transform 1 OUtput
102
+  cmDspInst_t* ao3 = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, baseAudioOutCh+1 ); // 3          2
103
+
104
+  cmDspSysNewPage(h,"Main");
105
+  cmDspInst_t* notesOffb= cmDspSysAllocInst(h,"Button", "notesOff",   2, kButtonDuiId, 1.0 );
106
+  cmDspInst_t* onb     = cmDspSysAllocInst(h,"Button", "start",   2, kButtonDuiId, 1.0 );
107
+  cmDspInst_t* offb    = cmDspSysAllocInst(h,"Button", "stop",    2, kButtonDuiId, 1.0 );
108
+  cmDspInst_t* mod_sel = cmDspSysAllocMsgList(h, NULL, "mod_sel", 1 );
109
+  cmDspInst_t* prp     = cmDspSysAllocInst(h,"Printer", NULL,   1, ">" );
110
+  cmDspInst_t* prd     = cmDspSysAllocInst(h,"Printer", NULL,   1, "DYNM:" );
111
+  cmDspInst_t* pre     = cmDspSysAllocInst(h,"Printer", NULL,   1, "EVEN:" );
112
+  cmDspInst_t* prt     = cmDspSysAllocInst(h,"Printer", NULL,   1, "TMPO:");
113
+  cmDspInst_t* prc     = cmDspSysAllocInst(h,"Printer", NULL,   1, "COST:");
114
+
115
+  // Record <-> Live switches
116
+  cmDspInst_t* tlRt  = cmDspSysAllocInst(h,"Router", NULL, 2, 2, 0);  // time line swich
117
+  cmDspInst_t* mfpRt = cmDspSysAllocInst(h,"Router", NULL, 2, 2, 0);
118
+  //cmDspInst_t* amRt  = cmDspSysAllocInst(h,"Router", NULL, 2, 2, 0);
119
+
120
+  //cmDspSysNewColumn(h,0);
121
+  //cmDspInst_t* igain0 = cmDspSysAllocInst(h,"Scalar", "In Gain-0",    5, kNumberDuiId, 0.0,   100.0,0.01,   1.0 );  
122
+  //cmDspInst_t* igain1 = cmDspSysAllocInst(h,"Scalar", "In Gain-1",    5, kNumberDuiId, 0.0,   100.0,0.01,   1.0 );  
123
+
124
+  //cmDspSysNewColumn(h,0);
125
+  cmDspInst_t* ogain0 = cmDspSysAllocInst(h,"Scalar", "Dry Out Gain-0",   5, kNumberDuiId, 0.0,   10.0,0.01,   1.0 );  
126
+  cmDspInst_t* ogain1 = cmDspSysAllocInst(h,"Scalar", "Dry Out Gain-1",   5, kNumberDuiId, 0.0,   10.0,0.01,   1.0 );  
127
+  cmDspInst_t* ogain2 = cmDspSysAllocInst(h,"Scalar", "Wet Out Gain-2",   5, kNumberDuiId, 0.0,   10.0,0.01,   1.0 );  
128
+  cmDspInst_t* ogain3 = cmDspSysAllocInst(h,"Scalar", "Wet Out Gain-3",   5, kNumberDuiId, 0.0,   10.0,0.01,   1.0 );  
129
+
130
+  // Audio file recording
131
+  cmDspInst_t* recdGain= cmDspSysAllocInst(h,"Scalar", "Recd Gain",  5, kNumberDuiId, 0.0,   100.0,0.01, 1.5 );  
132
+  cmDspInst_t* recdChk = cmDspSysAllocInst(h,"Button", "Record",     2, kCheckDuiId, 0.0 );
133
+  cmDspInst_t* recdPtS = cmDspSysAllocInst(h,"GateToSym", NULL,      2, cmSymTblRegisterStaticSymbol(cmDspSysSymbolTable(h),"open"),cmSymTblRegisterStaticSymbol(cmDspSysSymbolTable(h),"close"));
134
+  cmDspInst_t* afop    = cmDspSysAllocInst(h,"AudioFileOut",NULL,    2, r.recordDir,2);
135
+  cmDspInst_t* mi0p    = cmDspSysAllocInst(h,"AMeter","In 0",  0);
136
+  cmDspInst_t* mi1p    = cmDspSysAllocInst(h,"AMeter","In 1",  0);
137
+
138
+  cmDspInst_t* meas    = cmDspSysAllocInst(h,"Scalar", "Meas",    5, kNumberDuiId, 1.0,   59.0,1.0,   1.0 );  
139
+  cmDspSysInstallCb( h, meas, "val", scp, "meas", NULL);
140
+  cmDspSysInstallCb( h, meas, "val", tlp, "meas", NULL);
141
+
142
+
143
+
144
+
145
+  //--------------- Preset controls
146
+  cmDspSysNewColumn(h,0);
147
+  cmDspInst_t* preset    = cmDspSysAllocInst(   h, "Preset", NULL, 1, preGrpSymId );
148
+  cmDspInst_t* presetLbl = cmDspSysAllocInst(   h, "Text",   "Preset",      1, "" );
149
+  cmDspInst_t* storeBtn  = cmDspSysAllocButton( h, "store",  0);
150
+  cmDspInst_t* recallBtn = cmDspSysAllocButton( h, "recall", 0);
151
+  cmDspSysInstallCb(   h, presetLbl, "val", preset, "label",NULL);
152
+  cmDspSysInstallCb(   h, storeBtn,  "sym", preset, "cmd", NULL );
153
+  cmDspSysInstallCb(   h, recallBtn, "sym", preset, "cmd", NULL );
154
+
155
+  cmDspInst_t* prePath    = cmDspSysAllocInst(   h, "Fname",  "prePath",   3, true,NULL,r.tlPrefixPath);
156
+  
157
+
158
+  //cmDspSysNewColumn(h,0);
159
+
160
+  //--------------- Recorded performance evaluation and Active Measurement related controls
161
+  cmDspInst_t* clrBtn  = cmDspSysAllocButton( h, "clear",  0);
162
+  cmDspInst_t* prtBtn  = cmDspSysAllocButton( h, "dump",  0);
163
+  cmDspInst_t* amCmd   = cmDspSysAllocInst(   h, "PortToSym", NULL, 2, "add", "rewind" );  
164
+
165
+  if((rc = cmDspSysLastRC(h)) != kOkDspRC )
166
+    return rc;
167
+
168
+  // Output Audio file recording.
169
+  cmDspSysInstallCb(h, recdGain,"val", afop,    "gain0", NULL );
170
+  cmDspSysInstallCb(h, recdGain,"val", afop,    "gain1", NULL );
171
+  cmDspSysInstallCb(h, recdChk, "out", recdPtS, "on",    NULL );
172
+  cmDspSysInstallCb(h, recdChk, "out", recdPtS, "off",   NULL );
173
+  cmDspSysInstallCb(h, recdPtS, "out", afop,    "sel",   NULL );
174
+
175
+  // Audio connections
176
+
177
+  cmDspSysConnectAudio(h, php, "out", wtp, "phs" );   // phasor -> wave table
178
+  cmDspSysConnectAudio(h, wtp, "out", ao0, "in" );    // wave table -> audio out (dry output)
179
+  cmDspSysConnectAudio(h, wtp, "out", ao1, "in" );    // 
180
+  
181
+  //cmDspSysConnectAudio( h, ai0,   "out", ao0,   "in" );  //  dry signal through 
182
+  //cmDspSysConnectAudio( h, ai1,   "out", ao1,   "in" );  //
183
+  
184
+  //cmDspSysConnectAudio( h, ai0,   "out", mi0p,   "in" );  //
185
+  //cmDspSysConnectAudio( h, ai0,   "out", c0.kr0, "in" );  // ain -> ch0.kr0
186
+  //cmDspSysConnectAudio( h, ai0,   "out", c0.kr1, "in" );  // ain -> ch0.kr1
187
+
188
+  cmDspSysConnectAudio( h, wtp,   "out", mi0p,   "in" );  //
189
+  cmDspSysConnectAudio( h, wtp,   "out", c0.kr0, "in" );  // ain -> ch0.kr0
190
+  cmDspSysConnectAudio( h, wtp,   "out", c0.kr1, "in" );  // ain -> ch0.kr1
191
+
192
+  
193
+  cmDspSysConnectAudio( h, c0.cmp,"out", ao2,    "in" );  // ch0.cmp -> aout
194
+  cmDspSysConnectAudio( h, c0.cmp,"out", afop,   "in0");  // ch0.cmp -> audio_file_out
195
+
196
+  //cmDspSysConnectAudio( h, ai1,   "out", mi1p,   "in" );  //
197
+  //cmDspSysConnectAudio( h, ai1,   "out", c1.kr0, "in" );  // ain -> ch1.kr0
198
+  //cmDspSysConnectAudio( h, ai1,   "out", c1.kr1, "in" );  // ain -> ch1.kr1
199
+
200
+  cmDspSysConnectAudio( h, wtp,   "out", mi1p,   "in" );  //
201
+  cmDspSysConnectAudio( h, wtp,   "out", c1.kr0, "in" );  // ain -> ch1.kr0
202
+  cmDspSysConnectAudio( h, wtp,   "out", c1.kr1, "in" );  // ain -> ch1.kr1
203
+
204
+  cmDspSysConnectAudio( h, c1.cmp,"out", ao3,    "in" );  // ch1.cmp -> aout
205
+  cmDspSysConnectAudio( h, c1.cmp,"out", afop,   "in1");  // ch1.cmp ->audio_file_out
206
+  
207
+
208
+
209
+  cmDspSysInstallCb( h, clrBtn, "sym",    amp, "cmd",   NULL ); // clear active meas.
210
+  cmDspSysInstallCb( h, prtBtn, "sym",    modp, "cmd",   NULL ); // print active meas
211
+  //cmDspSysInstallCb( h, prtBtn, "sym",    scp, "cmd",   NULL ); // print the score
212
+  cmDspSysInstallCb( h, amCmd,  "add",    amp, "cmd",   NULL ); // add active meas
213
+  cmDspSysInstallCb( h, amCmd,  "rewind", amp, "cmd",   NULL ); // rewind active meas
214
+  //cmDspSysInstallCb( h, sfp,    "out",    amRt, "f-in", NULL ); // sfp-active meas router (rtr is switched by live btn)
215
+  //cmDspSysInstallCb( h, amRt,   "f-out-0",amp, "sfloc", NULL ); 
216
+  cmDspSysInstallCb( h, sfp,    "out",    amp, "sfloc", NULL );
217
+  
218
+  cmDspSysInstallCb( h, sfp, "vloc", amp,   "loc",  NULL ); // live meas's to active meas unit
219
+  cmDspSysInstallCb( h, sfp, "vval", amp,   "val",  NULL ); //
220
+  cmDspSysInstallCb( h, sfp, "vcost",amp,   "cst",  NULL ); //
221
+  cmDspSysInstallCb( h, sfp, "vtyp", amp,   "type", NULL ); //
222
+  cmDspSysInstallCb( h, sfp, "vtyp", amCmd, "add",  NULL);  //
223
+
224
+  // ***** delete this to prevent the score follower from driving the active-measure unit in 'live' mode
225
+  //cmDspSysInstallCb( h, amRt,   "f-out-1",amp, "sfloc", NULL );
226
+  // *****
227
+
228
+  // active measure loc to xfad channel trigger
229
+  /*
230
+  cmDspSysInstallCb( h, amp,       "scloc",c0.achan, "trig", NULL );  // See Also: modp.sw ->achan.trig
231
+  cmDspSysInstallCb( h, amp,       "scloc",c1.achan, "trig", NULL );
232
+  cmDspSysInstallCb( h, recallBtn, "sym",  c0.achan, "trig", NULL ); 
233
+  cmDspSysInstallCb( h, recallBtn, "sym",  c1.achan, "trig", NULL );
234
+  */
235
+  
236
+  cmDspSysInstallCb( h, amp,    "even",   pre,        "in",   NULL );  // active meas output to printers
237
+  cmDspSysInstallCb( h, amp,    "even",   modp,       "even", NULL );
238
+
239
+  cmDspSysInstallCb( h, amp,    "dyn",    prd,        "in",   NULL );
240
+  cmDspSysInstallCb( h, amp,    "dyn",    modp,       "dyn",  NULL );
241
+  
242
+  cmDspSysInstallCb( h, amp,    "tempo",  prt,        "in",   NULL );
243
+  cmDspSysInstallCb( h, amp,    "tempo",  modp,       "tempo",NULL );
244
+  
245
+  cmDspSysInstallCb( h, amp,    "cost",   prc,        "in",   NULL );
246
+  cmDspSysInstallCb( h, amp,    "cost",   modp,       "cost", NULL );
247
+
248
+  
249
+  /*
250
+  cmDspSysInstallCb( h, sfp, "vloc", pre,   "in",  NULL ); // live meas's to active meas unit
251
+  cmDspSysInstallCb( h, sfp, "vval", prd,   "in",  NULL ); //
252
+  cmDspSysInstallCb( h, sfp, "vcost",prt,   "in",  NULL ); //
253
+  cmDspSysInstallCb( h, sfp, "vtyp", prc,   "in", NULL ); //
254
+  */
255
+  // wave-table to time-line cursor
256
+  //cmDspSysInstallCb(   h, wtp, "fidx",tlp,  "curs", NULL); 
257
+
258
+  cmDspSysInstallCb(h, prePath, "out", tlp, "path", NULL );
259
+
260
+  //cmDspSysInstallCb(h, notesOffb,  "sym",    pic, "alloff",  NULL );
261
+  
262
+  // start connections
263
+  cmDspSysInstallCb(h, onb,  "sym",    tlRt, "s-in",  NULL );
264
+  cmDspSysInstallCb(h, tlRt, "s-out-0",tlp,  "reset", NULL );
265
+  cmDspSysInstallCb(h, onb,  "sym",    scp,  "send",  NULL );
266
+  cmDspSysInstallCb(h, onb,  "sym",    mfpRt,"s-in",  NULL );
267
+  cmDspSysInstallCb(h, mfpRt,"s-out-0",mfp,  "sel",   NULL );
268
+
269
+  cmDspSysInstallCb(h, onb, "sym",     pts,     "on",     NULL );
270
+  cmDspSysInstallCb(h, pts, "on",      wtp,     "cmd",    NULL );
271
+  cmDspSysInstallCb(h, pts, "on",      modp,    "cmd",    NULL );
272
+  cmDspSysInstallCb(h, onb, "sym",     amCmd,   "rewind", NULL );
273
+  cmDspSysInstallCb(h, onb, "out",     c0.achan,"reset",  NULL );
274
+  cmDspSysInstallCb(h, onb, "out",     c1.achan,"reset",  NULL );
275
+
276
+  cmDspSysInstallCb(h, mod_sel,"out",  modp,  "sel", NULL );
277
+
278
+  // stop connections
279
+  cmDspSysInstallCb(h, tlp,  "mfn", pts, "off",   NULL ); // Prevents WT start on new audio file from TL.
280
+  cmDspSysInstallCb(h, offb, "sym", mfp, "sel",   NULL ); 
281
+  cmDspSysInstallCb(h, offb, "sym", pts, "off",   NULL );
282
+  cmDspSysInstallCb(h, pts,  "off", wtp, "cmd",   NULL );
283
+  cmDspSysInstallCb(h, pts,  "off", modp,"cmd",   NULL );
284
+  cmDspSysInstallCb(h, offb, "sym", mop, "reset", NULL );
285
+  cmDspSysInstallCb(h, offb, "sym", mo2p,"reset", NULL );
286
+
287
+
288
+  // time-line to MIDI file player selection
289
+  cmDspSysInstallCb(h, tlp, "mbsi", mfp, "bsi",   NULL );
290
+  cmDspSysInstallCb(h, tlp, "mesi", mfp, "esi",   NULL );
291
+  cmDspSysInstallCb(h, tlp, "mfn",  mfp, "fn",    NULL );
292
+
293
+
294
+  // time-line to Audio file player selection
295
+  cmDspSysInstallCb(h, tlp, "absi", wtp, "beg",   NULL );
296
+  cmDspSysInstallCb(h, tlp, "aesi", wtp, "end",   NULL );
297
+  cmDspSysInstallCb(h, tlp, "afn",  wtp, "fn",    NULL );
298
+  
299
+  // score to score follower - to set initial search location
300
+  cmDspSysInstallCb(h, scp, "sel",    sfp, "index", NULL );
301
+  cmDspSysInstallCb(h, scp, "sel",    modp,"reset", NULL );
302
+  cmDspSysInstallCb(h, scp, "sel",    prp, "in",    NULL );
303
+
304
+  cmDspInst_t* msrc = mfp;  // switch MIDI source (mfp or mip)
305
+  
306
+  // MIDI file player to score follower and sampler
307
+  cmDspSysInstallCb(h, msrc,  "smpidx",  sfp, "smpidx",NULL );
308
+  //cmDspSysInstallCb(h, mfp,  "id",      sfp, "muid",  NULL );
309
+
310
+  cmDspSysInstallCb(h, msrc,   "d1",     sfp,  "d1",    NULL );
311
+  cmDspSysInstallCb(h, msrc,   "d1",     nmp,  "d1",    NULL );
312
+  cmDspSysInstallCb(h, nmp,   "d1",     mop,  "d1",    NULL );
313
+  //cmDspSysInstallCb(h, nmp,   "d1",     pic, "d1",    NULL );
314
+  //cmDspSysInstallCb(h, pic,   "d1",     mo2p, "d1",    NULL );
315
+
316
+  cmDspSysInstallCb(h, msrc,  "d0",      sfp,  "d0",   NULL );
317
+  cmDspSysInstallCb(h, msrc,  "d0",      nmp,  "d0",   NULL );
318
+  cmDspSysInstallCb(h, nmp,  "d0",      mop,  "d0",   NULL );
319
+  //cmDspSysInstallCb(h, nmp,  "d0",      pic, "d0",   NULL );
320
+  //cmDspSysInstallCb(h, pic,   "d0",     mo2p, "d0",    NULL );
321
+
322
+  cmDspSysInstallCb(h, msrc,  "status",  sfp,  "status",NULL );
323
+  cmDspSysInstallCb(h, msrc,  "status",  nmp,  "status",NULL );
324
+  cmDspSysInstallCb(h, nmp,  "status",  mop,  "status",NULL );
325
+  //cmDspSysInstallCb(h, nmp,  "status",  pic, "status",NULL );
326
+  //cmDspSysInstallCb(h, pic,   "status",  mo2p, "status",    NULL );
327
+
328
+
329
+  // score follower to recd_play,modulator and printers
330
+  cmDspSysInstallCb(h, sfp, "out",     modp,    "index", NULL );
331
+  cmDspSysInstallCb(h, sfp, "recent",  prp,     "in",  NULL );  // report 'recent' but only act on 'max' loc index
332
+
333
+  //cmDspSysInstallCb(h, igain0, "val", ai0, "gain", NULL );   // input gain control
334
+  //cmDspSysInstallCb(h, igain1, "val", ai1, "gain", NULL );
335
+
336
+
337
+  cmDspSysInstallCb(h, modp, "dgain0",  ogain0, "val",  NULL );
338
+  cmDspSysInstallCb(h, modp, "dgain1",  ogain1, "val",  NULL );
339
+  cmDspSysInstallCb(h, modp, "wgain0",  ogain2, "val",  NULL );
340
+  cmDspSysInstallCb(h, modp, "wgain1",  ogain3, "val",  NULL );
341
+
342
+  cmDspSysInstallCb(h, ogain0, "val", ao0, "gain", NULL );   // output gain control - dry 0
343
+  cmDspSysInstallCb(h, ogain1, "val", ao1, "gain", NULL );   //                       dry 1
344
+  cmDspSysInstallCb(h, ogain2, "val", ao2, "gain", NULL );   //                       wet 0
345
+  cmDspSysInstallCb(h, ogain3, "val", ao3, "gain", NULL );   //                       wet 1
346
+
347
+
348
+  return rc;
349
+}
350
+
351
+
352
+//------------------------------------------------------------------------------
353
+//)

Notiek ielāde…
Atcelt
Saglabāt