2022-01-09

#jamuary jam number 6. A more fleshed-out version of yesterday’s jam. I’ve added some bass and a little noise/percussion. There’s also a little variation in the chord and melody voices using some modulation.

(
SynthDef(\tri, { |out, freq = 440, gate=1|
  var snd;

  snd = EnvGen.ar(Env.asr(3, 0.9, 3), gate: gate, doneAction: 2) *
  Mix.new([LFTri.ar(freq + FSinOsc.kr(1, mul: 1.5)), LFTri.ar(freq*(6/5) + FSinOsc.kr(1.1, mul: 0.5)), PinkNoise.ar(0.2)]);
  snd = LPF.ar(snd, 1000);

  Out.ar(out, Pan2.ar(snd * 0.2));
}).add();
)

(
SynthDef(\blip, { | out, midinote = 60, t_trig = 1 |
	var audio = MiPlaits.ar(midinote, trigger: t_trig, engine: 11, morph: LFNoise0.kr(1, 0.2, 0.5), harm: LFNoise0.kr(1, 0.2, 0.1) );
	var env = EnvGen.ar(Env.perc(0.01, 2), t_trig, doneAction: 2);
	OffsetOut.ar(out, audio * env);
}).add;
)

(
SynthDef(\nse, { | out, midinote = 60, t_trig = 1 |
	var audio = MiPlaits.ar(midinote, trigger: t_trig, engine: 9, timbre: 0.7.rrand(0.9), harm: LFNoise0.kr(0.5, 0.2, 0.1) );
	var env = EnvGen.ar(Env.perc(0.01, 1), t_trig, 0.3, doneAction: 2);
	OffsetOut.ar(out, audio * env);
}).add;
)

(
Pdef(\chords, Pbind(
  \instrument, \tri,
  \scale, Scale.minorPentatonic,
  \out, 0,
  \degree, Pseq([0, 3, -2], inf),
  \dur, 10,
));

Pdef(\noise, Pbind(
  \instrument, \nse,
  \out, 2,
  \trig, 1,
  \delta, Pbjorklund(3,8) * 2,
));

Pdef(\melody, Pbind(
  \instrument, \blip,
  \scale, Scale.minorPentatonic,
  \out, 3,
  \trig, 1,
  \degree, Pseq([0, 3, -4, -2], inf),
  \delta, Pbjorklund2(5, 8) / 2,
));

Pdef(\melody2, Pbind(
  \instrument, \blip,
  \scale, Scale.minorPentatonic,
  \out, 4,
  \trig, 1,
  \degree, Pseq([0, 3, -4, 4], inf) - 5,
  \delta, Pbjorklund2(7, 8),
));
)

(
Pdef(\noise).play;
Pdef(\chords).play;
Pdef(\melody).play;
Pdef(\melody2).play;
)

I did some basic arrangement of the voices in Reaper to give the track a bit of variation and movement. I’d like to be able to either live-code, or preferably play (using a MIDI controller) these variations in the future.