Plug'n Script: processBlock timing
-
- KVRian
- Topic Starter
- 628 posts since 18 May, 2010
Hi,
I bought Plug 'n Script v3. Great product. Now I am trying to write my first complex MIDI processing script, and I seem to need to so something with a bit of delay. The documentation comes up blank, but it seems the processBlock() function is called repeatedly.
So my question: is it guaranteed to be called at a certain frequency (and what frequency is that), or is that just because of my particular set-up? Is there another way to get a repeated function call in a MIDI script or set a time-out function?
Edit: that always happens: now I see in the docs that processBlock() is called on every block of samples, and there is an indirect pointer to the timestamp. I guess that solves my problem.
I bought Plug 'n Script v3. Great product. Now I am trying to write my first complex MIDI processing script, and I seem to need to so something with a bit of delay. The documentation comes up blank, but it seems the processBlock() function is called repeatedly.
So my question: is it guaranteed to be called at a certain frequency (and what frequency is that), or is that just because of my particular set-up? Is there another way to get a repeated function call in a MIDI script or set a time-out function?
Edit: that always happens: now I see in the docs that processBlock() is called on every block of samples, and there is an indirect pointer to the timestamp. I guess that solves my problem.
-
Blue Cat Audio Blue Cat Audio https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=39981
- KVRAF
- 5821 posts since 8 Sep, 2004 from Paris (France)
It is indeed called for every audio block and includes all MIDI events that have been received since last call.
-
- KVRian
- Topic Starter
- 628 posts since 18 May, 2010
Thanks. So the call frequency is sample rate/buffer size, I guess? Or does that differ over hosts? Anyway, I need a time resolution in the order of tens of ms, so it's fast enough.
-
Blue Cat Audio Blue Cat Audio https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=39981
- KVRAF
- 5821 posts since 8 Sep, 2004 from Paris (France)
In most cases, yes, and sometimes it may be faster (some hosts will call you back with smaller buffers, when parameter changes for example).