Hi Peter, You should try Jack2 instead of Jack. I am not sure it will solve your mutex problem but it is more safe when using ChucK and it will certainly reduce the number of Xrun you have. Cheers, Julien On 23/10/2014 03:59, Peter Lutek wrote:
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.