I’ve been working on a new SuperCollider framework that envisions a forward-looking and I think much better way of making music with sclang, and resolves a lot of historical challenges and idiosyncracies. I am loosely calling it “declarative sclang”, but its really just building an expressive DSL that’s MORE declarative than existing patterns. As it is now, I’m actively using it to make music and experiment with syntax, so you can imagine it’s somewhere on a dusty side-road in between existing-sclang and some kind of “SuperCollider 4”-style rigorous and utopian “new language”. I’ve been keeping a contract with myself that it always be usable for actual music-making - avoiding the classic SuperCollider trap of “making frameworks instead of making sounds” - but also grounding the more abstract computer science experiments with real use-cases. It’s been incredible effective for this - I’ve used versions of this on three separate live performances or installations in the last 6 months, including one very serious and complex one.
To outline a few principles that are at the core - these are north stars, and not finished features ![]()
- User code is 1:1 with the desired outcome, not a recipe or roadmap to reach the outcome.
- User code specifies routing, the framework handles node ordering and bus allocation (not user-space problems, and have an a priori solution)
- Missing SynthDefs, Buffers, and Node’s (“node not found”) on the server are impossible. If something is supposed to be there, it will be there. Complex async scheduling is handled correctly, no “first run this, then run this”.
- Objects are not isolated, they live in a shared namespace and can reference and depend on each other. References and routing are fundamental concepts.
- Everything is (possibly) a pattern - meaning: everything has the potential to change over time.
- Composability and modularity as core concepts: a complex graph of 10 Synths should be playable using exactly the same code as a single Synth.
- Semantics should make important musical concepts (“phrases”, “voices”, signal chains) trivial to express without utility functions, sugar, or magic.
- Avoid layering new design patterns on top of ones: aim for a rigorous from-scratch server interface etc that has good INTEROP with old code, rather than trying to WRAP old classes in new packaging.
I want to share some of this because it’s exciting, and also because I’d like to get some feedback from other folks in the community, since thus far this has been oriented toward my own music workflows.
So this Sunday at 16:00 CET, I’ll do a live stream where I’ll demo the features and do some actual music making with it.
Twitch stream is here: Twitch
If there’s a critical mass of people, I would do a more organized walk-through, otherwise I’ll probably just jam for a few hours and answer questions or discuss things ad hoc! If you miss it, i’ll probably do more of these so don’t sweat it.
hopefully see some of y’all there! I can also answer questions on here as well.
Here’s an example of some real, working code that represents a subset of the frameworks capabilities, but I think it demonstrates some things that are quite hard to do with vanilla SC code, or any existing frameworks:
(
~p = PioPlayer();
// THE DRIVER: control only, no synth — ONE event per section; it owns the harmony
~p[\driver] =
PioType.meta.bind(
dur: 8,
legato: Pwhite(0.3, 1.0),
which: Pseq([\a, \a, \b, \c], inf),
scale: Pseq([
Scale([0, 3, 7, 10, 14, 17, 21], 24),
Scale([-1, 4, 6, 8, 14, 17, 21], 24),
], inf).stutter(2),
chord: Pseq([0, 3, -2, 5], inf),
);
// A DEF SLOT: a graph, consumed by name — NamedOut(\wet) is a second output
~p[\pluckDef] =
PioType.synthDef {
var freq = \freq.kr(220),
env = Env.perc(0.002, \decay.kr(0.3), curve: -6).kr(doneAction: 2),
sig = SinOsc.ar(freq, SinOsc.ar(freq * \ratio.kr(1.414)) * \index.kr(3) * env);
sig = Pan2.ar(sig * env * 0.5, \pan.kr(0));
sig ==> NamedOut();
sig ==> NamedOut(\wet);
};
// MONO + a BUILD-time hole: `spread:` shapes the graph, .bind keys are controls
~p[\pad] =
PioType.synthDef(mono: true, spread: 8) {
var n = \spread.def(2),
env = Env.asr(2, 1, 4).kr(gate: \gate.kr(1), doneAction: 2),
sig = Ringz.ar(
0.1 * Crackle.ar(),
freq: \freq.kr(110) * ((0..n - 1) * 2.5).midiratio,
decaytime: 0.5
).mean;
sig = sig - FreqShift.ar(sig, LFDNoise3.kr(1/5).range(-0.04, 0.04));
NamedOut() <== (Splay.ar(LPF.ar(sig, \cutoff.kr(800))) * env);
}.bind(
octave: 5,
scale: PioKey(\driver, \scale),
degree: PioKey(\driver, \chord),
cutoff: PioLift.mod { LFDNoise3.kr(1/4).exprange(300, 9400) },
amp: -20.dbamp,
);
// DISPATCH: trigger a pattern on \a, \b
~p[\arp] =
PioSync(\driver).filter {
|e| [\a, \b].includes(e[\which])
}.with {
PioType(PioKey(\pluckDef)).bind(
octave: 5,
scale: ~scale,
degree: ~chord + Pshuf([0, 4, 1, 6, 3, 9, 2], inf),
dur: if (~which == \b) { 3/4 } { 2/8 },
index: Pexprand(0.3, 8),
decay: 1 * Pseq([1, 0.4, 0.6], inf),
amp: 0.2 * Pseq([1, 0.4, 0.6], inf),
amp_wet: 0.1,
)
};
// A FORK: each event spawns a phrase, windowed to that event's dur — the meta-durs
// are the phrase lengths, and `steps` is the one setting each phrase is handed
~p[\bass] =
PioType.fork(
steps: Pseq([[0, 0, 3], [0, -2, 5, 1], [0, 7], [0, 3, -2]], inf),
)
{ // runs IN the fork event: reads ~steps
PioType(PioKey(\pluckDef)).bind(
octave: 3,
scale: PioKey(\driver, \scale),
degree: \bump.ev + PioKey(\driver, \chord) + Pseq(\steps.def, inf),
dur: Prand([3/4, 3/4, 1/2], inf),
decay: 0.4,
index: 1.2,
amp: 0.3,
)
}
.bind(
dur: Pseq([4, 2, 2, 8], inf),
legato: 1,
bump: Pwhite(-4, 24),
);
~p[\echo] = PioType.fx { |in| in + CombC.ar(in, 1, LFDNoise3.kr(0.1).range(6/8, 6/8.1), 3) }.bind();
~p[\verb] = PioType.fx { |in| FreeVerb2.ar(in[0], in[1], 1, 0.9, 0.3) }.bind();
~p.route {
~bass --> ~echo;
~arp[\wet] --> ~verb;
[
~arp,
~pad,
~echo,
~verb
] --> ~output;
}.play();
)