[code feedback] - how to improve code semantics in a kiasmos+nils frahm synthesis emulation with alternative chords

Greetings

i did this piece of code alone, with the help of some friends. can someone please provide me with means to further iterate this in terms of syntax semantics?

thank you so much

(
s.options.memSize= 8192*20;
s.reboot;
)

(
SynthDef(\kiasmosPad, {arg freq = 440, out = 0, amp = 1, atk= 0.01, rel= 0.01, dur = 1;
    var carriers, modulators, mix, verb, filter, env, filterEnv;
    freq = freq + [0, Rand(1,4)];
    carriers = [SinOsc, Saw, Pulse].collect(_.ar(freq));
    modulators = carriers.collect {|c| SinOsc.kr(rrand(0.0322,1.0)*0.0647)};
    mix = Mix(carriers * modulators) * 0.15;
    verb = FreeVerb.ar(mix)/*+sig*/;

	filterEnv = EnvGen.kr(Env([3600, 220], dur, \exp), doneAction: Done.freeSelf);
	env = EnvGen.kr(Env([0, 1, 1, 0], [atk, dur - atk - rel, rel], [4,-4]));

	filter = LPF.ar(verb, filterEnv);
	Out.ar(out, filter * env * amp);
}).add;
)

(
Pbind(
	\instrument, \kiasmosPad,
	\scale, Scale.ionian,
	\degree, Prand((0..12), inf) + [0,1,5],
	\amp, 0.6,
	\atk, 1, \rel, 0.5,
	\legato, 2,
	\dur, 20
).play
)

(
Pbind(
	\instrument, \kiasmosPad,
	\scale, Scale.major,
	\degree, Prand((0..12), inf) + [0,1,5],
	\amp, 0.6,
	\atk, 1, \rel, 0.5,
	\legato, 2,
	\dur, 20
).play
)

(
Pbind(
	\instrument, \kiasmosPad,
	\scale, Scale.minor,
	\degree, Prand((0..12), inf) + [0,1,5],
	\amp, 0.6,
	\atk, 1, \rel, 0.5,
	\legato, 2,
	\dur, 20
).play
)

(
Pbind(
	\instrument, \kiasmosPad,
	\scale, Scale.dorian,
	\degree, Prand((0..12), inf) + [0,1,5],
	\amp, 0.6,
	\atk, 1, \rel, 0.5,
	\legato, 2,
	\dur, 20
).play
)

(
Pbind(
	\instrument, \kiasmosPad,
	\scale, Scale.chromatic,
	\degree, Prand((0..12), inf) + [0,1,5],
	\amp, 0.6,
	\atk, 1, \rel, 0.5,
	\legato, 2,
	\dur, 20
).play
)

(
Pbind(
	\instrument, \kiasmosPad,
	\scale, Scale.todi,
	\degree, Prand((0..12), inf) + [0,1,5],
	\amp, 0.6,
	\atk, 1, \rel, 0.5,
	\legato, 2,
	\dur, 20
).play
)

(
Pbind(
	\instrument, \kiasmosPad,
	\scale, Scale.hijaz,
	\degree, Prand((0..12), inf) + [0,1,5],
	\amp, 0.6,
	\atk, 1, \rel, 0.5,
	\legato, 2,
	\dur, 20
).play
2 Likes

Not bad at all :grin: the “collect” for the carriers and modulators is IMO good style.

Usually the doneAction should belong to the volume envelope, not an envelope modulating a different parameter. Why is it on filterEnv here?

You have a separate reverb per note, and the doneAction is likely to cut off the reverb tail. In general, reverb works better (and uses less CPU) if there is one reverb as an effect synth, and the notes all feed into it.

hjh

some of it were suggestions of gianluca elia, an italian guy who is part of the online meetup of supercollider denmark

still i am not happy with pbind syntax

You could write a function that returns a Pbind. The function would have a “scale” argument and you would use this for the \scale in the Pbind.

hjh

just wanted to jump in and say I was really struck at how beautiful this sounds,
and I’m finding it instructive as a newer supercollider user,
thanks for sharing!

1 Like