#N canvas 576 54 571 575 10;
#X obj 2 268 cnv 3 550 3 empty empty inlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 2 332 cnv 3 550 3 empty empty outlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 2 475 cnv 3 550 3 empty empty arguments 8 12 0 13 #dcdcdc #000000 0;
#X obj 78 453 cnv 17 3 17 empty empty 6 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 78 277 cnv 17 3 50 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 78 357 cnv 17 3 17 empty empty 1 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 78 376 cnv 17 3 17 empty empty 2 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 78 395 cnv 17 3 17 empty empty 3 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 78 414 cnv 17 3 17 empty empty 4 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 78 433 cnv 17 3 17 empty empty 5 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 78 338 cnv 17 3 17 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 42 135 midiin;
#X text 129 482 (none);
#X obj 2 556 cnv 1 550 1 empty empty empty 0 0 0 4 #fcfcfc #fcfcfc 0;
#X obj 2 535 cnv 15 552 21 empty empty empty 20 12 0 14 #e0e0e0 #202020 0;
#X text 158 395 -;
#X text 118 395 float;
#X text 158 415 -;
#X text 118 415 float;
#X text 158 434 -;
#X text 118 434 float;
#X text 158 453 -;
#X text 118 453 float;
#X text 158 338 -;
#X text 125 338 list;
#X text 158 357 -;
#X text 125 357 list;
#X text 158 376 -;
#X text 125 376 list;
#X text 158 276 -;
#X text 119 276 float;
#X text 158 294 -;
#X text 125 294 bang;
#X obj 42 187 unpack;
#X text 173 276 raw MIDI data stream;
#X text 173 376 <value/controller number> pairs from control messages, f 60;
#X text 173 357 <aftertouch/pitch> pairs from polyphonic aftertouch messages;
#X text 173 338 <pitch/velocity> pairs from note messages, f 60;
#X text 173 395 value from program change messages, f 60;
#X text 173 415 value from channel aftertouch messages, f 60;
#X text 173 434 value from pitch bend messages, f 60;
#X text 173 453 the MIDI channel number from raw MIDI message, f 60;
#X text 122 90 [midiparse] receives raw MIDI data and retrieves different MIDI messages from it.;
#X text 88 134 <= MIDI from a controller;
#X obj 381 216 nbx 2 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 324 216 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 268 216 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 211 217 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 42 227 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 52 208 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 98 187 unpack;
#X obj 98 227 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 108 208 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 155 187 unpack;
#X obj 155 227 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 165 208 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#N canvas 696 108 498 480 examples 0;
#X obj 200 308 cyclone/midiformat;
#X obj 200 348 cyclone/midiparse;
#X text 67 163 [midiparse] is the counterpart of the [midiformat] object.;
#X obj 189 103 cyclone/midiparse, f 19;
#X obj 189 68 cyclone/seq;
#X text 53 22 [midiparse] is very useful to retrieve MIDI data from the [seq] object.;
#X obj 200 242 makenote 127 500;
#X obj 200 216 nbx 4 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 200 389 unpack float float;
#X obj 200 418 nbx 4 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 305 418 nbx 4 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 200 269 pack float float;
#X connect 0 0 1 0;
#X connect 1 0 8 0;
#X connect 4 0 3 0;
#X connect 6 0 11 0;
#X connect 6 1 11 1;
#X connect 7 0 6 0;
#X connect 8 0 9 0;
#X connect 8 1 10 0;
#X connect 11 0 0 0;
#X restore 475 170 pd examples;
#X obj 42 163 cyclone/midiparse @hires 2, f 57;
#N canvas 492 270 795 404 hires 0;
#X text 420 12 The Pitch Bend message is composed of 3 numbers.;
#X text 420 34 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 420 80 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 420 127 The 7 bit messages set only the Most Significant Byte.;
#X text 85 155 Check the formatted Pitch Bend messages below:;
#X text 18 12 By default \, [midiparse] retrieves 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 text 18 90 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 [midiformat] object \, which is the counterpart \, also has the same parameters.;
#X msg 361 270 hires \$1;
#X obj 361 197 vradio 15 1 0 3 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0;
#X floatatom 361 247 5 0 0 0 - - - 0;
#X obj 496 215 hsl 128 15 -1 1 0 0 empty empty empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 493 240 nbx 8 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 424 187 hsl 128 15 0 127 0 0 empty empty empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 421 213 nbx 4 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 588 240 hsl 128 15 -8192 8191 0 0 empty empty empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 585 264 nbx 6 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 361 301 cyclone/midiformat @hires 2;
#X text 87 197 0) 7 bit (integers from 0 to 127 \, default) =>;
#X text 87 212 1) 14 bit (floats from -1 to 1) ============>;
#X text 87 227 2) 14 bit (integers from -8192 to 8191) ====>;
#X obj 468 361 nbx 8 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 341 333 cyclone/midiparse @hires 2;
#X text 376 360 Pitch Bend ==>;
#X text 591 240 14 bit -8192 to 8191;
#X text 445 187 7 bit 0 to 127;
#X text 512 215 14 bit -1 to 1;
#X connect 7 0 16 0;
#X connect 7 0 21 0;
#X connect 8 0 9 0;
#X connect 9 0 7 0;
#X connect 10 0 11 0;
#X connect 11 0 16 5;
#X connect 12 0 13 0;
#X connect 13 0 16 5;
#X connect 14 0 15 0;
#X connect 15 0 16 5;
#X connect 16 0 21 0;
#X connect 21 5 20 0;
#X restore 493 193 pd hires;
#X obj 2 505 cnv 3 550 3 empty empty attribute 8 12 0 13 #dcdcdc #000000 0;
#X text 122 512 @hires <0 \, 1 \, 2> - pitch bend precision (see example above);
#X text 173 294 clears object's memory of received MIDI data;
#X text 160 311 -;
#X text 95 311 hires <f>;
#X text 175 311 sets 14-bit pitch bend input precision (see example above);
#X obj 1 2 ./header midiparse;
#X text 11 54 Retrieve MIDI messages;
#X text 37 247 Note in;
#X text 87 247 Poly touch;
#X text 157 246 Control;
#X text 207 234 Program;
#X text 259 234 Aftertouch;
#X text 331 233 Pitch Bend, f 5;
#X text 383 238 Channel;
#X connect 11 0 57 0;
#X connect 33 0 48 0;
#X connect 33 1 49 0;
#X connect 50 0 51 0;
#X connect 50 1 52 0;
#X connect 53 0 54 0;
#X connect 53 1 55 0;
#X connect 57 0 33 0;
#X connect 57 1 50 0;
#X connect 57 2 53 0;
#X connect 57 3 47 0;
#X connect 57 4 46 0;
#X connect 57 5 45 0;
#X connect 57 6 44 0;
