<div dir="ltr"><div><div>Hello Juan, Mario<br><br></div>LiCK contains NoteOn/NoteOff/ControlChangeMidiMsg classes that extend MidiMsg and hide some of the details.<br><br><a href="https://github.com/heuermh/lick/tree/master/lick/midi">https://github.com/heuermh/lick/tree/master/lick/midi<br></a><br></div>Here's an example of how they might be used<br><br><a href="https://github.com/heuermh/lick/blob/master/lick/midi/AnimoogMidi.ck#L104">https://github.com/heuermh/lick/blob/master/lick/midi/AnimoogMidi.ck#L104<br></a><div><br></div><div>Cheers,</div><div><br></div><div> michael<br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 22, 2018 at 5:41 PM, mario buoninfante <span dir="ltr"><<a href="mailto:mario.buoninfante@gmail.com" target="_blank">mario.buoninfante@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Juan,<br>
<br>
<br>
thanks a lot for that. I forgot there was an example about it. despite I work quite a lot with MIDI in general, from both programming and musical purposes, I've almost never used MIDI files. so, honestly I've never paid attention to that example, mea culpa :)<br>
<br>
apart from that, now I'd like to know what are the differences between MidiFileIn and MidiRW. I'll dig a bit more into the source code. in the meanwhile I updated the ChucK FLOSS manual, with at least all the methods I found on the link you sent. I'll try to get the descriptions as well as soon as possible.<br>
<br>
<br>
cheers,<br>
<br>
Mario<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
On 22/05/18 22:48, Juan Reyes wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Mario,<br>
<br>
Have used 'MidiFileIn' as per '/examples/midi/<a href="http://playmidi.ck" rel="noreferrer" target="_blank">playmidi.ck</a>'<br>
<br>
Some documentation is on:<br>
[1] <a href="https://ccrma.stanford.edu/~spencer/ckdoc/io.html#MidiFileIn" rel="noreferrer" target="_blank">https://ccrma.stanford.edu/~sp<wbr>encer/ckdoc/io.html#MidiFileIn</a><br>
<br>
BTW, Thanks to Spencer for MidiFileIn'.<br>
<br>
Tricky parts are more related to MidiMsg and actual midifile<br>
manipulation. '<a href="http://playmidi.ck" rel="noreferrer" target="_blank">playmidi.ck</a>' only triggers noteOns from the MIDI file.<br>
For NoteOffs another MidiMsg conditional (or filter for this kind of<br>
data stream on file) needs to be added. Tempo can also be manipulated by just hacking '<a href="http://playmidi.ck" rel="noreferrer" target="_blank">playmidi.ck</a>' code.<br>
<br>
Certainly one needs to get fluent on MIDI messaging hexadecimal codes.<br>
NoteOn is 0x90 and NoteOff is 0x80. NoteOffs are useful to get actual<br>
note durations. Some STK Ugens sustain forever if you don't have<br>
NoteOffs, -in fact wherever an ADSR is not used-.<br>
<br>
Below some code that works to get NoteOffs and for illustration<br>
purposes. Can post all the code or email it, in case you need it.<br>
<br>
Thanks for the MIDI Reference chapter on the ChucK FLOSS manual.<br>
<br>
-- Juan Reyes<br>
<br>
<br>
//****************************<wbr>******************************<wbr>//<br>
<br>
MidiFileIn min;<br>
MidiMsg msg;<br>
<br>
0 => int j;<br>
time delta;<br>
float beg; // start midi note<br>
0.0 => float durat;<br>
<br>
if((msg.data1 & 0xF0) == 0x90 && msg.data2 > 0 && msg.data3 > 0)<br>
{<br>
<<< j, " NOTE-ON KEY: ", msg.data2, "Velocity: ", msg.data3 >>>;<br>
1 +=> j;<br>
}<br>
<br>
if((msg.data1 & 0xF0) == 0x80)<br>
{<br>
beg-last => durat;<br>
<<< "NOTE-OFF: ",msg.data2, msg.data3, "start: ", beg, " duration: ",<br>
durat >>>;<br>
<br>
beg => last;<br>
}<br>
<br>
//****************************<wbr>******************************<wbr>//<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
at the moment there are info about MIDI also under the Event Reference, which I don't wanna touch for now. anyway, there are a couple of classes I've never seen before, MidiMsgIn, MidiMsgOut and MidiFileIn, has anyone ever used them?<br>
<br>
</blockquote></blockquote>
<br>
______________________________<wbr>_________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank">chuck-users@lists.cs.princeton<wbr>.edu</a><br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" rel="noreferrer" target="_blank">https://lists.cs.princeton.edu<wbr>/mailman/listinfo/chuck-users</a><br>
</div></div></blockquote></div><br></div>