shiihs version is good, but can be made a bit more pattern-idiomatic (e.g. Pfunc { rrand(x, y) } == Pwhite(x, y)
).
(
Pbind(
\instrument, \resonator,
\atk, Pwhite(0.1, 2.0),
\sus, Pwhite(0.5, 2.0),
\rel, Pexprand(2.0, 6.0),
\c1, Pexprand(1, 8),
\c2, Pexprand(-8, -1),
\sndBuf, Pseq([
// actually this doesn't work
// unless ~samples is an array-of-arrays
Prand(~samples[\icebell_long] ++ ~samples[\tamtam_shimmer], 15),
Pseq([Rest(1)], 1)
], inf),
\dur, Pseq([
Pwhite(0.2, 0.4, 15),
Pwhite(2.0, 3.0, 1)
], inf),
\rate, Pwhite(0.95, 1.05),
\amp, Pexprand(0.08, 0.18),
\pan, Pwhite(-0.9, 0.9),
\spos, Pwhite(0, 10000),
\dec, Pexprand(0.08, 0.18),
\group, ~mainGrp,
\out, Pseq([0,1], inf),
).play(t, quant:1);
)
I sometimes feel that pairing keys (sndBuf
and dur
) by numbers of items can be fragile. Another way is like this:
(
p = Pseq([
Pbind(
\instrument, \resonator,
\atk, Pwhite(0.1, 2.0),
\sus, Pwhite(0.5, 2.0),
\rel, Pexprand(2.0, 6.0),
\c1, Pexprand(1, 8),
\c2, Pexprand(-8, -1),
// actually this doesn't work
// unless ~samples is an array-of-arrays
\sndBuf, Prand(~samples[\icebell_long] ++ ~samples[\tamtam_shimmer], 15),
\dur, Pwhite(0.2, 0.4, inf),
\rate, Pwhite(0.95, 1.05),
\amp, Pexprand(0.08, 0.18),
\pan, Pwhite(-0.9, 0.9),
\spos, Pwhite(0, 10000),
\dec, Pexprand(0.08, 0.18),
\group, ~mainGrp,
\out, Pseq([0,1], inf),
),
Pfuncn({ Event.silent(rrand(2.0, 3.0)) }, 1)
], inf).play(t, quant:1);
)
Or, moving the flow-of-control number 15 to the top for more visibility:
(
p = Pseq([
Pfin(15, Pbind(
\instrument, \resonator,
\atk, Pwhite(0.1, 2.0),
\sus, Pwhite(0.5, 2.0),
\rel, Pexprand(2.0, 6.0),
\c1, Pexprand(1, 8),
\c2, Pexprand(-8, -1),
// actually this doesn't work
// unless ~samples is an array-of-arrays
\sndBuf, Prand(~samples[\icebell_long] ++ ~samples[\tamtam_shimmer], inf),
\dur, Pwhite(0.2, 0.4, inf),
\rate, Pwhite(0.95, 1.05),
\amp, Pexprand(0.08, 0.18),
\pan, Pwhite(-0.9, 0.9),
\spos, Pwhite(0, 10000),
\dec, Pexprand(0.08, 0.18),
\group, ~mainGrp,
\out, Pseq([0,1], inf),
)),
Pfuncn({ Event.silent(rrand(2.0, 3.0)) }, 1)
], inf).play(t, quant:1);
)
22-05-04 edited to use Pfuncn for the rests (otherwise it will repeat the rest forever, oops…).
hjh