First: Could I ask you to use backticks for code blocks? The website replaced all of your quotes with curved begin/end quotes. So I pasted your code into SC and it doesn’t recognize the strings as strings, and then it takes extra time (4 find/replace cycles!) to make your code runnable.
Code != text, and code != quoted material.
```
code here
```
In your code: it’s a subtle problem, but Done
works with UGens that have a done flag. EnvGen
has a done flag. But env
is not an EnvGen
. It’s a *
.
env = EnvGen.kr(...);
level = vol * env;
doneTrig = Done.kr(env);
I’m gonna be a bit opinionated and say that I don’t think supernova is that important. Also, it has a few nasty bugs (and those bugs are beyond me to fix, because supernova’s C++ style is extremely advanced, and they’re not getting a lot of attention from other developers either… so you could say, in terms of maintenance effort, other developers don’t really feel supernova is that important either).
I used it successfully in one composition. Then, a few months later, I tried to use it in a live set and encountered 1/ frequent crashes during a section transition, 2/ Ringz
sporadically producing garbage output (which didn’t happen in scsynth), and a couple of other issues that I forget now.
So, forgive me, but my opinion of supernova is rather low. Don’t let that hold you back from upgrading.
Thanks so much for the detailed example, I never would have put that together. I’m confused by the ending though: [bufnum: b] ---- doesen’t b point to a buffer itself? I would expect b.bufnum… not saying your wrong of course, just not sure how that all comes together
That’s a good question – you’re paying attention!
As a convenience, many objects can convert themselves into an OSC-friendly representation using asControlInput
. Buffer has:
asControlInput { ^this.bufnum }
If you’re really curious, the execution flow is:
- Synth processes its argument list with
asOSCArgArray
.
- Each element in the argument array does
asOSCArgEmbeddedArray
.
- There are a few special cases for
asOSCArgEmbeddedArray
, but almost everything, including Buffer objects, go through Object’s method: asOSCArgEmbeddedArray { | array| ^array.add(this.asControlInput) }
… and that’s where the buffer gets converted into its bufnum.
could you please explain the scoping brackets in the OSCDef? Obviously they’re for the flop function, but I don’t understand the relevance of the flop.
flop
interleaves elements from several arrays.
So I built an array that contains two arrays:
- An array of names.
- An array of values.
flop
turns those into an array of pairs: [ [ name0, value0 ], [ name1, value1 ], ... ]
. Then it’s easy to iterate over the list of pairs and print them out in a way that makes sense to people.
hjh