Hi, I've been hacking together a SuperCollider client in another language (Clojurescript) for use in personal projects. I built a synthdef compiler that works slightly differently from the one in sclang, and I'm trying to make sure that doesn't cause any problems.
In sclang, my understanding is that the UGen graph function that you use in a SynthDef needs to return a single UGen object.
So for example in this function:
{Out.ar(0,SinOsc.ar(220) + SinOsc.ar(330))}
I return an Out UGen, which is reading from a BinaryOpUgen, which reads from the two SinOsc Ugens. The UGens are all part of the same connected graph.
If I wanted to express two separate graphs of UGens, I think I would need to create two separate SynthDefs.
The synthdef compiler I'm building in Clojurescript expects a list of UGens rather than a single UGen, so I can do this:
(defsynth test []
(concat (out 0 (sin-osc 220))
(out 0 (sin-osc 330))))
The result is two Out UGens reading from two SinOsc UGens. It's two separate, disconnected graphs. But it sounds like I would expect it to (in this case clipping very badly because both sine waves are at max amplitude in the same channel).
So I'm wondering - is there a way to express disconnected graphs of UGens in a single SynthDef in sclang? Are there any benefits or pitfalls that I should be aware of when creating SynthDefs like this?
-Brian Fay