#N canvas 396 23 563 688 10;
#X obj 3 414 cnv 3 550 3 empty empty inlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 3 575 cnv 3 550 3 empty empty outlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 3 603 cnv 3 550 3 empty empty arguments 8 12 0 13 #dcdcdc #000000 0;
#X obj 84 554 cnv 17 3 17 empty empty 6 5 9 0 16 #dcdcdc #9c9c9c 0;
#X msg 135 171 88 127;
#X obj 105 291 midiout;
#X msg 186 132 90 88;
#X obj 84 581 cnv 17 3 17 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 84 454 cnv 17 3 17 empty empty 1 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 84 474 cnv 17 3 17 empty empty 2 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 84 494 cnv 17 3 17 empty empty 3 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 84 514 cnv 17 3 17 empty empty 4 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 84 534 cnv 17 3 17 empty empty 5 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 84 421 cnv 17 3 29 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 3 681 cnv 1 550 1 empty empty empty 0 0 0 4 #fcfcfc #fcfcfc 0;
#X obj 3 660 cnv 15 552 21 empty empty empty 20 12 0 14 #e0e0e0 #202020 0;
#X msg 153 194 88 0;
#X text 168 495 -;
#X text 127 495 float;
#X text 168 516 -;
#X text 127 516 float;
#X text 168 536 -;
#X text 127 536 float;
#X text 168 555 -;
#X text 127 555 float;
#X text 168 422 -;
#X text 168 456 -;
#X text 168 475 -;
#X text 168 582 -;
#X text 127 582 float;
#X text 168 608 -;
#X text 109 609 1) float;
#X text 98 170 Note;
#X text 90 189 On/Off;
#X obj 243 180 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 329 239 nbx 2 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 272 200 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 300 219 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 158 291 print raw_midi;
#X text 133 422 list;
#X text 133 456 list;
#X text 133 475 list;
#X msg 215 156 127 1;
#X text 183 422 <pitch/velocity> pairs for note on/off messages;
#X text 183 495 program change value for program change message, f 59;
#X text 183 516 channel aftertouch value for channel aftertouch message, f 59;
#X text 183 536 pitch bend value for pitch bend message, f 59;
#X text 183 582 raw MIDI messages, f 60;
#X text 183 609 channel number (default 1), f 58;
#X text 52 87 [midiformat] receives different MIDI information in each inlet and formats to a raw MIDI message output.;
#X text 184 456 <aftertouch/pitch> pairs for polyphonic aftertouch messages;
#X text 183 475 <value/controller number> pairs for control messages;
#X text 183 555 channel number (wraps at 16) - doesn't output MIDI messages;
#N canvas 863 73 414 536 examples 0;
#X obj 131 70 makenote 127 250;
#X obj 131 101 pack;
#X obj 131 133 cyclone/midiformat;
#X obj 131 165 cyclone/seq;
#X text 25 15 using [midiformat] to get note messages from a [makenote] object and send it to a [seq] object;
#X text 35 222 [midiformat] is the counterpart of the [midiparse] object. Please check it too.;
#X obj 195 363 cyclone/midiformat;
#X obj 195 403 cyclone/midiparse;
#X obj 195 297 makenote 127 500;
#X obj 195 324 pack;
#X obj 195 271 nbx 4 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 195 444 unpack float float;
#X obj 195 473 nbx 4 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 300 473 nbx 4 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X connect 0 0 1 0;
#X connect 0 1 1 1;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 6 0 7 0;
#X connect 7 0 11 0;
#X connect 8 0 9 0;
#X connect 8 1 9 1;
#X connect 9 0 6 0;
#X connect 10 0 8 0;
#X connect 11 0 12 0;
#X connect 11 1 13 0;
#X restore 469 216 pd examples;
#X obj 158 260 cyclone/midiformat 5 @hires 2;
#N canvas 341 79 805 403 hires 0;
#X text 21 17 By default \, [midiformat] receives a low resolution 7 bit (values from 0 to 127) for Pitch Bend messages \, but the 'hires' message or attribute sets to a high resolution of 14 bits \, which has been the usual resolution for Pitch Bend messages for a long time.;
#X msg 331 269 hires \$1;
#X obj 331 196 vradio 15 1 0 3 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0;
#X floatatom 331 246 5 0 0 0 - - - 0;
#X obj 466 214 hsl 128 15 -1 1 0 0 empty empty empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 463 239 nbx 8 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 394 186 hsl 128 15 0 127 0 0 empty empty empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 391 212 nbx 4 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 558 239 hsl 128 15 -8192 8191 0 0 empty empty empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 555 263 nbx 6 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 423 17 The Pitch Bend message is composed of 3 numbers.;
#X text 423 39 The first one determines it's a Pitch Bend message and it is 224 for channel 1 (225 for channel 2 \, and so on up to 239 for channel 16).;
#X text 423 85 Then we have the two subsequent numbers that decode the Pitch Bend Value. First there's the Least Significant Byte and then the Most Significant Byte.;
#X text 423 132 The 7 bit messages set only the Most Significant Byte.;
#X obj 331 300 cyclone/midiformat @hires 2;
#X text 57 196 0) 7 bit (integers from 0 to 127 \, default) =>;
#X text 57 211 1) 14 bit (floats from -1 to 1) ============>;
#X text 57 226 2) 14 bit (integers from -8192 to 8191) ====>;
#X obj 438 360 nbx 8 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 79 160 Check the formatted Pitch Bend messages below:;
#X obj 311 332 cyclone/midiparse @hires 2;
#X text 346 359 Pitch Bend ==>;
#X text 561 239 14 bit -8192 to 8191;
#X text 415 186 7 bit 0 to 127;
#X text 482 214 14 bit -1 to 1;
#X text 21 94 The possible values are 0 (default \, 7 bits) \, 1 (14 bit as float values from -1 to 1) and 2 (14 bits as integer values from -8192 to 8191). The [midiparse] object \, which is the counterpart \, also has the same parameters.;
#X obj 504 326 print MIDI_FORMAT;
#X connect 1 0 14 0;
#X connect 1 0 20 0;
#X connect 2 0 3 0;
#X connect 3 0 1 0;
#X connect 4 0 5 0;
#X connect 5 0 14 5;
#X connect 6 0 7 0;
#X connect 7 0 14 5;
#X connect 8 0 9 0;
#X connect 9 0 14 5;
#X connect 14 0 20 0;
#X connect 14 0 26 0;
#X connect 20 5 18 0;
#X restore 487 239 pd hires;
#X text 168 437 -;
#X text 103 437 hires <f>;
#X text 183 437 sets 14-bit pitch bend input precision (see example above);
#X obj 3 630 cnv 3 550 3 empty empty attribute 8 12 0 13 #dcdcdc #000000 0;
#X text 123 637 @hires <0 \, 1 \, 2> - pitch bend precision (see example above);
#X obj 2 1 ./header midiformat;
#X text 23 63 Format MIDI messages;
#X text 225 132 Polyphonic Aftetoutch <pitch \, pressure>;
#X text 254 156 Control Change <value \, control #>;
#X text 286 179 Program change;
#X text 312 199 Channel Aftertouch;
#X text 339 218 Pitch Bend;
#X text 363 240 MIDI Channel;
#X text 71 152 <Note / Velocity>;
#X text 35 333 see also:;
#X text 205 346 Plugdata users or those with ELSE can use dedicated objects like [else/note.out] as alternatives, f 33;
#N canvas 787 189 244 299 else 0;
#X obj 58 233 open-else;
#X msg 59 48 note.out;
#X msg 73 77 ctl.out;
#X msg 84 104 pgm.out;
#X msg 106 155 ptouch.out;
#X msg 93 131 touch.out;
#X msg 112 182 bend.out;
#X text 60 18 click:;
#X connect 1 0 0 0;
#X connect 2 0 0 0;
#X connect 3 0 0 0;
#X connect 4 0 0 0;
#X connect 5 0 0 0;
#X connect 6 0 0 0;
#X restore 434 355 pd else alternatives;
#X f 12;
#X text 161 87 click;
#X text 443 335 click:;
#X obj 54 354 cyclone/midiparse;
#X obj 100 333 noteout;
#X text 152 333 etc;
#X obj 56 377 cyclone/xnoteout;
#X connect 4 0 54 0;
#X connect 6 0 54 1;
#X connect 16 0 54 0;
#X connect 34 0 54 3;
#X connect 35 0 54 6;
#X connect 36 0 54 4;
#X connect 37 0 54 5;
#X connect 42 0 54 2;
#X connect 54 0 5 0;
#X connect 54 0 38 0;
