processBlock and Script Time Variant Modulator
-
Let's talk processBlock, its usage and syntax. Also the Script Time Variant Modulator.There are a few scattered examples on the forum for using it to create custom routing quickly and efficiently with a few lines of code (very useful), and this example for creating a smoothed value control.
None of this is in the docs so post what you know.
Does processBlock execute based on buffer size? Is this where you would write your algorithms for scripted modulators?
Is using the scriptnode instead preferable? How would you go about creating a simple custom LFO? Using the oscillator in scriptnode at first seems to work as intended but different notes alter the rate of it and the rate only seems to go down to 20. I don't see a node which can feed engine uptime to be used with the math notes, so I guess it's back to code and processBlock? Is Engine.getUptime a fast, consistent, stable (i.e. are the results 100% consistent in offline renders) thing to be used here?
-
@aaronventure scriptnode is definitely the way to go - the processBlock way is just sticking around for backwards compatibility.
If you don‘t want the oscillator to react on the midi input, put it in a no_midi container. The range of every scriptnode parameter can be changed by clicking on the arrow that appears on hover.
-
Is Engine.getUptime a fast, consistent, stable (i.e. are the results 100% consistent in offline renders) thing to be used here?
Yes. The uptime is counting the samples that are processed in the audio callback so it will behave the same in an audio export context.
-
Thanks for clearing it all up.