Forums > Javascript

efficiency in js / coll / funbuff

September 18, 2006 | 7:52 pm

Hi,

I’ve built a relatively simple step sequencer with js gui, but the basic info is stored in 3 funbuff’s and a coll, and triggered with a metro/counter combination.
The problem is the timing is really poor, even to my unmusical ears. I presume this is some kind of efficiency issue. The timing is even worse when you are altering things in the gui, although i have ensured that a message is only sent out on release of the mouse button etc.
At the moment it’s literally one track, which can store upto 128 note numbers, associated velocities, trigger times and durations. It also uses about 90% of my cpu so something wrong must be going on. I have ensured the notes are triggered at the right point using a delay and the stash object.
There are no msp objects, it’s all max.

Any ideas?
Cheers
Tom



jml
October 13, 2006 | 1:31 am

this is a priority thread issue.

without seeing a patch/script, it’s hard to know exactly how to help.
but i think it’s worth mentioning (as has been mentioned in various places on this list) that js is not the methodology to use for calculating timing-critical events.

coll operates quickly (as does jitter). in terms of changing the data in realtime i would suggest using some sort of updating mechanism whereby you can input the js-info (at low priority) into the patch without disturbing the sync and have it output upon the next servicing…
see example below.

#P window setfont Geneva 9.;
#P window linecount 1;
#P newex 88 191 59 11337737 print yeaye;
#P toggle 32 57 15 0;
#P newex 32 81 56 11337737 metro 100;
#P newex 88 146 27 11337737 f;
#P user jsui 129 51 64 64 1 0 0 none;
#P connect 0 0 1 1;
#P connect 2 0 1 0;
#P connect 1 0 4 0;
#P connect 3 0 2 0;
#P window clipboard copycount 5;

jl


Viewing 2 posts - 1 through 2 (of 2 total)