javascript for timing relevant processing possible?
Hi Forum,
i want to process midi messages in Max4Live using JavaScript. The processig itself is simple and will take nearly zero cpu time. So Javascript general performance should not be a problem for me...
Anyhow, In the forum i read that the immediate property is not working on max5 (Windows) and is deprecated in max6. So with this limitation is it possible at all to write timing relevant code in max with javascript? What about the LiveApi JavaScript object? Is Java then an alternative (anyhow i would prefer JavaScript if possible because its totally integrated in max).
Can someone shed some light on this topic? Many thanks in advance!
Bye, Dirk.
No.. as you know javascript in max Always run,exec in low-priority thread and if it's find it's self in high it's force to be low..
the result is the same as you know ... 5ms or 5 sec. if some thing is running on the same thread of js you get delay.
You're out of luck with Javascript. If you don't mind firing up a JVM, you could consider Python (https://github.com/cassiel/net.loadbang.jython ) or Clojure (https://github.com/cassiel/net.loadbang.clojure ). I've build sequencers and realtime control systems with both.
(I suppose the Rhino engine in the JVM might be a route to scheduler-aware Javascript in Max; I've not tried it.)
Thank you very much for the answers. I will go with simple standard java if i cannot do it directy in max.
Bye, Dirk.