#N canvas 125 172 863 779 8;
#N canvas 703 407 957 374 send_receive_note_on 0;
#X floatatom 280 149 10 0 0 0 - - -;
#X floatatom 280 170 5 0 0 0 - - -;
#X floatatom 280 191 5 0 0 0 - - -;
#X floatatom 279 212 5 0 0 0 - - -;
#X floatatom 279 234 5 0 0 0 - - -;
#X text 156 151 1 Note id;
#X text 156 170 2 Note number (float);
#X text 161 191 3 Volume (0-1);
#X text 157 212 4 Track Pan (-1 - 1);
#X obj 353 109 r_note_on ____________________________;
#X obj 751 106 r_line __________;
#X obj 545 201 +;
#X obj 713 28 r_float note_on_delay 0 0 1;
#X floatatom 732 203 15 0 0 0 - - -;
#X floatatom 832 163 15 0 0 0 - - -;
#X obj 706 151 *;
#X text 403 58 Receive and send note on;
#X obj 365 252 r_send_note_on _____________________;
#X obj 600 95 inlet;
#X obj 400 219 +;
#X obj 431 218 *;
#X obj 644 94 inlet;
#X text 90 233 5 Frames within this block (0 - 64);
#X connect 9 0 0 0;
#X connect 9 0 17 0;
#X connect 9 1 1 0;
#X connect 9 1 19 0;
#X connect 9 2 2 0;
#X connect 9 2 20 0;
#X connect 9 3 3 0;
#X connect 9 3 17 3;
#X connect 9 4 4 0;
#X connect 9 4 11 0;
#X connect 10 5 14 0;
#X connect 10 5 15 1;
#X connect 11 0 17 5;
#X connect 12 0 15 0;
#X connect 15 0 11 1;
#X connect 15 0 13 0;
#X connect 18 0 19 1;
#X connect 19 0 17 1;
#X connect 20 0 17 2;
#X connect 21 0 20 1;
#X restore -2756 162 pd send_receive_note_on;
#X text -2397 548 It's also possible to ignore the time values and
send -1 back to radium for the "seconds" and "frames" parameter. If
that happens \, Radium will use current time instead.;
#X text -2656 283 About Note Id;
#X text -2288 283 About Time;
#X text -2761 315 "Note id" is the identifier used by Radium to recognize
notes. The id number wraps around when reaching 32768 This means that
very old id numbers can not be used safely since a newer note might
have replaced the old id. The reason for doing it this way is that
there is no 64 bit integer type in Pd (the native note id format in
Radium) \, so the id numbers are stored in a table instead \, and the
index to that table is what we see use in Pd.;
#N canvas 470 628 983 369 send_receive_velocity 0;
#X floatatom 320 153 10 0 0 0 - - -;
#X floatatom 320 174 5 0 0 0 - - -;
#X floatatom 320 195 5 0 0 0 - - -;
#X floatatom 320 217 5 0 0 0 - - -;
#X text 169 154 1 Note id;
#X text 169 173 2 Note number (float);
#X obj 761 116 r_line __________;
#X obj 672 193 +;
#X floatatom 742 213 15 0 0 0 - - -;
#X floatatom 842 173 15 0 0 0 - - -;
#X obj 716 161 *;
#X text 413 68 Receive and send note velocity;
#X obj 363 119 r_velocity ____________________________;
#X obj 501 237 r_send_velocity _____________________;
#X text 174 194 3 Velocity (0-1);
#X obj 723 38 r_float velocity_delay 0 0 1;
#X obj 623 63 inlet;
#X obj 550 202 *;
#X text 171 219 4 Delta time (0 - 64);
#X connect 6 5 9 0;
#X connect 6 5 10 1;
#X connect 7 0 13 4;
#X connect 10 0 7 1;
#X connect 10 0 8 0;
#X connect 12 0 0 0;
#X connect 12 0 13 0;
#X connect 12 1 1 0;
#X connect 12 1 13 1;
#X connect 12 2 2 0;
#X connect 12 2 17 0;
#X connect 12 3 3 0;
#X connect 12 3 7 0;
#X connect 15 0 10 0;
#X connect 16 0 17 1;
#X connect 17 0 13 2;
#X restore -2550 161 pd send_receive_velocity;
#N canvas 652 463 1154 449 send_receive_pitch 0;
#X floatatom 330 163 10 0 0 0 - - -;
#X floatatom 330 184 5 0 0 0 - - -;
#X floatatom 330 205 10 0 0 0 - - -;
#X floatatom 330 227 5 0 0 0 - - -;
#X text 179 164 1 Note id;
#X text 179 183 2 Note number (float);
#X obj 766 123 r_line __________;
#X obj 677 200 +;
#X floatatom 747 220 15 0 0 0 - - -;
#X floatatom 847 180 15 0 0 0 - - -;
#X obj 721 168 *;
#X obj 373 129 r_pitch ____________________________;
#X text 423 78 Receive and send note pitch;
#X obj 516 269 r_send_pitch _____________________;
#X obj 728 45 r_float pitch_delay 0 0 1;
#X obj 667 44 inlet;
#X text 184 204 3 Pitch (float) (0-128);
#X obj 564 239 +;
#X text 181 224 4 Delta time (0 - 64);
#X connect 6 5 9 0;
#X connect 6 5 10 1;
#X connect 7 0 13 4;
#X connect 10 0 7 1;
#X connect 10 0 8 0;
#X connect 11 0 0 0;
#X connect 11 0 13 0;
#X connect 11 1 1 0;
#X connect 11 1 13 1;
#X connect 11 2 2 0;
#X connect 11 2 17 0;
#X connect 11 3 3 0;
#X connect 11 3 7 0;
#X connect 14 0 10 0;
#X connect 15 0 17 1;
#X connect 17 0 13 2;
#X restore -2549 203 pd send_receive_pitch;
#X obj -2735 39 r_float pitch_add -128 0 128;
#X obj -2541 38 r_float main_velocity 0 1 9;
#X obj -2324 46 cnv 15 300 100 empty empty empty 20 12 0 14 -260097
-66577 0;
#X text -2397 314 "Time" consists of two numbers. The first number
("seconds") denotes number of seconds \, the second number ("frames")
denotes the number of frames. These two values create a frame-accurate
time value. Pd doesn't have a 64 bit integer type \, so we need two
values.;
#X text -2321 89 It gives you full access to all internal event data
in Radium. Alternatively \, the much simpler MIDI API can be used instead.
However \, the MIDI API doesn't give access to frame accuracy \, pitch
changes and micro-tonality.;
#X text -2323 52 This is the ADVANCED API to receive and send note
events from and to Radium.;
#X obj -2750 238 r_notes ___________________;
#X text -2593 237 <- Convenience patch to receive both note ons and
offs;
#X text -2761 413 If the note id number could wrap around \, it's better
to ignore it \, and use -1 instead. If Radium receives -1 as note id
\, it will calculate a new id number based on the pitch. Note that
it's not safe to use -1 if the patch only handles volume or pitch events.
"Note on" and "note off" events must be handled as well \, where the
id must be converted to -1 for these events as well. If not \, you
risk modifying wrong or non-existing notes. The only disadvantage of
using -1 instead of the supplied note id is that we will modify data
for all notes with approximately the same pitch \, not just the current
note.;
#X text -2398 380 When sending events back to radium \, time can be
maniuplated in order to schedule events frame-accurately into the future.
;
#X text -2397 425 Note that "frames" is not limited within 0 and sample
rate. For instance \, if you want to add 1/2 second to the time \,
it's perfectly fine to just add sample_rate/2 to the "frames" parameter.
Radium understands. Similarly \, adding 1/2 second can be performed
by just adding 0.5 to the "seconds" value. But be aware that the "frames"
parameter can easily overflow due to limitations of the float format
\, so for larger values \, it's better to modify "seconds" and not
"frames". And for larger values which has to be frame-accurate (probably
extremely rare...) \, both "seconds" and "frames" must be modified.
;
#X text -2394 598 "Delta time" is the number of frames into this Pd
audio period the note is defined to start playing. This number is useful
if you want to frame-accurately generate sound from pd \, not just
send the event back to radium. However \, since the Pd block size is
only 64 frames \, it is usually not possible to notice any difference
whether you start playing from frame 0 \, or from the frame number
"delta time" \, unless the notes are placed very close together.;
#N canvas 864 651 956 427 send_receive_note_off 0;
#X floatatom 286 159 10 0 0 0 - - -;
#X floatatom 286 180 5 0 0 0 - - -;
#X floatatom 286 201 5 0 0 0 - - -;
#X text 97 161 1 Note id;
#X text 97 180 2 Note number (float);
#X obj 636 107 r_line __________;
#X obj 547 184 +;
#X floatatom 617 204 15 0 0 0 - - -;
#X floatatom 717 164 15 0 0 0 - - -;
#X obj 591 152 *;
#X text 413 68 Receive and send note off;
#X obj 363 119 r_note_off ____________________________;
#X obj 362 233 r_send_note_off _____________________;
#X obj 598 29 r_float note_off_delay 0 0 1;
#X text 96 200 3 Frames withtin this block(0 - 64);
#X text 592 232 <- The third argument for r_send_note_off is number
of seconds to add to current time. May be useful for large time values.
;
#X connect 5 5 8 0;
#X connect 5 5 9 1;
#X connect 6 0 12 3;
#X connect 9 0 6 1;
#X connect 9 0 7 0;
#X connect 11 0 0 0;
#X connect 11 0 12 0;
#X connect 11 1 1 0;
#X connect 11 1 12 1;
#X connect 11 2 2 0;
#X connect 11 2 6 0;
#X connect 13 0 9 0;
#X restore -2754 201 pd send_receive_note_off;
#X obj -2264 214 r_time;
#X text -2215 215 <- Get time from radium;
#X obj -2264 192 r_line;
#X text -2211 192 <- Get line from radium;
#X obj -2266 170 r_visibleline;
#X text -2182 170 <- Get visible line from radium;
#X connect 7 0 6 0;
#X connect 7 0 0 0;
#X connect 8 0 5 0;
#X connect 8 0 0 1;
