Update of /cvsroot/pure-data/externals/mrpeach/midifile In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11082/midifile
Added Files: midifile-help.pd midifile.c Log Message: Source for midifile.pd with help patch
--- NEW FILE: midifile.c --- /* midifile.c v 1.2: An external for Pure Data that reads and writes MIDI files * Copyright (C) 2005 Martin Peach * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * Latest version of this file can be found at: * http://puredata.info/Members/martinrp [...1405 lines suppressed...] case 0x90: case 0xA0: case 0xB0: case 0xE0: n += 1; // data bytes break; case 0xC0: case 0xD0:// only one data byte break; } cP += n; } } x->track_chunk[index].track_index = (char *)cP - (char *)x->track_chunk[index].track_data; x->track_chunk[index].delta_time = delta_time; if (delta_time == NO_MORE_ELEMENTS) x->track_chunk[index].total_time = delta_time; else x->track_chunk[index].total_time += delta_time; }
/* fin midifile.c */
--- NEW FILE: midifile-help.pd --- #N canvas 364 491 466 316 12; #N canvas 0 0 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 text 450 563 Martin Peach , 2005; #X obj 130 77 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 206 metro 2; #X floatatom 181 149 15 0 0 0 - - -; #X msg 181 123 2.005; #X msg 267 433 flush; #X obj 275 304 makenote; #X obj 275 334 pack f f; #X msg 251 237 60; #X msg 304 237 127; #X msg 358 237 100; #X floatatom 251 263 5 0 0 0 - - -; #X floatatom 304 263 5 0 0 0 - - -; #X floatatom 358 263 5 0 0 0 - - -; #X obj 275 364 list prepend 144; #X obj 398 325 + 144; #X floatatom 398 301 5 0 0 0 - - -; #X text 447 301 channel; #X text 448 323 note-on; #X msg 17 482 verbose $1; #X text 5 437 verbosity defaults to 1; #X text 76 14 1: open a file for writing; #X text 199 89 2: start recording; #X text 439 239 3: input MIDI as lists; #X text 317 434 4: stop recording and save the file; #X obj 131 525 midifile; #X obj 15 358 savepanel; #X msg 185 388 240 1 2 3 4 247; #X text 320 388 a sysex message; #X obj 125 555 float; #X msg 15 389 write $1; #X floatatom 17 456 5 0 0 0 - - -; #X connect 0 0 28 0; #X connect 2 0 4 0; #X connect 4 0 27 0; #X connect 5 0 4 1; #X connect 6 0 5 0; #X connect 7 0 27 0; #X connect 8 0 9 0; #X connect 8 1 9 1; #X connect 9 0 16 0; #X connect 10 0 13 0; #X connect 11 0 14 0; #X connect 12 0 15 0; #X connect 13 0 8 0; #X connect 14 0 8 1; #X connect 15 0 8 2; #X connect 16 0 27 0; #X connect 17 0 16 1; #X connect 18 0 17 0; #X connect 21 0 27 0; #X connect 27 1 31 1; #X connect 27 2 31 0; #X connect 28 0 32 0; #X connect 29 0 27 0; #X connect 31 0 3 0; #X connect 32 0 27 0; #X connect 33 0 21 0; #X restore 76 116 pd midifile_write; #N canvas 388 25 825 783 midifile_read 0; #X obj 102 332 midifile wowo; #X obj 102 285 bng 15 250 50 0 empty empty step 20 10 0 8 -262144 -1 -1; #X obj 29 201 openpanel; #X obj 29 0 bng 45 250 50 0 empty empty choose 5 23 0 8 -62784 -260818 -258699; #X text 525 724 Martin Peach , 2005; #X obj 166 36 tgl 45 0 empty empty play 10 23 0 8 -24198 -1 -258699 0 1; #X msg 308 279 rewind; #X text 363 278 go to start of file; #X floatatom 151 370 15 0 0 0 tick - -; #X obj 367 176 hradio 15 1 0 16 empty empty track_number 0 -6 0 8 -62784 -241291 -1 0; #X msg 367 197 dump $1; #X msg 308 253 68050; #X msg 234 129 track $1; #X obj 234 80 hradio 15 1 0 16 empty empty track_number 0 -6 0 8 -62784 -241291 -1 0; #X obj 166 263 metro 2; #X msg 241 102 -1; #X text 272 101 output all tracks; #X text 212 332 creation arguments: midi_file_name; #X text 305 129 output only this track; #X text 430 196 parse this track to main window; #X msg 519 279 0; #X floatatom 217 206 15 0 0 0 - - -; #X msg 217 180 2.005; #X text 351 252 goto tick 68050; #X floatatom 66 575 5 0 0 0 note - -; #X floatatom 121 606 5 0 0 1 velocity - -; #X obj 31 550 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 201 403 t b b b; #X obj 205 470 float; #X floatatom 205 492 15 0 0 0 last_tick - -; #X text 207 352 bangs at end of file; #X obj 31 423 list split 1; #X obj 76 545 list split 1; #X obj 121 627 / 127; #X floatatom 121 651 5 0 0 0 - - -; #X obj 86 695 send note_amp; #X obj 31 719 send midi_pitch; #X obj 86 672 float; #X obj 31 630 float; #X msg 105 398 144; #X floatatom 106 454 5 0 0 0 - - -; #X obj 31 478 select 144; #X msg 576 291 verbose $1; #X text 576 247 verbosity defaults to 1; #X text 91 12 1: choose a MIDI file to play; #X text 228 43 2: start playing it; #X obj 297 411 print ****; #X obj 103 108 spigot; #X obj 146 82 tgl 15 0 empty empty empty 0 -6 0 8 -44926 -258699 -258699 0 1; #X text 95 79 loop; #X msg 29 239 read $1; #X floatatom 576 265 5 0 0 0 - - -; #X connect 0 0 31 0; #X connect 0 1 8 0; #X connect 0 2 27 0; #X connect 0 2 46 0; #X connect 1 0 0 0; #X connect 2 0 50 0; #X connect 3 0 2 0; #X connect 5 0 14 0; #X connect 6 0 0 0; #X connect 8 0 28 1; #X connect 9 0 10 0; #X connect 10 0 0 0; #X connect 11 0 0 0; #X connect 12 0 0 0; #X connect 13 0 12 0; #X connect 14 0 0 0; #X connect 15 0 12 0; #X connect 20 0 0 0; #X connect 21 0 14 1; #X connect 22 0 21 0; #X connect 24 0 38 1; #X connect 25 0 33 0; #X connect 26 0 38 0; #X connect 26 0 37 0; #X connect 27 0 47 0; #X connect 27 1 6 0; #X connect 27 2 5 0; #X connect 27 2 28 0; #X connect 28 0 29 0; #X connect 31 0 41 0; #X connect 31 1 32 0; #X connect 32 0 24 0; #X connect 32 1 25 0; #X connect 33 0 34 0; #X connect 34 0 37 1; #X connect 37 0 35 0; #X connect 38 0 36 0; #X connect 39 0 40 0; #X connect 40 0 41 1; #X connect 41 0 26 0; #X connect 42 0 0 0; #X connect 47 0 5 0; #X connect 48 0 47 1; #X connect 50 0 0 0; #X connect 51 0 42 0; #X restore 76 83 pd midifile_read; #X text 228 234 2006 Martin Peach; #X text 15 10 midifile reads and writes MIDI files.;