Hello, I was thinking to make an accent on every ‘one’ of a random 4/4 drum pattern. I’m showing a simple percussion in my code. the pattern ‘a’ is predetermined and gives a accent on the 1 of the 4/4 time signature. The random pattern gives the accent on the first iteration, but then the accent becomes randomly. How can i tie the accent also to the 1 of the 4/4 pattern, no matter what randomness is generated in the \dur key?
I hope i managed to describe the problem appropriately, however here is the code, maybe it becomes clearer what I’m trying to archive. I guess its not a very difficult task. Thank you!
SynthDef(\noise,{|amp=1,freq=440| Out.ar(0,amp*BPF.ar(WhiteNoise.ar(Line.kr(1,0,0.2,doneAction:2)**3),freq,0.2))}).add
(
a.stop;
b.stop;
a = Pbind(
\instrument, \noise,
\freq, 440,
\dur, 0.25,
\amp, Pseq([1]++(0.25!3),inf),
).play;
b = Pbind(
\instrument, \noise,
\freq, 2200,
\dur, Prand([Pseq([0.125],2),0.25],inf),
\amp, Pseq([1]++(0.25!3),inf),// this amp should be 1 at the same time as a, and 0.25 otherwise. basically on the first stroke of the 4/4 time pattern
).play
)
PS: I used emphasis in the title, not sure if that is the right word, in German I’ve meant ‘Betonung’.