aboutsummaryrefslogtreecommitdiff
path: root/midifile/midifile-help.pd
blob: a7ac591a83aad6841a8897721bb8600c9c7b75e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
#N canvas 632 256 399 237 12;
#N canvas 549 72 690 635 midifile_write 0;
#X obj 15 2 bng 45 250 50 0 empty empty choose 5 23 0 8 -62784 -260818
-258699;
#X obj 130 51 tgl 45 0 empty empty record 2 23 0 8 -258699 -241291
-24198 0 1;
#X floatatom 125 585 15 0 0 0 tick - -;
#X obj 130 151 metro 2;
#X floatatom 176 123 15 0 0 0 - - -;
#X msg 176 97 2.005;
#X msg 262 180 60;
#X msg 336 180 127;
#X floatatom 262 206 5 0 0 0 - - -;
#X floatatom 336 206 5 0 0 0 - - -;
#X obj 262 276 list prepend 144;
#X obj 371 253 + 144;
#X floatatom 371 229 5 0 0 0 - - -;
#X text 408 228 channel;
#X text 412 252 note-on;
#X msg 17 482 verbose \$1;
#X text 5 437 verbosity defaults to 1;
#X text 64 14 1: open a file for writing;
#X text 182 62 2: start recording;
#X obj 15 181 savepanel;
#X msg 300 433 240 1 2 3 4 247;
#X text 414 432 a sysex message;
#X obj 125 555 float;
#X floatatom 17 456 5 0 0 0 - - -;
#X msg 15 402 write \$1 \$2 \$3;
#X msg 171 269 29;
#X msg 209 269 30;
#X msg 55 269 0;
#X floatatom 96 313 5 0 0 0 - - -;
#X text 140 311 ticks per frame;
#X text 139 327 (ticks per quarter note if frames per second is zero)
;
#X msg 133 269 25;
#X msg 93 269 24;
#X text 143 344 25 20 will give accurate timing with metro ticks at
2ms;
#X obj 15 369 pack s 25 20;
#X text 450 589 Martin Peach \, 2008;
#X obj 131 525 midifile;
#X obj 475 249 pack f f;
#X msg 475 195 60;
#X msg 528 195 127;
#X floatatom 475 221 5 0 0 0 - - -;
#X floatatom 528 221 5 0 0 0 - - -;
#X floatatom 585 229 5 0 0 0 - - -;
#X text 623 228 channel;
#X obj 585 253 + 128;
#X text 626 251 note-off;
#X obj 262 246 pack 60 127;
#X obj 475 276 list prepend 128;
#X text 37 249 time code frames per second:;
#X text 281 372 default is 90 ticks per quarter note;
#X msg 146 373 write filename.mid;
#X msg 159 398 write filename.mid 77;
#X text 319 398 77 ticks per quarter note;
#X obj 294 466 cnv 15 300 20 empty empty empty 20 12 0 14 -4034 -66577
0;
#X text 333 464 4: stop recording and save the file;
#X msg 285 466 flush;
#X obj 262 157 cnv 15 200 20 empty empty empty 20 12 0 14 -257985 -66577
0;
#X text 281 157 3: input MIDI as lists;
#X connect 0 0 19 0;
#X connect 1 0 3 0;
#X connect 3 0 36 0;
#X connect 4 0 3 1;
#X connect 5 0 4 0;
#X connect 6 0 8 0;
#X connect 7 0 9 0;
#X connect 8 0 46 0;
#X connect 9 0 46 1;
#X connect 10 0 36 0;
#X connect 11 0 10 1;
#X connect 12 0 11 0;
#X connect 15 0 36 0;
#X connect 19 0 34 0;
#X connect 20 0 36 0;
#X connect 22 0 2 0;
#X connect 23 0 15 0;
#X connect 24 0 36 0;
#X connect 25 0 34 1;
#X connect 26 0 34 1;
#X connect 27 0 34 1;
#X connect 28 0 34 2;
#X connect 31 0 34 1;
#X connect 32 0 34 1;
#X connect 34 0 24 0;
#X connect 36 1 22 1;
#X connect 36 2 22 0;
#X connect 37 0 47 0;
#X connect 38 0 40 0;
#X connect 39 0 41 0;
#X connect 40 0 37 0;
#X connect 41 0 37 1;
#X connect 42 0 44 0;
#X connect 44 0 47 1;
#X connect 46 0 10 0;
#X connect 47 0 36 0;
#X connect 50 0 36 0;
#X connect 51 0 36 0;
#X connect 55 0 36 0;
#X restore 76 116 pd midifile_write;
#N canvas 503 29 765 914 midifile_read 0;
#X obj 47 205 bng 15 250 50 0 empty empty step 18 7 0 12 -4160 -257985
-1;
#X obj 28 45 openpanel;
#X obj 28 0 bng 45 250 50 0 empty empty choose 3 23 0 12 -62784 -260818
-258699;
#X obj 166 36 tgl 45 0 empty empty play 10 23 0 12 -24198 -1 -258699
0 1;
#X msg 56 266 rewind;
#X text 111 265 go to start of file;
#X floatatom 86 362 15 0 0 0 tick - -;
#X obj 457 123 hradio 15 1 0 16 empty empty track_number 0 -6 0 12
-62784 -241291 -1 0;
#X msg 457 144 dump \$1;
#X msg 251 290 68050;
#X msg 457 59 track \$1;
#X obj 457 19 hradio 15 1 0 16 empty empty track_number 0 -6 0 12 -62784
-241291 -1 0;
#X obj 166 200 metro 2;
#X text 162 327 creation arguments: midi_file_name;
#X text 528 59 output only this track;
#X text 520 143 parse this track to main window;
#X msg 252 266 0;
#X floatatom 212 175 15 0 0 0 - - -;
#X msg 212 155 2.005;
#X text 293 289 goto tick 68050;
#X obj 391 366 t b b b;
#X obj 437 764 float;
#X floatatom 437 788 15 0 0 0 last_tick - -;
#X text 396 347 bangs at end of file;
#X msg 457 283 verbose \$1;
#X text 502 263 verbosity defaults to 1;
#X text 78 12 1: choose a MIDI file to play;
#X text 216 49 2: start playing it;
#X obj 621 349 print ****;
#X obj 391 408 spigot;
#X obj 447 376 tgl 15 0 empty empty loop 17 6 0 12 -4160 -257985 -66577
0 1;
#X msg 28 65 read \$1;
#X floatatom 457 266 5 0 0 0 - - -;
#X obj 457 251 hradio 15 1 1 4 empty empty verbosity 0 -6 0 12 -62784
-241291 -1 2;
#X obj 457 37 - 1;
#X text 498 37 -1 = output all tracks;
#X obj 28 329 midifile wowo.mid;
#X msg 40 101 read I_Wanna_Be_Sedated.mid;
#X obj 28 412 list split 1;
#X obj 28 472 & 240;
#X obj 28 439 t f f;
#X obj 73 472 & 15;
#X obj 28 500 pack f f;
#X obj 28 524 list append;
#X obj 28 817 print noteon;
#X obj 64 793 print noteoff;
#X obj 100 769 print cc;
#X obj 28 547 route 144 128 176 224;
#X obj 136 744 print bend;
#X obj 172 573 print other;
#X obj 136 597 unpack f f f;
#X obj 217 622 << 7;
#X obj 176 665 +;
#X obj 136 721 pack f f;
#X text 30 842 note: noteon messages with 0 velocity are also considered
"noteoff" messages... but here they will go to the noteon outlet;
#X obj 176 688 - 8192;
#X text 111 470 <- separate channel from status;
#X text 120 817 channel \, note \, vel;
#X text 164 793 channel \, note \, vel;
#X text 166 770 channel \, cc_num \, val;
#X text 215 745 channel \, val;
#X text 500 850 Martin Peach 2009_07_09;
#X connect 0 0 36 0;
#X connect 1 0 31 0;
#X connect 2 0 1 0;
#X connect 3 0 12 0;
#X connect 4 0 36 0;
#X connect 6 0 21 1;
#X connect 7 0 8 0;
#X connect 8 0 36 0;
#X connect 9 0 36 0;
#X connect 10 0 36 0;
#X connect 11 0 34 0;
#X connect 12 0 36 0;
#X connect 16 0 36 0;
#X connect 17 0 12 1;
#X connect 18 0 17 0;
#X connect 20 0 29 0;
#X connect 20 1 4 0;
#X connect 20 2 3 0;
#X connect 20 2 21 0;
#X connect 21 0 22 0;
#X connect 24 0 36 0;
#X connect 29 0 3 0;
#X connect 30 0 29 1;
#X connect 31 0 36 0;
#X connect 32 0 24 0;
#X connect 33 0 32 0;
#X connect 34 0 10 0;
#X connect 36 0 38 0;
#X connect 36 1 6 0;
#X connect 36 2 20 0;
#X connect 36 2 28 0;
#X connect 37 0 36 0;
#X connect 38 0 40 0;
#X connect 38 1 43 1;
#X connect 39 0 42 0;
#X connect 40 0 39 0;
#X connect 40 1 41 0;
#X connect 41 0 42 1;
#X connect 42 0 43 0;
#X connect 43 0 47 0;
#X connect 47 0 44 0;
#X connect 47 1 45 0;
#X connect 47 2 46 0;
#X connect 47 3 50 0;
#X connect 47 4 49 0;
#X connect 50 0 53 0;
#X connect 50 1 52 0;
#X connect 50 2 51 0;
#X connect 51 0 52 1;
#X connect 52 0 55 0;
#X connect 53 0 48 0;
#X connect 55 0 53 1;
#X restore 76 83 pd midifile_read;
#X text 15 10 midifile reads and writes MIDI files.;
#X text 152 170 2008 Martin Peach;