2022-01-05

This is #jamuary jam number 4. A lot of fiddling with code today and not a lot of music. But I did manage to combine the techniques in the previous jams into a single supercollider file:

(
s.waitForBoot({
  ~fx_bus = Bus.audio(s, 2);
  ~mixer_bus = Bus.audio(s, 2);
  ~synth_group = Group.new;
  ~fx_group = Group.after(~synth_group);
  ~mixer_group = Group.after(~fx_group);

  SynthDef(\floaty, { |outbus, sendbus, model = 0, gate = 1|
	var out, env;
	var notes = [82,79,75,72,70,67,63,60,58,55,51,48];
	var seq_freq = 7;
	var sequence = Select.kr(Stepper.kr(trig: Impulse.kr(seq_freq), min: 0, max: 11), notes);

	env = EnvGen.ar(Env.asr(0.5,1,0.5), gate, doneAction: 2);
	out = MiBraids.ar(pitch: sequence, model: model) * env;

	Out.ar(outbus, (out * 0.1) ! 2);
	Out.ar(sendbus, (out * 0.1) ! 2);
  }).add();

  SynthDef(\pulse, { |outbus, sendbus, freq = 440, amp = 0.1|
	var out;

	out = EnvGen.ar(Env.perc(0.01, 1), doneAction: 2) * amp *
	Pulse.ar(freq, 0.3);
	out = LPF.ar(out, EnvGen.ar(Env.perc(0.1, 1, 7000*amp)));

	Out.ar(outbus, out ! 2);
	Out.ar(sendbus, (out * 0.3) ! 2);
  }).add();

  SynthDef(\fx, { |in, out|
	var snd = In.ar(in, 2);
	Out.ar(out, CombC.ar(snd, maxdelaytime: 1, delaytime: 0.5, decaytime: 2));
  }).add();

  SynthDef(\mixer, {
	arg out, in;
	Out.ar(out, In.ar(in, 2).softclip);
  }).add();

  s.sync;

  Synth(\fx, [\in, ~fx_bus, \out, ~mixer_bus], ~fx_group);
  Synth(\mixer, [\in, ~mixer_bus, \out, 0], ~mixer_group);
})
)

(
TempoClock.default.tempo = 60/60;

Pbind(
  \instrument, \pulse,
  \group, ~synth_group,
  \outbus, ~mixer_bus,
  \sendbus, ~fx_bus,
  \scale, Scale.minorPentatonic,
  \amp, Prand(#[0.2, 0.3, 0.4, 0.5], inf),
  \degree, Pwrand(
	list: [
	  -5,
	  Prand((0..9)),
	  Prand((10..14)),
	  Rest()
	],
	weights: [3, 10, 2, 5].normalizeSum,
	repeats: inf),
).play();

Pbind(
  \instrument, \floaty,
  \group, ~synth_group,
  \outbus, ~mixer_bus,
  \sendbus, ~fx_bus,
  \dur, 1.6,
  \model, Pwrand([Rest(), Prand((0..20))], [5, 1].normalizeSum, repeats: inf),
).play();
)