Timing bug???

freepoulite's icon

Hello

In the below patch the getpenloc message looks to be delayed, if you look at max window you see that penloc messages arrive after write messages...
is it a bug or is it normal?

PB

4557.TimingBug.maxpat
Max Patch
Roman Thilenius's icon

requesting the mouseposition from the dropfile object is simply kicked out of the
main thread, the left to right order order of your two messages stops beeing
valid when the penloc message arrives inside the GUI object.

the mouseposition is only tracked every 20 ms (or 50, i can never remember)
and so it would be asked too much to wait for it.

to get back to the desired order just store "write $1"in a buffer (for example
[zl reg] or [list x x]) and fetch it there when the mouse location later is beeing
reported from the GUI object´s output.

of course with "write A, write Z, write E" you will run into trouble.
you´d have to build a shift register to be able to store and fetch those safely.
but i beleive that your application approach will allow you to store multiple
keyboard inputs in another form than as consecutive messages.

-110

freepoulite's icon

Hello

thanks a lot for your answers,it helps me a lot!

Pierre