On 2014-10-22 13:12, Moisés Gabriel Cachay Tello wrote:
In order to advance 'now' and make it eventually equal or higher than 'later' you should put inside your loop something like:
now + 5::second => time later; while(now < later) { ... 1::second => now; }
ok, so now it works sometimes, but other times ChucK crashes, with this error: chuck: pthread_mutex_lock.c:62: __pthread_mutex_lock: Assertion `mutex->__data.__owner == 0' failed. any clues? here's the code, as it stands: ///////// // set up MIDI MidiIn min; MidiOut mout; MidiMsg msgin; MidiMsg msgout; // connect to port 1 and print result <<<"","">>>; <<<"MIDI-in then MIDI-out:","">>>; <<< min.open(1),"" >>>; <<< mout.open(1),"" >>>; <<<"","">>>; dur beat; now + 30::second => time later; while( now < later ){ if( min.recv(msgin) ){ ( msgin.data3 + 10 ) * 50::ms => beat; <<<beat>>>; } 50::ms => now; } <<<"done">>>; ////////// thanks for any help... cheers! .pltk. -- Peter Lutek improvising musician in Toronto, Canada http://peterlutek.com