supercollider/supercollider — pull request #1041 by jamshark70 (2014-02-23 03:25:03+00:00)
Title: Classlib: JIT: Improved handling of SimpleNumbers as sources in NodeProxy

These patches change the behavior of numbers as NodeProxy sources.

- Old behavior: `np.source = 440` would create a `DC.kr` synth. Changing the source to another number would create another `DC.kr` synth, cross fading against the old one. If the source changes were rapid -- say, from a GUI -- you would get multiple cross fades overlapping and summing, producing large spikes in the value. (That's not to mention the inefficiency of creating a new SynthDef for every value.)

- New behavior: `np.source = 440` creates a synth with a NamedControl (in a new proxy interface class, ScalarSynthControl). Changing the source to another number first checks if the proxy interface is already a ScalarSynthControl. If yes, it just sets the control, no new synth.

I've been using this for a few weeks and it works well. RawArrays are also supported.

I did have to change some method signatures, to pass the proxy object and index into the proxy interfaces. There might be some disagreement about that. So my main reason to submit the pull request is to have a place to track the discussion.

I wouldn't mind a different implementation that gets the same result.