(Mod note: If your post is still the most recent post, it’s preferred to edit your existing post with more info. Totally fine to post here with help requests.)
Regarding the output scales, you have the setup call for output[4] correct, except for the = r at the end of that line. output[4].scale is a setup function, not a function that changes the value at the output jack.
The functions as arguments feature is specific to the ASL scripts. At the moment you don’t need that, as you are setting your outputs directly at each timestep.
I think what you need is to make a function that generates a new random value each time it’s called:
function r()
return math.random() * 10.0 - 5.0
end
And then call that in your script:
input[1].change = function()
output[2].volts = r() -- not the parenthesis to call the function
end
Then to clarify the output.scale syntax, you first need to setup the scale quantizer (best in the init script), then simply set output.volts in the input event. Like this:
function init()
output[4].scale( {}, 12, 1.0 )
end
input[1].change = function()
output[4].volts = r() -- call the random function again
end
Let me know if anything’s not clear!