Skip to content

Commit

Permalink
improve readability in help-patch
Browse files Browse the repository at this point in the history
"green on red", urgh
  • Loading branch information
umlaeute committed Nov 20, 2024
1 parent d673936 commit 597790e
Showing 1 changed file with 71 additions and 104 deletions.
175 changes: 71 additions & 104 deletions midifile-help.pd
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
#N canvas 583 98 399 237 12;
#N canvas 24 112 1136 834 midifile_write 0;
#X obj 324 -2 bng 45 250 50 0 empty empty choose 5 23 0 8 -62784 -260818
-258699;
#X obj 67 65 tgl 45 0 empty empty record 2 23 0 8 -258699 -241291 -24198
0 1;
#X floatatom 553 780 15 0 0 0 tick - -;
#X obj 324 -2 bng 45 250 50 0 empty empty choose 5 23 0 10 #3c50fc #fcac44 #ffffff;
#X obj 67 65 tgl 45 0 empty empty record 2 23 0 12 #fc2828 #e8e828 #ffffff 0 1;
#X floatatom 553 780 15 0 0 0 tick - - 0;
#X obj 67 150 metro 2;
#X floatatom 120 125 15 0 0 0 - - -;
#X floatatom 120 125 15 0 0 0 - - - 0;
#X msg 120 99 2.005;
#X msg 506 590 verbose \$1;
#X text 525 544 verbosity defaults to 1;
#X obj 324 54 savepanel;
#X msg 409 493 240 1 2 3 4 247;
#X text 536 492 a sysex message;
#X obj 553 750 float;
#X floatatom 506 564 5 0 0 0 - - -;
#X floatatom 506 564 5 0 0 0 - - - 0;
#X msg 324 408 write \$1 \$2 \$3;
#X msg 350 199 29;
#X msg 388 199 30;
#X msg 235 199 0;
#X floatatom 405 275 5 0 0 0 ticks_per_frame - -;
#X text 80 301 (ticks per quarter note if frames per second is zero)
;
#X floatatom 405 275 5 0 0 0 ticks_per_frame - - 0;
#X text 80 301 (ticks per quarter note if frames per second is zero);
#X msg 312 199 25;
#X msg 272 199 24;
#X text 79 322 25 20 will give accurate timing with metro ticks at
2ms;
#X text 79 322 25 20 will give accurate timing with metro ticks at 2ms;
#X obj 324 375 pack s 25 20;
#X obj 559 663 midifile;
#X text 7 199 time code frames per second:;
Expand All @@ -34,32 +30,28 @@
#X msg 374 458 write filename.mid 77;
#X text 555 457 77 ticks per quarter note;
#X msg 442 526 flush;
#X obj 268 146 cnv 15 200 20 empty empty empty 20 12 0 14 -257985 -66577
0;
#X floatatom 514 145 5 0 0 0 note - -;
#X floatatom 514 175 5 0 0 0 velocity - -;
#X obj 268 146 cnv 15 200 20 empty empty empty 20 12 0 14 #f8fc00 #404040 0;
#X floatatom 514 145 5 0 0 0 note - - 0;
#X floatatom 514 175 5 0 0 0 velocity - - 0;
#X obj 558 333 pack 144 0 0;
#X obj 577 179 sel 0;
#X obj 558 206 t b f;
#X obj 558 307 f;
#X text 553 565 set to 3 to debug input;
#X obj 558 125 notein;
#X obj 102 8 cnv 15 220 20 empty empty empty 20 12 0 14 -257985 -66577
0;
#X obj 102 8 cnv 15 220 20 empty empty empty 20 12 0 14 #f8fc00 #404040 0;
#X text 104 10 1: open a file for writing:;
#X obj 116 64 cnv 15 150 20 empty empty empty 20 12 0 14 -257985 -66577
0;
#X obj 116 64 cnv 15 150 20 empty empty empty 20 12 0 14 #f8fc00 #404040 0;
#X text 118 67 2: start recording;
#X obj 142 524 cnv 15 300 20 empty empty empty 20 12 0 14 -257985 -66577
0;
#X text 150 526 4: stop recording and save the file:;
#X floatatom 512 230 5 0 0 0 channel - -;
#X obj 122 524 cnv 15 300 20 empty empty empty 20 12 0 14 #f8fc00 #404040 0;
#X text 130 526 4: stop recording and save the file:;
#X floatatom 512 230 5 0 0 0 channel - - 0;
#X obj 609 287 +;
#X msg 577 235 127;
#X msg 609 207 143;
#X floatatom 919 103 5 0 0 0 value - -;
#X floatatom 919 134 5 0 0 0 controller - -;
#X floatatom 917 183 5 0 0 0 channel - -;
#X floatatom 919 103 5 0 0 0 value - - 0;
#X floatatom 919 134 5 0 0 0 controller - - 0;
#X floatatom 917 183 5 0 0 0 channel - - 0;
#X obj 965 83 ctlin;
#X obj 965 237 pack 176 0 0;
#X obj 965 269 print ctl>;
Expand All @@ -73,12 +65,10 @@
#X msg 882 518 144 60 64;
#X msg 863 549 144 67 64;
#X msg 953 549 144 67 0;
#X obj 778 500 hradio 15 1 0 8 empty empty empty 0 -8 0 10 -262144
-1 -1 0;
#X obj 778 500 hradio 15 1 0 8 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 0;
#X obj 708 633 r midiwrite;
#N canvas 141 452 1100 497 meta_messages 0;
#X text 71 6 FF 51 3 tttttt Set Tempo (in microseconds per MIDI quarter-note)
;
#X text 71 6 FF 51 3 tttttt Set Tempo (in microseconds per MIDI quarter-note);
#X obj 539 526 s midiwrite;
#X text 407 196 Instrument Name;
#X text 399 220 Lyric;
Expand All @@ -103,8 +93,7 @@
#X text 555 384 Time Signature;
#X msg 418 385 meta 88 6 3 36 8;
#X msg 441 408 meta 89 0 0;
#X text 538 407 Key Signature (number of sharps(+) / flats(-) 0 or
1 for major or minor;
#X text 538 407 Key Signature (number of sharps(+) / flats(-) 0 or 1 for major or minor;
#X msg 481 448 meta 127 0 1 22 33 44 55;
#X text 683 449 Sequencer-Specific Meta-Event;
#X msg 509 476 meta 52;
Expand All @@ -116,8 +105,7 @@
#X msg 184 151 meta 2 (C)2018_Nobody_At_All;
#X msg 207 174 meta 3 amazing_sequence;
#X msg 254 221 meta 5 "what_the";
#X text 575 143 Underscore will be replaced by space in text metas
;
#X text 575 143 Underscore will be replaced by space in text metas;
#X connect 8 0 1 0;
#X connect 10 0 1 0;
#X connect 13 0 1 0;
Expand All @@ -136,10 +124,8 @@
#X connect 35 0 1 0;
#X connect 36 0 1 0;
#X restore 561 87 pd meta_messages;
#X obj 506 532 hradio 15 1 0 5 empty empty verbosity 0 -6 0 12 -62784
-241291 -1 4;
#X obj 174 86 cnv 15 380 20 empty empty empty 20 12 0 14 -257985 -66577
0;
#X obj 506 532 hradio 15 1 0 5 empty empty verbosity 0 -6 0 12 #3c50fc #e8e828 #000000 0;
#X obj 174 86 cnv 15 380 20 empty empty empty 20 12 0 14 #f8fc00 #404040 0;
#X text 180 86 Maybe add some meta messages before we start:;
#X text 780 478 choose track to write;
#X text 753 744 Martin Peach \, 2010 - 2018;
Expand Down Expand Up @@ -205,71 +191,59 @@
#X connect 68 0 12 0;
#X restore 76 116 pd midifile_write;
#N canvas 240 205 914 702 midifile_read 0;
#X obj 544 149 bng 15 250 50 0 empty empty step_one_tick 18 7 0 12
-4160 -257985 -1;
#X obj 544 149 bng 15 250 50 0 empty empty step_one_tick 18 7 0 12 #0400fc #f8fc00 #000000;
#X obj 12 69 openpanel;
#X obj 12 16 bng 45 250 50 0 empty empty choose 3 23 0 12 -62784 -260818
-258699;
#X obj 116 151 tgl 45 0 empty empty play -45 23 0 12 -24198 -1 -258699
1 1;
#X obj 12 16 bng 45 250 50 0 empty empty choose 3 23 0 12 #3c50fc #fcac44 #fc2828;
#X obj 116 151 tgl 45 0 empty empty play -45 23 0 12 #14e814 #000000 #fc2828 0 1;
#X msg 391 478 rewind;
#X text 235 477 go to start of file;
#X floatatom 461 570 15 0 0 0 current_tick - -;
#X obj 235 301 hradio 15 1 0 16 empty empty dump_track_number 0 -6
0 12 -62784 -241291 -1 0;
#X floatatom 461 570 15 0 0 0 current_tick - - 0;
#X obj 235 301 hradio 15 1 0 16 empty empty dump_track_number 0 -6 0 12 #3c50fc #e8e828 #000000 0;
#X msg 235 322 dump \$1;
#X msg 354 441 68050;
#X msg 179 266 track \$1;
#X obj 179 226 hradio 15 1 0 16 empty empty play_track_number 0 -6
0 12 -62784 -241291 -1 7;
#X obj 179 226 hradio 15 1 0 16 empty empty play_track_number 0 -6 0 12 #3c50fc #e8e828 #000000 0;
#X obj 116 203 metro 2;
#X text 193 542 creation arguments: midi_file_name;
#X text 298 321 parse this track to main window;
#X floatatom 709 660 15 0 0 0 last_tick - -;
#X floatatom 709 660 15 0 0 0 last_tick - - 0;
#X msg 311 398 verbose \$1;
#X text 123 398 verbosity defaults to 1;
#X text 63 11 1: choose a MIDI file to play;
#X text 169 145 2: start playing it;
#X obj 435 424 spigot;
#X obj 480 390 tgl 25 0 empty empty loop -45 12 0 12 -4160 -257985
-258113 1 1;
#X obj 480 390 tgl 25 0 empty empty loop -45 12 0 12 #0400fc #f8fc00 #fc0400 0 1;
#X msg 12 99 read \$1;
#X floatatom 311 374 5 0 0 0 - - -;
#X obj 311 355 hradio 15 1 0 5 empty empty verbosity 0 -6 0 12 -62784
-241291 -1 1;
#X floatatom 311 374 5 0 0 0 - - - 0;
#X obj 311 355 hradio 15 1 0 5 empty empty verbosity 0 -6 0 12 #3c50fc #e8e828 #000000 0;
#X obj 179 243 - 1;
#X obj 65 505 ctlout 123;
#X msg 65 475 123;
#X msg 39 126 read I_Wanna_Be_Sedated.mid;
#X obj 65 447 bng 15 250 50 0 empty empty all_notes_off 17 7 0 10 -258113
-257985 -1;
#X obj 65 447 bng 15 250 50 0 empty empty all_notes_off 17 7 0 10 #fc0400 #f8fc00 #000000;
#X obj 718 590 t b b;
#X floatatom 134 263 5 0 0 0 - - -;
#X obj 750 617 bng 15 250 50 0 empty empty end 17 7 0 10 -258113 -257985
-1;
#X floatatom 632 433 9 0 0 0 loop_start_tick: - -;
#X floatatom 134 263 5 0 0 0 - - - 0;
#X obj 750 617 bng 15 250 50 0 empty empty end 17 7 0 10 #fc0400 #f8fc00 #000000;
#X floatatom 632 433 9 0 0 0 loop_start_tick: - - 0;
#X text 214 243 -1 = play all tracks;
#X obj 709 638 f;
#X obj 435 450 f 0;
#N canvas 302 192 1058 571 route_events 0;
#X obj 20 29 inlet;
#X floatatom 172 125 5 0 0 0 note - -;
#X floatatom 249 125 5 0 0 1 velocity - -;
#X obj 172 50 route 144 145 146 147 148 149 150 151 152 153 154 155
156 157 158 159, f 80;
#X floatatom 172 125 5 0 0 0 note - - 0;
#X floatatom 249 125 5 0 0 1 velocity - - 0;
#X obj 172 50 route 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159, f 80;
#X obj 172 103 unpack 0 0;
#X obj 178 182 route 128 129 130 131 132 133 134 135 136 137 138 139
140 141 142 143, f 79;
#X obj 178 182 route 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143, f 79;
#X obj 76 146 print note_on;
#X obj 76 260 print note_off;
#X obj 705 261 noteout 1;
#X obj 786 261 noteout 2;
#X obj 865 261 noteout 3;
#X obj 945 261 noteout 4;
#X obj 178 289 route 176 177 178 179 180 181 182 183 184 185 186 187
188 189 190 191 192, f 80;
#X floatatom 178 347 5 0 0 0 controller - -;
#X floatatom 252 347 5 0 0 1 value - -;
#X obj 178 289 route 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192, f 80;
#X floatatom 178 347 5 0 0 0 controller - - 0;
#X floatatom 252 347 5 0 0 1 value - - 0;
#X obj 178 323 unpack 0 0;
#X obj 52 372 print controller;
#X obj 706 359 ctlout 1;
Expand All @@ -281,8 +255,7 @@
#X obj 179 502 print sysex;
#X obj 76 118 spigot;
#X obj 95 24 inlet;
#X obj 23 71 tgl 15 0 empty empty print_status_names 17 7 0 10 -4034
-1 -1 0 1;
#X obj 23 71 tgl 15 0 empty empty print_status_names 17 7 0 10 #00fc04 #000000 #000000 0 1;
#X obj 77 232 spigot;
#X obj 52 345 spigot;
#X obj 179 463 spigot;
Expand Down Expand Up @@ -333,35 +306,33 @@
#X restore 435 593 pd route_events;
#N canvas 114 197 1088 523 route_info 0;
#X obj 34 13 inlet;
#X floatatom 34 73 3 0 0 1 format - -;
#X floatatom 142 73 5 0 0 1 tracks - -;
#X floatatom 252 73 5 0 0 1 ticks_per_quarternote - -;
#X floatatom 360 140 5 0 0 1 tracks - -;
#X symbolatom 546 190 40 0 0 0 - - -;
#X floatatom 34 73 3 0 0 1 format - - 0;
#X floatatom 142 73 5 0 0 1 tracks - - 0;
#X floatatom 252 73 5 0 0 1 ticks_per_quarternote - - 0;
#X floatatom 360 140 5 0 0 1 tracks - - 0;
#X symbolatom 546 190 40 0 0 0 - - - 0;
#X obj 538 224 unpack 0 0;
#X floatatom 615 278 15 0 0 0 last_tick - -;
#X floatatom 538 250 5 0 0 1 track - -;
#X floatatom 449 190 5 0 0 1 track - -;
#X floatatom 615 278 15 0 0 0 last_tick - - 0;
#X floatatom 538 250 5 0 0 1 track - - 0;
#X floatatom 449 190 5 0 0 1 track - - 0;
#X obj 449 164 unpack 0 s;
#X obj 627 316 unpack 0 0 0 0;
#X floatatom 627 352 3 0 0 1 / - -;
#X floatatom 663 353 3 0 0 1 - - -;
#X floatatom 699 353 5 0 0 1 clocks_per_click - -;
#X floatatom 736 379 5 0 0 1 32nds_per_quarternote - -;
#X floatatom 716 136 15 0 0 0 microsec_per_quarternote - -;
#X floatatom 627 352 3 0 0 1 / - - 0;
#X floatatom 663 353 3 0 0 1 - - - 0;
#X floatatom 699 353 5 0 0 1 clocks_per_click - - 0;
#X floatatom 736 379 5 0 0 1 32nds_per_quarternote - - 0;
#X floatatom 716 136 15 0 0 0 microsec_per_quarternote - - 0;
#X obj 229 354 /;
#X floatatom 442 374 15 0 0 0 microsec_per_tick - -;
#X floatatom 442 374 15 0 0 0 microsec_per_tick - - 0;
#X obj 229 395 / 1000;
#X floatatom 229 426 15 0 0 0 millisec_per_tick - -;
#X floatatom 229 426 15 0 0 0 millisec_per_tick - - 0;
#X obj 906 190 print other_meta;
#X obj 360 103 route seq_num name end time_sig microsec_per_quarternote
;
#X obj 360 103 route seq_num name end time_sig microsec_per_quarternote;
#X obj 805 161 route key_sig;
#X obj 805 218 unpack 0 0 s;
#X symbolatom 898 323 10 0 0 0 key - -;
#X floatatom 805 247 5 0 0 1 +sharps/-flats - -;
#X obj 851 276 tgl 15 0 empty empty minor 17 7 0 10 -262144 -1 -1 0
1;
#X symbolatom 898 323 10 0 0 0 key - - 0;
#X floatatom 805 247 5 0 0 1 +sharps/-flats - - 0;
#X obj 851 276 tgl 15 0 empty empty minor 17 7 0 10 #fcfcfc #000000 #000000 0 1;
#X obj 546 164 list prepend;
#X obj 898 297 list prepend;
#X obj 34 43 route format tracks ticks_per_quarternote;
Expand Down Expand Up @@ -405,14 +376,12 @@
#X obj 718 562 route bang;
#X text 222 441 goto tick 68050:;
#X obj 386 147 r msec_per_tick;
#X floatatom 386 186 9 0 0 0 - - -;
#X floatatom 386 186 9 0 0 0 - - - 0;
#X text 81 593 MIDI messages are output on first outlet as lists:;
#X text 386 108 milliseconds per tick is calculated from metadata at
start of file. Step one tick to get the initial value.;
#X text 386 108 milliseconds per tick is calculated from metadata at start of file. Step one tick to get the initial value.;
#X obj 435 542 midifile;
#X text 548 541 meta data \, bang at end of file on third outlet;
#X obj 573 578 tgl 15 1 empty empty print_status_names 17 7 0 10 -4034
-1 -1 0 1;
#X obj 573 578 tgl 15 1 empty empty print_status_names 17 7 0 10 #00fc04 #000000 #000000 0 1;
#X text 728 676 Martin Peach \, 2011-2020;
#X connect 0 0 45 0;
#X connect 1 0 22 0;
Expand Down Expand Up @@ -454,16 +423,14 @@ start of file. Step one tick to get the initial value.;
#X restore 76 83 pd midifile_read;
#X text 15 10 midifile reads and writes MIDI files.;
#N canvas 403 187 587 265 META 0;
#X text 12 185 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan
Wilkes for Pd version 0.42.;
#X text 12 185 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.;
#X text 12 25 LICENSE GPL v2 or later;
#X text 12 165 AUTHOR Martin Peach;
#X text 12 5 KEYWORDS control MIDI;
#X text 12 45 DESCRIPTION read and write MIDI files;
#X text 12 105 OUTLET_0 list;
#X text 12 125 OUTLET_1 float;
#X text 12 65 INLET_0 bang float list rewind read track dump verbose
write meta flush;
#X text 12 65 INLET_0 bang float list rewind read track dump verbose write meta flush;
#X text 12 145 OUTLET_2 bang \, list;
#X restore 335 202 pd META;
#X text 148 203 2020/06/10 Martin Peach;

0 comments on commit 597790e

Please sign in to comment.