Hi,
I am trying to implement a midi
sequencer in chuck and aparrently
do not understand how time is
advanced.
The script below works fine for
one track midi files but
more than than and, it seems like
events get lost.
I tried something similar. where
I used multiple files and that
worked, except there is no way
to pass the filename, etc from
a driver file so Id have to
wrap it in a shell script
any suggestions appreciated.
davud
---midisequencer.ck--------------
MidiFileIn min;
MidiOut mout;
MidiMsg msg;
int done;
string filename;
me.arg(0) => filename;
if( !min.open(filename) ){
<<< "unable to open MIDI file:'",filename >>>;
me.exit();
}
mout.open(0);
for( int t; t < min.numTracks(); t++ )
spork ~ track(t );
while( done < min.numTracks() )
1::second => now;
function void track(int a) {
while( min.read(msg,a))
{
<<
Hi Davud, have you seen this example? https://cannerycoders.com/docs/chuck/examples/midi/midifile-play.html One obvious point is that min.read accepts a track number.
Yes,thats the one I modeled mine after.
I removed the ugen stuff and replaced it with
send (midiout).
I have fluidsynth on jack The behaviour is strange.
It appears that advancing time on a spork advances
time in others and events get missed
But I could be wrong. I have notes with
no note off and CC that never happens
It works fine for single track files.
On Fri, 11 Feb 2022 13:10:20 -0800
Dana Batali
Hi Davud, have you seen this example?
https://cannerycoders.com/docs/chuck/examples/midi/midifile-play.html
One obvious point is that min.read accepts a track number. _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
On Fri, 11 Feb 2022 13:10:20 -0800
Dana Batali
Hi Davud, have you seen this example?
https://cannerycoders.com/docs/chuck/examples/midi/midifile-play.html
One obvious point is that min.read accepts a track number. _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
"Advancing time on a spork" means to "Wait until this amount of time has
elapsed."
If one spork is waiting for time to elapse, the others will be doing...
what?
On Fri, Feb 11, 2022 at 1:36 PM d
Yes,thats the one I modeled mine after. I removed the ugen stuff and replaced it with send (midiout). I have fluidsynth on jack The behaviour is strange. It appears that advancing time on a spork advances time in others and events get missed But I could be wrong. I have notes with no note off and CC that never happens
It works fine for single track files.
On Fri, 11 Feb 2022 13:10:20 -0800 Dana Batali
wrote: Hi Davud, have you seen this example?
https://cannerycoders.com/docs/chuck/examples/midi/midifile-play.html
One obvious point is that min.read accepts a track number. _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
On Fri, 11 Feb 2022 13:10:20 -0800 Dana Batali
wrote: Hi Davud, have you seen this example?
https://cannerycoders.com/docs/chuck/examples/midi/midifile-play.html
One obvious point is that min.read accepts a track number. _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
"advancing time" means "yield for this long." so the other shreds will be
executing, or yielding, as their own timing dictates.
On Sat, Feb 12, 2022, 06:40 Forrest Curo
"Advancing time on a spork" means to "Wait until this amount of time has elapsed." If one spork is waiting for time to elapse, the others will be doing... what?
On Fri, Feb 11, 2022 at 1:36 PM d
wrote: Yes,thats the one I modeled mine after. I removed the ugen stuff and replaced it with send (midiout). I have fluidsynth on jack The behaviour is strange. It appears that advancing time on a spork advances time in others and events get missed But I could be wrong. I have notes with no note off and CC that never happens
It works fine for single track files.
On Fri, 11 Feb 2022 13:10:20 -0800 Dana Batali
wrote: Hi Davud, have you seen this example?
https://cannerycoders.com/docs/chuck/examples/midi/midifile-play.html
One obvious point is that min.read accepts a track number. _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
On Fri, 11 Feb 2022 13:10:20 -0800 Dana Batali
wrote: Hi Davud, have you seen this example?
https://cannerycoders.com/docs/chuck/examples/midi/midifile-play.html
One obvious point is that min.read accepts a track number. _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
So how is this going to change their timing? It shouldn't, unless some
process somewhere keeps running and won't yield when the wait ends (and the
waiting spork wants to start from there.)
Jack or fluidsynth -- or what?
On Sat, Feb 12, 2022 at 9:55 AM Curtis Ullerich
"advancing time" means "yield for this long." so the other shreds will be executing, or yielding, as their own timing dictates.
On Sat, Feb 12, 2022, 06:40 Forrest Curo
wrote: "Advancing time on a spork" means to "Wait until this amount of time has elapsed." If one spork is waiting for time to elapse, the others will be doing... what?
On Fri, Feb 11, 2022 at 1:36 PM d
wrote: Yes,thats the one I modeled mine after. I removed the ugen stuff and replaced it with send (midiout). I have fluidsynth on jack The behaviour is strange. It appears that advancing time on a spork advances time in others and events get missed But I could be wrong. I have notes with no note off and CC that never happens
It works fine for single track files.
On Fri, 11 Feb 2022 13:10:20 -0800 Dana Batali
wrote: Hi Davud, have you seen this example?
https://cannerycoders.com/docs/chuck/examples/midi/midifile-play.html
One obvious point is that min.read accepts a track number. _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
On Fri, 11 Feb 2022 13:10:20 -0800 Dana Batali
wrote: Hi Davud, have you seen this example?
https://cannerycoders.com/docs/chuck/examples/midi/midifile-play.html
One obvious point is that min.read accepts a track number. _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Im using jack with fluidsynth.
I had some confusion about whether each
spork had its own "now" but I did a
test script and that seems to be the case.
I have tried adding me.yeild in various
places but no joy.
I created a midi file with a triad in
in three tracks ..8 quarter notes.
The events seem to be correct
but the output is only the last
spork. Perhaps its a problem
with my setup.
If i play the file with fludidynth
I get what I expected.
Any suggestions appreciated.
thanks
-----
MidiFileIn min;
MidiOut mout;
MidiMsg msg;
string filename;
me.arg(0) => filename;
if( !min.open(filename) ){
<<< "unable to open MIDI file:'",filename >>>;
me.exit();
}
mout.open(0);
spork ~ track(1);
spork ~ track(2);
spork ~ track(3);
5::second=>now;
function void track(int t) {
10::ms =>now;
while( min.read(msg,t))
{
<<
So how is this going to change their timing? It shouldn't, unless some process somewhere keeps running and won't yield when the wait ends (and the waiting spork wants to start from there.)
Jack or fluidsynth -- or what?
On Sat, Feb 12, 2022 at 9:55 AM Curtis Ullerich
wrote: "advancing time" means "yield for this long." so the other shreds will be executing, or yielding, as their own timing dictates.
On Sat, Feb 12, 2022, 06:40 Forrest Curo
wrote: "Advancing time on a spork" means to "Wait until this amount of time has elapsed." If one spork is waiting for time to elapse, the others will be doing... what?
On Fri, Feb 11, 2022 at 1:36 PM d
wrote: Yes,thats the one I modeled mine after. I removed the ugen stuff and replaced it with send (midiout). I have fluidsynth on jack The behaviour is strange. It appears that advancing time on a spork advances time in others and events get missed But I could be wrong. I have notes with no note off and CC that never happens
It works fine for single track files.
On Fri, 11 Feb 2022 13:10:20 -0800 Dana Batali
wrote: Hi Davud, have you seen this example?
https://cannerycoders.com/docs/chuck/examples/midi/midifile-play.html
One obvious point is that min.read accepts a track number. _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
On Fri, 11 Feb 2022 13:10:20 -0800 Dana Batali
wrote: Hi Davud, have you seen this example?
https://cannerycoders.com/docs/chuck/examples/midi/midifile-play.html
One obvious point is that min.read accepts a track number. _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
How about moving the MidiMsg object into the track function?
Of course it could always be a bug in MidiOut (I haven't used it.)
On Sat, Feb 12, 2022 at 12:18 PM d
Im using jack with fluidsynth.
I had some confusion about whether each spork had its own "now" but I did a test script and that seems to be the case.
I have tried adding me.yeild in various places but no joy.
I created a midi file with a triad in in three tracks ..8 quarter notes. The events seem to be correct but the output is only the last spork. Perhaps its a problem with my setup. If i play the file with fludidynth I get what I expected.
Any suggestions appreciated. thanks ----- MidiFileIn min; MidiOut mout; MidiMsg msg; string filename; me.arg(0) => filename; if( !min.open(filename) ){ <<< "unable to open MIDI file:'",filename >>>; me.exit(); } mout.open(0); spork ~ track(1); spork ~ track(2); spork ~ track(3); 5::second=>now;
function void track(int t) { 10::ms =>now; while( min.read(msg,t)) { <<
>>; 10::ms =>now; msg.when=> now; mout.send(msg); me.yield(); } } 1 0.000000 0 75 0 2 0.000000 1 75 0 3 0.000000 2 75 0 1 0.000000 0 75 0 2 0.000000 1 75 0 3 0.000000 2 75 0 1 0.000000 0 60 90 2 0.000000 1 64 90 3 0.000000 2 55 90 1 18000.000000 0 60 0 2 18000.000000 1 64 0 3 18000.000000 2 55 0 1 0.000000 0 60 90 2 0.000000 1 64 90 3 0.000000 2 55 90 1 18000.000000 0 60 0 2 18000.000000 1 64 0 3 18000.000000 2 55 0 1 0.000000 0 60 90 2 0.000000 1 64 90 3 0.000000 2 55 90 1 18000.000000 0 60 0 2 18000.000000 1 64 0
On Sat, 12 Feb 2022 10:22:17 -0800 Forrest Curo
wrote: So how is this going to change their timing? It shouldn't, unless some process somewhere keeps running and won't yield when the wait ends (and the waiting spork wants to start from there.)
Jack or fluidsynth -- or what?
On Sat, Feb 12, 2022 at 9:55 AM Curtis Ullerich
wrote: "advancing time" means "yield for this long." so the other shreds will be executing, or yielding, as their own timing dictates.
On Sat, Feb 12, 2022, 06:40 Forrest Curo
wrote: "Advancing time on a spork" means to "Wait until this amount of time has elapsed." If one spork is waiting for time to elapse, the others will be doing... what?
On Fri, Feb 11, 2022 at 1:36 PM d
wrote: Yes,thats the one I modeled mine after. I removed the ugen stuff and replaced it with send (midiout). I have fluidsynth on jack The behaviour is strange. It appears that advancing time on a spork advances time in others and events get missed But I could be wrong. I have notes with no note off and CC that never happens
It works fine for single track files.
On Fri, 11 Feb 2022 13:10:20 -0800 Dana Batali
wrote: Hi Davud, have you seen this example?
https://cannerycoders.com/docs/chuck/examples/midi/midifile-play.html
One obvious point is that min.read accepts a track number. _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
On Fri, 11 Feb 2022 13:10:20 -0800 Dana Batali
wrote: Hi Davud, have you seen this example?
https://cannerycoders.com/docs/chuck/examples/midi/midifile-play.html
One obvious point is that min.read accepts a track number. _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
THANKS Dana!
I've been struggling with this for a couple
of weeks and you fixed it in one post!
I'm planning to explore "conducting"
midi scores that I produce in lilypond.
Not sure where that will go, but this gives
me a lot of possibilities to mess with the
events before they go out.
The MidiScoreReader in the source looks interesting
but i don't know to access it. Track metadata
would be nice to have.
I may just read tracks into arrays and work with that.
davud
On Sat, 12 Feb 2022 12:23:55 -0800
Dana Batali
How about moving the MidiMsg object into the track function? Of course it could always be a bug in MidiOut (I haven't used it.)
On Sat, Feb 12, 2022 at 12:18 PM d
wrote: Im using jack with fluidsynth.
I had some confusion about whether each spork had its own "now" but I did a test script and that seems to be the case.
I have tried adding me.yeild in various places but no joy.
I created a midi file with a triad in in three tracks ..8 quarter notes. The events seem to be correct but the output is only the last spork. Perhaps its a problem with my setup. If i play the file with fludidynth I get what I expected.
Any suggestions appreciated. thanks ----- MidiFileIn min; MidiOut mout; MidiMsg msg; string filename; me.arg(0) => filename; if( !min.open(filename) ){ <<< "unable to open MIDI file:'",filename >>>; me.exit(); } mout.open(0); spork ~ track(1); spork ~ track(2); spork ~ track(3); 5::second=>now;
function void track(int t) { 10::ms =>now; while( min.read(msg,t)) { <<
>>; 10::ms =>now; msg.when=> now; mout.send(msg); me.yield(); } } 1 0.000000 0 75 0 2 0.000000 1 75 0 3 0.000000 2 75 0 1 0.000000 0 75 0 2 0.000000 1 75 0 3 0.000000 2 75 0 1 0.000000 0 60 90 2 0.000000 1 64 90 3 0.000000 2 55 90 1 18000.000000 0 60 0 2 18000.000000 1 64 0 3 18000.000000 2 55 0 1 0.000000 0 60 90 2 0.000000 1 64 90 3 0.000000 2 55 90 1 18000.000000 0 60 0 2 18000.000000 1 64 0 3 18000.000000 2 55 0 1 0.000000 0 60 90 2 0.000000 1 64 90 3 0.000000 2 55 90 1 18000.000000 0 60 0 2 18000.000000 1 64 0
On Sat, 12 Feb 2022 10:22:17 -0800 Forrest Curo
wrote: So how is this going to change their timing? It shouldn't, unless some process somewhere keeps running and won't yield when the wait ends (and the waiting spork wants to start from there.)
Jack or fluidsynth -- or what?
On Sat, Feb 12, 2022 at 9:55 AM Curtis Ullerich
wrote: "advancing time" means "yield for this long." so the other shreds will be executing, or yielding, as their own timing dictates.
On Sat, Feb 12, 2022, 06:40 Forrest Curo
wrote: "Advancing time on a spork" means to "Wait until this amount of time has elapsed." If one spork is waiting for time to elapse, the others will be doing... what?
On Fri, Feb 11, 2022 at 1:36 PM d
wrote: Yes,thats the one I modeled mine after. I removed the ugen stuff and replaced it with send (midiout). I have fluidsynth on jack The behaviour is strange. It appears that advancing time on a spork advances time in others and events get missed But I could be wrong. I have notes with no note off and CC that never happens
It works fine for single track files.
On Fri, 11 Feb 2022 13:10:20 -0800 Dana Batali
wrote: > Hi Davud, have you seen this example? > > https://cannerycoders.com/docs/chuck/examples/midi/midifile-play.html > > One obvious point is that min.read accepts a track number. > _______________________________________________ > chuck-users mailing list > chuck-users@lists.cs.princeton.edu > https://lists.cs.princeton.edu/mailman/listinfo/chuck-users >
On Fri, 11 Feb 2022 13:10:20 -0800 Dana Batali
wrote: > Hi Davud, have you seen this example? > > https://cannerycoders.com/docs/chuck/examples/midi/midifile-play.html > > One obvious point is that min.read accepts a track number. > _______________________________________________ > chuck-users mailing list > chuck-users@lists.cs.princeton.edu > https://lists.cs.princeton.edu/mailman/listinfo/chuck-users >
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
As for the timing/yielding questions, I already wrote up this little
example so I thought I would share it. Maybe it clarifies some things,
maybe it doesn't.
// plays each note in notes[] for the given duration
function void play(int notes[], dur length) {
SinOsc s => dac;
for (0 => int i; i < notes.size(); i++) {
Std.mtof(notes[i]) => s.freq;
<<< "playing note", notes[i], "and waiting for", length, "samples
before code execution continues" >>>;
length => now;
<<< length, "samples have gone by, so now we continue" >>>;
}
}
spork ~ play([60, 62, 64, 66, 68, 70, 72], 500::ms);
// uncomment this spork to see how the shreds run in parallel
// spork ~ play([72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62], 250::ms);
<<< "waiting here for an arbitrary amount of time because if we don't, the
sporked shreds won't get a chance to do anything before this process ends",
"" >>>;
day => now;
On Sat, Feb 12, 2022 at 12:41 PM d
THANKS Dana! I've been struggling with this for a couple of weeks and you fixed it in one post!
I'm planning to explore "conducting" midi scores that I produce in lilypond. Not sure where that will go, but this gives me a lot of possibilities to mess with the events before they go out.
The MidiScoreReader in the source looks interesting but i don't know to access it. Track metadata would be nice to have. I may just read tracks into arrays and work with that.
davud
On Sat, 12 Feb 2022 12:23:55 -0800 Dana Batali
wrote: How about moving the MidiMsg object into the track function? Of course it could always be a bug in MidiOut (I haven't used it.)
On Sat, Feb 12, 2022 at 12:18 PM d
wrote: Im using jack with fluidsynth.
I had some confusion about whether each spork had its own "now" but I did a test script and that seems to be the case.
I have tried adding me.yeild in various places but no joy.
I created a midi file with a triad in in three tracks ..8 quarter notes. The events seem to be correct but the output is only the last spork. Perhaps its a problem with my setup. If i play the file with fludidynth I get what I expected.
Any suggestions appreciated. thanks ----- MidiFileIn min; MidiOut mout; MidiMsg msg; string filename; me.arg(0) => filename; if( !min.open(filename) ){ <<< "unable to open MIDI file:'",filename >>>; me.exit(); } mout.open(0); spork ~ track(1); spork ~ track(2); spork ~ track(3); 5::second=>now;
function void track(int t) { 10::ms =>now; while( min.read(msg,t)) { <<
>>; 10::ms =>now; msg.when=> now; mout.send(msg); me.yield(); } } 1 0.000000 0 75 0 2 0.000000 1 75 0 3 0.000000 2 75 0 1 0.000000 0 75 0 2 0.000000 1 75 0 3 0.000000 2 75 0 1 0.000000 0 60 90 2 0.000000 1 64 90 3 0.000000 2 55 90 1 18000.000000 0 60 0 2 18000.000000 1 64 0 3 18000.000000 2 55 0 1 0.000000 0 60 90 2 0.000000 1 64 90 3 0.000000 2 55 90 1 18000.000000 0 60 0 2 18000.000000 1 64 0 3 18000.000000 2 55 0 1 0.000000 0 60 90 2 0.000000 1 64 90 3 0.000000 2 55 90 1 18000.000000 0 60 0 2 18000.000000 1 64 0
On Sat, 12 Feb 2022 10:22:17 -0800 Forrest Curo
wrote: So how is this going to change their timing? It shouldn't, unless some process somewhere keeps running and won't yield when the wait ends (and the waiting spork wants to start from there.)
Jack or fluidsynth -- or what?
On Sat, Feb 12, 2022 at 9:55 AM Curtis Ullerich
wrote: "advancing time" means "yield for this long." so the other shreds will be executing, or yielding, as their own timing dictates.
On Sat, Feb 12, 2022, 06:40 Forrest Curo
wrote: "Advancing time on a spork" means to "Wait until this amount of time has elapsed." If one spork is waiting for time to elapse, the others will be doing... what?
On Fri, Feb 11, 2022 at 1:36 PM d
wrote: > > Yes,thats the one I modeled mine after. > I removed the ugen stuff and replaced it with > send (midiout). > I have fluidsynth on jack The behaviour is strange. > It appears that advancing time on a spork advances > time in others and events get missed > But I could be wrong. I have notes with > no note off and CC that never happens > > It works fine for single track files. > > On Fri, 11 Feb 2022 13:10:20 -0800 > Dana Batali
wrote: > > > Hi Davud, have you seen this example? > > > > https://cannerycoders.com/docs/chuck/examples/midi/midifile-play.html
> > > > One obvious point is that min.read accepts a track number. > > _______________________________________________ > > chuck-users mailing list > > chuck-users@lists.cs.princeton.edu > > https://lists.cs.princeton.edu/mailman/listinfo/chuck-users > > > > > On Fri, 11 Feb 2022 13:10:20 -0800 > Dana Batali
wrote: > > > Hi Davud, have you seen this example? > > > > https://cannerycoders.com/docs/chuck/examples/midi/midifile-play.html > > > > One obvious point is that min.read accepts a track number. > > _______________________________________________ > > chuck-users mailing list > > chuck-users@lists.cs.princeton.edu > > https://lists.cs.princeton.edu/mailman/listinfo/chuck-users > > > > _______________________________________________ > chuck-users mailing list > chuck-users@lists.cs.princeton.edu > https://lists.cs.princeton.edu/mailman/listinfo/chuck-users > _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Can you share your sample midi file?
On Sat, Feb 12, 2022 at 12:24 PM Dana Batali
How about moving the MidiMsg object into the track function? Of course it could always be a bug in MidiOut (I haven't used it.)
On Sat, Feb 12, 2022 at 12:18 PM d
wrote: Im using jack with fluidsynth.
I had some confusion about whether each spork had its own "now" but I did a test script and that seems to be the case.
I have tried adding me.yeild in various places but no joy.
I created a midi file with a triad in in three tracks ..8 quarter notes. The events seem to be correct but the output is only the last spork. Perhaps its a problem with my setup. If i play the file with fludidynth I get what I expected.
Any suggestions appreciated. thanks ----- MidiFileIn min; MidiOut mout; MidiMsg msg; string filename; me.arg(0) => filename; if( !min.open(filename) ){ <<< "unable to open MIDI file:'",filename >>>; me.exit(); } mout.open(0); spork ~ track(1); spork ~ track(2); spork ~ track(3); 5::second=>now;
function void track(int t) { 10::ms =>now; while( min.read(msg,t)) { <<
>>; 10::ms =>now; msg.when=> now; mout.send(msg); me.yield(); } } 1 0.000000 0 75 0 2 0.000000 1 75 0 3 0.000000 2 75 0 1 0.000000 0 75 0 2 0.000000 1 75 0 3 0.000000 2 75 0 1 0.000000 0 60 90 2 0.000000 1 64 90 3 0.000000 2 55 90 1 18000.000000 0 60 0 2 18000.000000 1 64 0 3 18000.000000 2 55 0 1 0.000000 0 60 90 2 0.000000 1 64 90 3 0.000000 2 55 90 1 18000.000000 0 60 0 2 18000.000000 1 64 0 3 18000.000000 2 55 0 1 0.000000 0 60 90 2 0.000000 1 64 90 3 0.000000 2 55 90 1 18000.000000 0 60 0 2 18000.000000 1 64 0
On Sat, 12 Feb 2022 10:22:17 -0800 Forrest Curo
wrote: So how is this going to change their timing? It shouldn't, unless some process somewhere keeps running and won't yield when the wait ends (and the waiting spork wants to start from there.)
Jack or fluidsynth -- or what?
On Sat, Feb 12, 2022 at 9:55 AM Curtis Ullerich
wrote: "advancing time" means "yield for this long." so the other shreds will be executing, or yielding, as their own timing dictates.
On Sat, Feb 12, 2022, 06:40 Forrest Curo
wrote: "Advancing time on a spork" means to "Wait until this amount of time has elapsed." If one spork is waiting for time to elapse, the others will be doing... what?
On Fri, Feb 11, 2022 at 1:36 PM d
wrote: Yes,thats the one I modeled mine after. I removed the ugen stuff and replaced it with send (midiout). I have fluidsynth on jack The behaviour is strange. It appears that advancing time on a spork advances time in others and events get missed But I could be wrong. I have notes with no note off and CC that never happens
It works fine for single track files.
On Fri, 11 Feb 2022 13:10:20 -0800 Dana Batali
wrote: > Hi Davud, have you seen this example? > >
https://cannerycoders.com/docs/chuck/examples/midi/midifile-play.html
> > One obvious point is that min.read accepts a track number. > _______________________________________________ > chuck-users mailing list > chuck-users@lists.cs.princeton.edu > https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
On Fri, 11 Feb 2022 13:10:20 -0800 Dana Batali
wrote: > Hi Davud, have you seen this example? > > https://cannerycoders.com/docs/chuck/examples/midi/midifile-play.html > > One obvious point is that min.read accepts a track number. > _______________________________________________ > chuck-users mailing list > chuck-users@lists.cs.princeton.edu > https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
I haven't done mailing lists in decades
so I dont remember how binary files are done
are attachments scrubbed?
here it is base64 encoded if that works.
davud
TVRoZAAAAAYAAQAEAYBNVHJrAAAARwD/AwAA/wEJY3JlYXRvcjogAP8BHkdOVSBMaWx5UG9uZCAy
LjIyLjAgICAgICAgICAgIAD/WAQEAhIIAP9RAwW42JsA/y8ATVRyawAAAGgA/wMFXG5ldzoAwEsA
wEsA/wQJUGFuIEZsdXRlAJA8WoMAkDwAAJA8WoMAkDwAAJA8WoMAkDwAAJA8WoMAkDwAAJA8WoMA
kDwAAJA8WoMAkDwAAJA8WoMAkDwAAJA8WoMAkDwAAP8vAE1UcmsAAABoAP8DBVxuZXc6AMFLAMFL
AP8ECVBhbiBGbHV0ZQCRQFqDAJFAAACRQFqDAJFAAACRQFqDAJFAAACRQFqDAJFAAACRQFqDAJFA
AACRQFqDAJFAAACRQFqDAJFAAACRQFqDAJFAAAD/LwBNVHJrAAAAcQD/AwVcbmV3OgDCSwDCSwD/
BAlQYW4gRmx1dGUAkjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAA
kjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAA/y8A
On Sat, 12 Feb 2022 12:39:57 -0800
Curtis Ullerich
Can you share your sample midi file?
On Sat, Feb 12, 2022 at 12:24 PM Dana Batali
wrote: How about moving the MidiMsg object into the track function? Of course it could always be a bug in MidiOut (I haven't used it.)
On Sat, Feb 12, 2022 at 12:18 PM d
wrote: Im using jack with fluidsynth.
I had some confusion about whether each spork had its own "now" but I did a test script and that seems to be the case.
I have tried adding me.yeild in various places but no joy.
I created a midi file with a triad in in three tracks ..8 quarter notes. The events seem to be correct but the output is only the last spork. Perhaps its a problem with my setup. If i play the file with fludidynth I get what I expected.
Any suggestions appreciated. thanks ----- MidiFileIn min; MidiOut mout; MidiMsg msg; string filename; me.arg(0) => filename; if( !min.open(filename) ){ <<< "unable to open MIDI file:'",filename >>>; me.exit(); } mout.open(0); spork ~ track(1); spork ~ track(2); spork ~ track(3); 5::second=>now;
function void track(int t) { 10::ms =>now; while( min.read(msg,t)) { <<
>>; 10::ms =>now; msg.when=> now; mout.send(msg); me.yield(); } } 1 0.000000 0 75 0 2 0.000000 1 75 0 3 0.000000 2 75 0 1 0.000000 0 75 0 2 0.000000 1 75 0 3 0.000000 2 75 0 1 0.000000 0 60 90 2 0.000000 1 64 90 3 0.000000 2 55 90 1 18000.000000 0 60 0 2 18000.000000 1 64 0 3 18000.000000 2 55 0 1 0.000000 0 60 90 2 0.000000 1 64 90 3 0.000000 2 55 90 1 18000.000000 0 60 0 2 18000.000000 1 64 0 3 18000.000000 2 55 0 1 0.000000 0 60 90 2 0.000000 1 64 90 3 0.000000 2 55 90 1 18000.000000 0 60 0 2 18000.000000 1 64 0
On Sat, 12 Feb 2022 10:22:17 -0800 Forrest Curo
wrote: So how is this going to change their timing? It shouldn't, unless some process somewhere keeps running and won't yield when the wait ends (and the waiting spork wants to start from there.)
Jack or fluidsynth -- or what?
On Sat, Feb 12, 2022 at 9:55 AM Curtis Ullerich
wrote: "advancing time" means "yield for this long." so the other shreds will be executing, or yielding, as their own timing dictates.
On Sat, Feb 12, 2022, 06:40 Forrest Curo
wrote: "Advancing time on a spork" means to "Wait until this amount of time has elapsed." If one spork is waiting for time to elapse, the others will be doing... what?
On Fri, Feb 11, 2022 at 1:36 PM d
wrote: > > Yes,thats the one I modeled mine after. > I removed the ugen stuff and replaced it with > send (midiout). > I have fluidsynth on jack The behaviour is strange. > It appears that advancing time on a spork advances > time in others and events get missed > But I could be wrong. I have notes with > no note off and CC that never happens > > It works fine for single track files. > > On Fri, 11 Feb 2022 13:10:20 -0800 > Dana Batali
wrote: > > > Hi Davud, have you seen this example? > > > > https://cannerycoders.com/docs/chuck/examples/midi/midifile-play.html
> > > > One obvious point is that min.read accepts a track number. > > _______________________________________________ > > chuck-users mailing list > > chuck-users@lists.cs.princeton.edu > > https://lists.cs.princeton.edu/mailman/listinfo/chuck-users > > > > > On Fri, 11 Feb 2022 13:10:20 -0800 > Dana Batali
wrote: > > > Hi Davud, have you seen this example? > > > > https://cannerycoders.com/docs/chuck/examples/midi/midifile-play.html > > > > One obvious point is that min.read accepts a track number. > > _______________________________________________ > > chuck-users mailing list > > chuck-users@lists.cs.princeton.edu > > https://lists.cs.princeton.edu/mailman/listinfo/chuck-users > > > > _______________________________________________ > chuck-users mailing list > chuck-users@lists.cs.princeton.edu > https://lists.cs.princeton.edu/mailman/listinfo/chuck-users > _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
That did work. Dana's point was the key one. You'll also want your MidiOut
to be inside the function. Since you're using MidiOut to send messages to
another process, I think you'll notice that you need to adjust your timing
between messages, presumably based on the note durations specified in the
midi file. If you have more questions please do follow up.
For anybody else wanting the file:
echo -n
"TVRoZAAAAAYAAQAEAYBNVHJrAAAARwD/AwAA/wEJY3JlYXRvcjogAP8BHkdOVSBMaWx5UG9uZCAyLjIyLjAgICAgICAgICAgIAD/WAQEAhIIAP9RAwW42JsA/y8ATVRyawAAAGgA/wMFXG5ldzoAwEsAwEsA/wQJUGFuIEZsdXRlAJA8WoMAkDwAAJA8WoMAkDwAAJA8WoMAkDwAAJA8WoMAkDwAAJA8WoMAkDwAAJA8WoMAkDwAAJA8WoMAkDwAAJA8WoMAkDwAAP8vAE1UcmsAAABoAP8DBVxuZXc6AMFLAMFLAP8ECVBhbiBGbHV0ZQCRQFqDAJFAAACRQFqDAJFAAACRQFqDAJFAAACRQFqDAJFAAACRQFqDAJFAAACRQFqDAJFAAACRQFqDAJFAAACRQFqDAJFAAAD/LwBNVHJrAAAAcQD/AwVcbmV3OgDCSwDCSwD/BAlQYW4gRmx1dGUAkjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAA/y8A"
| base64 -d > sample.mid
On Sat, Feb 12, 2022 at 1:56 PM d
I haven't done mailing lists in decades so I dont remember how binary files are done are attachments scrubbed? here it is base64 encoded if that works.
davud
TVRoZAAAAAYAAQAEAYBNVHJrAAAARwD/AwAA/wEJY3JlYXRvcjogAP8BHkdOVSBMaWx5UG9uZCAy
LjIyLjAgICAgICAgICAgIAD/WAQEAhIIAP9RAwW42JsA/y8ATVRyawAAAGgA/wMFXG5ldzoAwEsA
wEsA/wQJUGFuIEZsdXRlAJA8WoMAkDwAAJA8WoMAkDwAAJA8WoMAkDwAAJA8WoMAkDwAAJA8WoMA
kDwAAJA8WoMAkDwAAJA8WoMAkDwAAJA8WoMAkDwAAP8vAE1UcmsAAABoAP8DBVxuZXc6AMFLAMFL
AP8ECVBhbiBGbHV0ZQCRQFqDAJFAAACRQFqDAJFAAACRQFqDAJFAAACRQFqDAJFAAACRQFqDAJFA
AACRQFqDAJFAAACRQFqDAJFAAACRQFqDAJFAAAD/LwBNVHJrAAAAcQD/AwVcbmV3OgDCSwDCSwD/
BAlQYW4gRmx1dGUAkjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAA kjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAA/y8A
On Sat, 12 Feb 2022 12:39:57 -0800 Curtis Ullerich
wrote: Can you share your sample midi file?
On Sat, Feb 12, 2022 at 12:24 PM Dana Batali
wrote: How about moving the MidiMsg object into the track function? Of course it could always be a bug in MidiOut (I haven't used it.)
On Sat, Feb 12, 2022 at 12:18 PM d
wrote: Im using jack with fluidsynth.
I had some confusion about whether each spork had its own "now" but I did a test script and that seems to be the case.
I have tried adding me.yeild in various places but no joy.
I created a midi file with a triad in in three tracks ..8 quarter notes. The events seem to be correct but the output is only the last spork. Perhaps its a problem with my setup. If i play the file with fludidynth I get what I expected.
Any suggestions appreciated. thanks ----- MidiFileIn min; MidiOut mout; MidiMsg msg; string filename; me.arg(0) => filename; if( !min.open(filename) ){ <<< "unable to open MIDI file:'",filename >>>; me.exit(); } mout.open(0); spork ~ track(1); spork ~ track(2); spork ~ track(3); 5::second=>now;
function void track(int t) { 10::ms =>now; while( min.read(msg,t)) { <<
>>; 10::ms =>now; msg.when=> now; mout.send(msg); me.yield(); } } 1 0.000000 0 75 0 2 0.000000 1 75 0 3 0.000000 2 75 0 1 0.000000 0 75 0 2 0.000000 1 75 0 3 0.000000 2 75 0 1 0.000000 0 60 90 2 0.000000 1 64 90 3 0.000000 2 55 90 1 18000.000000 0 60 0 2 18000.000000 1 64 0 3 18000.000000 2 55 0 1 0.000000 0 60 90 2 0.000000 1 64 90 3 0.000000 2 55 90 1 18000.000000 0 60 0 2 18000.000000 1 64 0 3 18000.000000 2 55 0 1 0.000000 0 60 90 2 0.000000 1 64 90 3 0.000000 2 55 90 1 18000.000000 0 60 0 2 18000.000000 1 64 0
On Sat, 12 Feb 2022 10:22:17 -0800 Forrest Curo
wrote: So how is this going to change their timing? It shouldn't, unless some process somewhere keeps running and won't yield when the wait ends (and the waiting spork wants to start from there.)
Jack or fluidsynth -- or what?
On Sat, Feb 12, 2022 at 9:55 AM Curtis Ullerich
wrote: "advancing time" means "yield for this long." so the other shreds will be executing, or yielding, as their own timing dictates.
On Sat, Feb 12, 2022, 06:40 Forrest Curo
wrote: > "Advancing time on a spork" means to "Wait until this amount > of time has elapsed." > If one spork is waiting for time to elapse, the others will > be doing... what? > > On Fri, Feb 11, 2022 at 1:36 PM d wrote: > >> >> Yes,thats the one I modeled mine after. >> I removed the ugen stuff and replaced it with >> send (midiout). >> I have fluidsynth on jack The behaviour is strange. >> It appears that advancing time on a spork advances >> time in others and events get missed >> But I could be wrong. I have notes with >> no note off and CC that never happens >> >> It works fine for single track files. >> >> On Fri, 11 Feb 2022 13:10:20 -0800 >> Dana Batali wrote: >> >> > Hi Davud, have you seen this example? >> > >> > https://cannerycoders.com/docs/chuck/examples/midi/midifile-play.html
>> > >> > One obvious point is that min.read accepts a track number. >> > _______________________________________________ >> > chuck-users mailing list >> > chuck-users@lists.cs.princeton.edu >> > https://lists.cs.princeton.edu/mailman/listinfo/chuck-users >> > >> >> >> On Fri, 11 Feb 2022 13:10:20 -0800 >> Dana Batali
wrote: >> >> > Hi Davud, have you seen this example? >> > >> > https://cannerycoders.com/docs/chuck/examples/midi/midifile-play.html >> > >> > One obvious point is that min.read accepts a track number. >> > _______________________________________________ >> > chuck-users mailing list >> > chuck-users@lists.cs.princeton.edu >> > https://lists.cs.princeton.edu/mailman/listinfo/chuck-users >> > >> >> _______________________________________________ >> chuck-users mailing list >> chuck-users@lists.cs.princeton.edu >> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users >> > _______________________________________________ > chuck-users mailing list > chuck-users@lists.cs.princeton.edu > https://lists.cs.princeton.edu/mailman/listinfo/chuck-users > _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Thanks to all for the help.
In case you are interested here is the script.
Add it to the examples if you care to.
I am working on another one that first loads the
file into a 2d array. Now I just need to work
out how to start stop and move the play position.
midiio_rtmidi.cpp in the source has some
functions that would be nice to have.
But they do not appear to be exposed to
chuck. Is there a compile flag or something
I can use for that ?
thanks
davud
------
MidiFileIn min;
MidiOut mout;
int done;
string filename;
me.arg(0) => filename;
if( !min.open(filename) ){
<<< "unable to open MIDI file:'",filename >>>;
me.exit();
}
mout.open(0);
for( int t; t < min.numTracks(); t++ ) {
spork ~ track(t );
}
while( done < min.numTracks() ) 100::ms => now;
function void track(int t) {
MidiMsg msg;
while( min.read(msg,t))
{
msg.when=> now;
mout.send(msg);
}
done++;
}
On Sat, 12 Feb 2022 14:15:20 -0800
Curtis Ullerich
That did work. Dana's point was the key one. You'll also want your MidiOut to be inside the function. Since you're using MidiOut to send messages to another process, I think you'll notice that you need to adjust your timing between messages, presumably based on the note durations specified in the midi file. If you have more questions please do follow up.
For anybody else wanting the file: echo -n "TVRoZAAAAAYAAQAEAYBNVHJrAAAARwD/AwAA/wEJY3JlYXRvcjogAP8BHkdOVSBMaWx5UG9uZCAyLjIyLjAgICAgICAgICAgIAD/WAQEAhIIAP9RAwW42JsA/y8ATVRyawAAAGgA/wMFXG5ldzoAwEsAwEsA/wQJUGFuIEZsdXRlAJA8WoMAkDwAAJA8WoMAkDwAAJA8WoMAkDwAAJA8WoMAkDwAAJA8WoMAkDwAAJA8WoMAkDwAAJA8WoMAkDwAAJA8WoMAkDwAAP8vAE1UcmsAAABoAP8DBVxuZXc6AMFLAMFLAP8ECVBhbiBGbHV0ZQCRQFqDAJFAAACRQFqDAJFAAACRQFqDAJFAAACRQFqDAJFAAACRQFqDAJFAAACRQFqDAJFAAACRQFqDAJFAAACRQFqDAJFAAAD/LwBNVHJrAAAAcQD/AwVcbmV3OgDCSwDCSwD/BAlQYW4gRmx1dGUAkjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAA/y8A" | base64 -d > sample.mid
On Sat, Feb 12, 2022 at 1:56 PM d
wrote: I haven't done mailing lists in decades so I dont remember how binary files are done are attachments scrubbed? here it is base64 encoded if that works.
davud
TVRoZAAAAAYAAQAEAYBNVHJrAAAARwD/AwAA/wEJY3JlYXRvcjogAP8BHkdOVSBMaWx5UG9uZCAy
LjIyLjAgICAgICAgICAgIAD/WAQEAhIIAP9RAwW42JsA/y8ATVRyawAAAGgA/wMFXG5ldzoAwEsA
wEsA/wQJUGFuIEZsdXRlAJA8WoMAkDwAAJA8WoMAkDwAAJA8WoMAkDwAAJA8WoMAkDwAAJA8WoMA
kDwAAJA8WoMAkDwAAJA8WoMAkDwAAJA8WoMAkDwAAP8vAE1UcmsAAABoAP8DBVxuZXc6AMFLAMFL
AP8ECVBhbiBGbHV0ZQCRQFqDAJFAAACRQFqDAJFAAACRQFqDAJFAAACRQFqDAJFAAACRQFqDAJFA
AACRQFqDAJFAAACRQFqDAJFAAACRQFqDAJFAAAD/LwBNVHJrAAAAcQD/AwVcbmV3OgDCSwDCSwD/
BAlQYW4gRmx1dGUAkjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAA kjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAAkjdagwCSNwAA/y8A
On Sat, 12 Feb 2022 12:39:57 -0800 Curtis Ullerich
wrote: Can you share your sample midi file?
On Sat, Feb 12, 2022 at 12:24 PM Dana Batali
wrote: How about moving the MidiMsg object into the track function? Of course it could always be a bug in MidiOut (I haven't used it.)
On Sat, Feb 12, 2022 at 12:18 PM d
wrote: Im using jack with fluidsynth.
I had some confusion about whether each spork had its own "now" but I did a test script and that seems to be the case.
I have tried adding me.yeild in various places but no joy.
I created a midi file with a triad in in three tracks ..8 quarter notes. The events seem to be correct but the output is only the last spork. Perhaps its a problem with my setup. If i play the file with fludidynth I get what I expected.
Any suggestions appreciated. thanks ----- MidiFileIn min; MidiOut mout; MidiMsg msg; string filename; me.arg(0) => filename; if( !min.open(filename) ){ <<< "unable to open MIDI file:'",filename >>>; me.exit(); } mout.open(0); spork ~ track(1); spork ~ track(2); spork ~ track(3); 5::second=>now;
function void track(int t) { 10::ms =>now; while( min.read(msg,t)) { <<
>>; 10::ms =>now; msg.when=> now; mout.send(msg); me.yield(); } } 1 0.000000 0 75 0 2 0.000000 1 75 0 3 0.000000 2 75 0 1 0.000000 0 75 0 2 0.000000 1 75 0 3 0.000000 2 75 0 1 0.000000 0 60 90 2 0.000000 1 64 90 3 0.000000 2 55 90 1 18000.000000 0 60 0 2 18000.000000 1 64 0 3 18000.000000 2 55 0 1 0.000000 0 60 90 2 0.000000 1 64 90 3 0.000000 2 55 90 1 18000.000000 0 60 0 2 18000.000000 1 64 0 3 18000.000000 2 55 0 1 0.000000 0 60 90 2 0.000000 1 64 90 3 0.000000 2 55 90 1 18000.000000 0 60 0 2 18000.000000 1 64 0
On Sat, 12 Feb 2022 10:22:17 -0800 Forrest Curo
wrote: So how is this going to change their timing? It shouldn't, unless some process somewhere keeps running and won't yield when the wait ends (and the waiting spork wants to start from there.)
Jack or fluidsynth -- or what?
On Sat, Feb 12, 2022 at 9:55 AM Curtis Ullerich
wrote: > "advancing time" means "yield for this long." so the other > shreds will be executing, or yielding, as their own timing > dictates. > > On Sat, Feb 12, 2022, 06:40 Forrest Curo >
wrote: >> "Advancing time on a spork" means to "Wait until this >> amount of time has elapsed." >> If one spork is waiting for time to elapse, the others >> will be doing... what? >> >> On Fri, Feb 11, 2022 at 1:36 PM d >> wrote: >>> >>> Yes,thats the one I modeled mine after. >>> I removed the ugen stuff and replaced it with >>> send (midiout). >>> I have fluidsynth on jack The behaviour is strange. >>> It appears that advancing time on a spork advances >>> time in others and events get missed >>> But I could be wrong. I have notes with >>> no note off and CC that never happens >>> >>> It works fine for single track files. >>> >>> On Fri, 11 Feb 2022 13:10:20 -0800 >>> Dana Batali wrote: >>> >>> > Hi Davud, have you seen this example? >>> > >>> > https://cannerycoders.com/docs/chuck/examples/midi/midifile-play.html
>>> > >>> > One obvious point is that min.read accepts a track >>> > number. >>> > _______________________________________________ >>> > chuck-users mailing list >>> > chuck-users@lists.cs.princeton.edu >>> > https://lists.cs.princeton.edu/mailman/listinfo/chuck-users >>> >>> >>> On Fri, 11 Feb 2022 13:10:20 -0800 >>> Dana Batali
wrote: >>> >>> > Hi Davud, have you seen this example? >>> > >>> > https://cannerycoders.com/docs/chuck/examples/midi/midifile-play.html >>> > >>> > One obvious point is that min.read accepts a track >>> > number. >>> > _______________________________________________ >>> > chuck-users mailing list >>> > chuck-users@lists.cs.princeton.edu >>> > https://lists.cs.princeton.edu/mailman/listinfo/chuck-users >>> >>> _______________________________________________ >>> chuck-users mailing list >>> chuck-users@lists.cs.princeton.edu >>> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users >>> >> _______________________________________________ >> chuck-users mailing list >> chuck-users@lists.cs.princeton.edu >> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users >> > _______________________________________________ > chuck-users mailing list > chuck-users@lists.cs.princeton.edu > https://lists.cs.princeton.edu/mailman/listinfo/chuck-users >
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
participants (4)
-
Curtis Ullerich
-
d
-
Dana Batali
-
Forrest Curo