[chuck-users] trying to implement a midi sequencer in chuck

d dchuck at yurfish.com
Fri Feb 11 15:33:37 EST 2022


I am trying to implement a midi
sequencer in chuck  and aparrently
do not understand how time is

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.


MidiFileIn min;
MidiOut mout;
MidiMsg msg;
int done;
string filename;
me.arg(0) => filename;
if( !min.open(filename) ){
   <<< "unable to open MIDI file:'",filename >>>;
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))
        msg.when=> now;  

More information about the chuck-users mailing list