|
@@ -70,6 +70,90 @@ cmDspRC_t _cmDspSysPgm_SyncRecd( cmDspSysH_t h, void** userPtrPtr )
|
70
|
70
|
|
71
|
71
|
}
|
72
|
72
|
|
|
73
|
+cmDspRC_t _cmDspSysPgm_MidiFilePlay( cmDspSysH_t h, void** userPtrPtr )
|
|
74
|
+{
|
|
75
|
+
|
|
76
|
+ cmDspRC_t rc = kOkDspRC;
|
|
77
|
+ const cmChar_t* deviceName = "Fastlane";
|
|
78
|
+ const cmChar_t* portName = "Fastlane MIDI A";
|
|
79
|
+
|
|
80
|
+ //const cmChar_t* deviceName = "DKV-M4";
|
|
81
|
+ //const cmChar_t* portName = "DKV-M4 MIDI 1";
|
|
82
|
+
|
|
83
|
+ const char* fn0 = "media/midi/kriesberg/part2/piano_score_part_2_draft_1_master_m191-195.mid";
|
|
84
|
+ const cmChar_t* fn = cmFsMakeFn(cmFsUserDir(),fn0,NULL,NULL );
|
|
85
|
+ cmDspInst_t* fnp = cmDspSysAllocInst(h,"Fname", NULL, 3, false,"MIDI Files (*.mid)\tMIDI Files (*.{mid})",fn);
|
|
86
|
+
|
|
87
|
+ cmDspInst_t* ignp = cmDspSysAllocInst( h,"Scalar", "In Gain", 5, kNumberDuiId, 0.0, 4.0, 0.01, 1.0);
|
|
88
|
+
|
|
89
|
+ cmDspInst_t* ai0p = cmDspSysAllocInst(h,"AudioIn", NULL, 1, 2 );
|
|
90
|
+ cmDspInst_t* ai1p = cmDspSysAllocInst(h,"AudioIn", NULL, 1, 3 );
|
|
91
|
+
|
|
92
|
+ cmDspInst_t* mfp = cmDspSysAllocInst(h,"MidiFilePlay",NULL, 0 );
|
|
93
|
+ cmDspInst_t* mop = cmDspSysAllocInst( h,"MidiOut", NULL, 2, deviceName, portName);
|
|
94
|
+
|
|
95
|
+ cmDspInst_t* start = cmDspSysAllocInst( h,"Button", "start", 2, kButtonDuiId, 0.0 );
|
|
96
|
+ cmDspInst_t* stop = cmDspSysAllocInst( h,"Button", "stop", 2, kButtonDuiId, 0.0 );
|
|
97
|
+ cmDspInst_t* cont = cmDspSysAllocInst( h,"Button", "continue", 2, kButtonDuiId, 0.0 );
|
|
98
|
+
|
|
99
|
+ cmDspInst_t* beg = cmDspSysAllocInst(h,"Scalar", "Beg Samp", 5, kNumberDuiId, 0.0, 1000000000.0, 1.0, 0.0 );
|
|
100
|
+ cmDspInst_t* end = cmDspSysAllocInst(h,"Scalar", "End Samp", 5, kNumberDuiId, 0.0, 1000000000.0, 1.0, 1000000000.0 );
|
|
101
|
+
|
|
102
|
+ cmDspInst_t* ao0p = cmDspSysAllocInst(h,"AudioOut",NULL, 1, 0 );
|
|
103
|
+ cmDspInst_t* ao1p = cmDspSysAllocInst(h,"AudioOut",NULL, 1, 1 );
|
|
104
|
+
|
|
105
|
+ cmDspInst_t* im0p = cmDspSysAllocInst(h,"AMeter","In 0", 0);
|
|
106
|
+ cmDspInst_t* im1p = cmDspSysAllocInst(h,"AMeter","In 1", 0);
|
|
107
|
+
|
|
108
|
+ cmDspInst_t* om0p = cmDspSysAllocInst(h,"AMeter","Out 0", 0);
|
|
109
|
+ cmDspInst_t* om1p = cmDspSysAllocInst(h,"AMeter","Out 1",0);
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+ // check for allocation errors
|
|
113
|
+ if((rc = cmDspSysLastRC(h)) != kOkDspRC )
|
|
114
|
+ goto errLabel;
|
|
115
|
+
|
|
116
|
+ cmDspSysInstallCb( h, fnp, "out", mfp, "fn", NULL);
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+ cmDspSysInstallCb( h, start, "sym", beg, "send", NULL);
|
|
120
|
+ cmDspSysInstallCb( h, beg, "val", mfp, "bsi", NULL);
|
|
121
|
+
|
|
122
|
+ cmDspSysInstallCb( h, start, "sym", end, "send", NULL);
|
|
123
|
+ cmDspSysInstallCb( h, end, "val", mfp, "esi", NULL);
|
|
124
|
+
|
|
125
|
+ cmDspSysInstallCb( h, start, "sym", mfp, "sel", NULL);
|
|
126
|
+ cmDspSysInstallCb( h, stop, "sym", mfp, "sel", NULL);
|
|
127
|
+ cmDspSysInstallCb( h, cont, "sym", mfp, "sel", NULL);
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+ cmDspSysInstallCb( h, mfp, "d1", mop, "d1", NULL);
|
|
131
|
+ cmDspSysInstallCb( h, mfp, "d0", mop, "d0", NULL);
|
|
132
|
+ cmDspSysInstallCb( h, mfp, "status", mop, "status", NULL);
|
|
133
|
+
|
|
134
|
+ //cmDspSysConnectAudio(h, ai0p, "out", ao0p, "in");
|
|
135
|
+ //cmDspSysConnectAudio(h, ai1p, "out", ao1p, "in");
|
|
136
|
+
|
|
137
|
+ cmDspSysConnectAudio(h, ai0p, "out", im0p, "in"); //ain0 -> imtr0
|
|
138
|
+ cmDspSysConnectAudio(h, ai1p, "out", im1p, "in"); //ain1 -> imtr1
|
|
139
|
+
|
|
140
|
+ cmDspSysInstallCb( h, ignp,"val", ai0p, "gain", NULL); // igain -> ain0
|
|
141
|
+ cmDspSysConnectAudio(h, ai0p,"out", ao0p, "in" ); // ain0 -> aout0
|
|
142
|
+ cmDspSysConnectAudio(h, ai0p,"out", om0p, "in" ); // ain0 -> omtr0
|
|
143
|
+
|
|
144
|
+ cmDspSysInstallCb( h, ignp,"val", ai1p, "gain", NULL); // igain -> ain1
|
|
145
|
+ cmDspSysConnectAudio(h, ai1p,"out", ao1p, "in" ); // ain1 -> aout1
|
|
146
|
+ cmDspSysConnectAudio(h, ai1p,"out", om1p, "in" ); // ain1 -> omtr1
|
|
147
|
+
|
|
148
|
+ errLabel:
|
|
149
|
+
|
|
150
|
+ cmFsFreeFn(fn);
|
|
151
|
+
|
|
152
|
+ return rc;
|
|
153
|
+}
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
73
|
157
|
cmDspRC_t _cmDspSysPgm_Test_Midi( cmDspSysH_t h, void** userPtrPtr )
|
74
|
158
|
{
|
75
|
159
|
cmDspRC_t rc = kOkDspRC;
|
|
@@ -123,7 +207,6 @@ cmDspRC_t _cmDspSysPgm_Test_Midi( cmDspSysH_t h, void** userPtrPtr )
|
123
|
207
|
|
124
|
208
|
cmDspRC_t _cmDspSysPgm_Stereo_Through( cmDspSysH_t h, void** userPtrPtr )
|
125
|
209
|
{
|
126
|
|
- bool useBuiltInFl = true;
|
127
|
210
|
|
128
|
211
|
cmDspInst_t* ignp = cmDspSysAllocInst( h,"Scalar", "In Gain", 5, kNumberDuiId, 0.0, 4.0, 0.01, 1.0);
|
129
|
212
|
//cmDspInst_t* ognp = cmDspSysAllocInst( h,"Scalar", "Out Gain", 5, kNumberDuiId, 0.0, 4.0, 0.01, 1.0);
|
|
@@ -132,12 +215,12 @@ cmDspRC_t _cmDspSysPgm_Stereo_Through( cmDspSysH_t h, void** userPtrPtr )
|
132
|
215
|
cmDspInst_t* php = cmDspSysAllocInst(h,"Phasor", NULL, 0 );
|
133
|
216
|
cmDspInst_t* wtp = cmDspSysAllocInst(h,"WaveTable",NULL, 2, cmDspSysSampleRate(h), 2 );
|
134
|
217
|
|
135
|
|
- cmDspInst_t* ai0p = cmDspSysAllocInst(h,"AudioIn", NULL, 1, useBuiltInFl ? 0 : 2 );
|
136
|
|
- cmDspInst_t* ai1p = cmDspSysAllocInst(h,"AudioIn", NULL, 1, useBuiltInFl ? 1 : 3 );
|
|
218
|
+ cmDspInst_t* ai0p = cmDspSysAllocInst(h,"AudioIn", NULL, 1, 2 );
|
|
219
|
+ cmDspInst_t* ai1p = cmDspSysAllocInst(h,"AudioIn", NULL, 1, 3 );
|
137
|
220
|
|
138
|
221
|
// MOTU Traveler: Use channels 2&3 (out plugs:3&4) because 0&1 do not show up on plugs 1&2.
|
139
|
|
- cmDspInst_t* ao0p = cmDspSysAllocInst(h,"AudioOut",NULL, 1, useBuiltInFl ? 0 : 2 );
|
140
|
|
- cmDspInst_t* ao1p = cmDspSysAllocInst(h,"AudioOut",NULL, 1, useBuiltInFl ? 1 : 3 );
|
|
222
|
+ cmDspInst_t* ao0p = cmDspSysAllocInst(h,"AudioOut",NULL, 1, 0 );
|
|
223
|
+ cmDspInst_t* ao1p = cmDspSysAllocInst(h,"AudioOut",NULL, 1, 1 );
|
141
|
224
|
|
142
|
225
|
cmDspInst_t* im0p = cmDspSysAllocInst(h,"AMeter","In 0", 0);
|
143
|
226
|
cmDspInst_t* im1p = cmDspSysAllocInst(h,"AMeter","In 1", 0);
|
|
@@ -2694,6 +2777,7 @@ _cmDspSysPgm_t _cmDspSysPgmArray[] =
|
2694
|
2777
|
{ "pickups", _cmDspSysPgm_Pickups0, NULL, NULL },
|
2695
|
2778
|
{ "sync_recd", _cmDspSysPgm_SyncRecd, NULL, NULL },
|
2696
|
2779
|
{ "midi_test", _cmDspSysPgm_Test_Midi, NULL, NULL },
|
|
2780
|
+ { "midi_file", _cmDspSysPgm_MidiFilePlay, NULL, NULL },
|
2697
|
2781
|
{ "2_thru", _cmDspSysPgm_Stereo_Through, NULL, NULL },
|
2698
|
2782
|
{ "guitar", _cmDspSysPgmGuitar, NULL, NULL },
|
2699
|
2783
|
{ "2_fx", _cmDspSysPgm_Stereo_Fx, NULL, NULL },
|