«Re: circling transpositions» by Luka P.

on 18 Feb'20 15:13 in code forkslowmelodicmelodiesarpeggiato

some playing around with m/c/g-transpose in Pbind. this stops after it 2 repetitions, but it could start at the beginning and go on forever - just change the last "2" in \ctranspose to inf or however cycles you want. also, it uses a JPverb, so you need sc3_plugins, otherwise change rev line in reverbBus SynthDef to rev = input; or some other selfmade poor-woman's reverb.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
( // pure melody experiments
SynthDef("plucking", {arg out = 0, amp = 0.1, freq = 440, decay = 5, coef = 0.1;
	var env, snd;
	env = EnvGen.kr(Env.linen(0, decay, 0), doneAction: 2);
	snd = Pluck.ar(
		in: BrownNoise.ar(amp),
		trig: Impulse.kr(0),
		maxdelaytime: 0.1,
		delaytime: freq.reciprocal,
		decaytime: decay,
		coef: coef);
	snd = LeakDC.ar(snd).clip2;
	Out.ar(out, snd * env);
}).add;

b = Bus.audio(s,1);

SynthDef("reverbBus", { arg outBus = 0, inBus, wet = 0.1;
	var input, rev;
	input = In.ar(inBus,1);
	rev = JPverb.ar(input * wet, t60:6, damp:0.5);
	DetectSilence.ar(rev, doneAction: Done.freeSelf); 
    Out.ar(outBus, input + (rev));
}).add;

r = Synth("reverbBus", [\inBus, b, \wet, 0.5]);

Pbind(
	\instrument, "plucking",
	\scale, Scale.major.tuning_(\just),
	\octave, 4,

	\degree, Pseq([1, 3, 7, 3,-4,-2, 7, 8, 1,-2, 2, 3], inf),
	\mtranspose, Pseq([Pseq([0],144),Pseq([0],48),Pseq([3],48),Pseq([4],48)], inf),
	\gtranspose, Pseq([Pseq([0],36),Pseq([4],36),Pseq([[-3]],36),Pseq([2],36)],inf),
	\ctranspose, Pser([Pseries(-4,1,4) +.x Pseq([0], 144)],2),

	\coef, Pseq([ Pseq([
			Prand([0.2,0.3,0.4,0.5],1),
			Prand([0.6,0.5],5),
			Prand([0.2,0.3],1),
			Prand([0.6,0.5],5)
		], 1),
			Prand([0.7,0.6],12)
		],inf),
	
	\dur, Pseq([Prand([0.25,0.25,0.24,0.245,0.255,0.25], 140),0.26,0.3,0.4,0.7], inf)
	      * Pseq([Pseq([0.8],110), Pgeom(0.8,1.002,34)],inf), 

	\decay, Pseq([8, Prand([1,2,3,4], 4),3,2,1], inf),

	\out, b, \amp, 0.4,
).play;
)
raw 1523 chars (focus & ctrl+a+c to copy)
reception
comments