very counterintuitive scheduling problem

rodolphebourotte's icon

(MacBook2 - Intel Core 2 Duo - 1.83 GHz - 2GB RAM - OSX 10.6) running Max5.1.1 (41439)

this is a post following the "udp, does a bang bang ?" . UDP does not seem to be the problem, but there is something I cannot understand with scheduling or something : why is there a difference in the resulting drawing in my patch, when I trig by hand a button, and when I trig by hand a button delayed, since the patch has got plenty of time anyway to calculate between my user inputs ?
(note than the patch uses the OMANtonin font so that displaying might not be correct)

NB--> try the patch testNoteDisplay with the drawPitches external…

Thanks,

Rodolphe

623.drawpitches.maxpat
Max Patch
Chris Muir's icon

I didn't wade through your patch, but when there are UI vs scheduler differences a judicious use of a [defer] or [deferlow] often cleans things up for me.

rodolphebourotte's icon

the [deferlow] did fix the problem, but still I can't understand how such a situation can occur, when a user-triggered bang has a different effect than a user-triggered bang with a deferlow while no other process are running... any explanation welcome.

thanks,
Rodolphe

Chris Muir's icon

Anything that has to do something at another time uses the scheduler. If you press a bang button, but send the result through a delay, the delayed bang ends up being delivered by the scheduler. If you bang everything by hand, the scheduler isn't involved.