Hello,
are you aware of any code that can generate single, double, triple paradiddles?
thank you! k
Hello,
are you aware of any code that can generate single, double, triple paradiddles?
thank you! k
If paradiddles are grace notes before the beat, then thereâs:
Youâll need to shorten main note A by the total duration of the grace notes.
Tricky to do in patterns. You might try a Routine or Prout.
hjh
hi nathan. apologies, my question above sounds ignorant. just wished for some guidance. often it turns out that others have done good work on specific things related to rhythm e.g. Fredrikâs Bjorklund quark.
Thanks James.
What got me started on this was a 2010 paper by Toussaint: Generating âGoodâ Musical Rhythms Algorithmically.
single:
double:
tripple:
I might end up with a function generating an Array using some 'ifâs. Then the arrays could be âplayedâ by a Routine, TempoClock, etc.
cheers, k
In the function, how could I
so that I get:
[ 0, 1, 0, 0, 1, 0, 1, 1 ] //single;
[ 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1 ] //double
[ 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1 ] //triple
?
(
~gen = { |bpb,x|
a = nil ! bpb;
(a.size/2).asInt.do{ |b|
if(b<x,
{a[b] = b%2}, //true
{a[b] = a[0]} //false
);
};
a.postln;
}
)
~gen.value(8,3); //single
// posts: [ 0, 1, 0, 0, nil, nil, nil, nil ]
~gen.value(12,5); //double
// posts: [ 0, 1, 0, 1, 0, 0, nil, nil, nil, nil, nil, nil ]
~gen.value(16,7); //triple
// posts: [ 0, 1, 0, 1, 0, 1, 0, 0, nil, nil, nil, nil, nil, nil, nil, nil ]
cheers! k
Hi Rodet, Iâm teaching jazz at college, and sometimes paradiddles come up in conversation (although Iâm not a drummer). A paradiddle is basically a way of âevenlyâ playing a roll (single/double/triple/whatever). If you take your drumsticks/fingers and play evenly:
right, left, right, right, left, right, left, left, right, left, right, right, etc
youâll notice that itâs possible to get an even rhythm, which when played fast becomes a roll. The idea of the single/double/triple is just to place the accents (lightly, or not) on the left, right hand, which if I understand helps keep an even stroke (and makes better sense to follow).
So, although I donât know the goal of your idea, a simple code which would give you the solution could be a pattern. Youâll notice Iâve put in a SynthDef to give the âsnareâ sound - not very real, but just for the demonstration. If you run these patterns, un-commenting the line needed (single, double or triple - donât forget to comment out the lines you donât need), youâll hear the accents a paradiddle gives.
In this example Pbind
âaâ gives the pulse, and Pbind
âbâ the accents. And, if you play along with them (using your chart), youâll notice the accents pass from right hand to left hand (or vice versa). This is (more or less) what paradiddles do, although a drummer will explain better how they âaccentâ strokes to get more complicated/subtle rhythms.
(
SynthDef(\snare, {
arg out=0, sus=0.1;
var sig, env;
sig = WhiteNoise.ar(0.1);
env = EnvGen.kr(Env.perc(0.001, sus), doneAction:2);
sig = sig*env;
Out.ar(out, sig!2);
}).add;
)
(
t=TempoClock(80/60);
a=Pbind(
\instrument, \snare,
\dur, 1/2,
\sus, 0.01
);
b=Pbind(
\instrument, \snare,
\dur, 1,
\sus, Pseq([0.02, 0.01],inf), // single
//\sus, Pseq([0.02, 0.01, 0.01],inf), // double
//\sus, Pseq([0.02, 0.01, 0.01, 0.01],inf), // triple
);
Ppar([a, b]).play(t);
)
I hope that puts you on the right track.
p.s. Donât forget to try out changing the speed to get the real effect. Try something like 320/60 on the TempoClock
.
To strictly answer your question, this is a simple way to do what you ask:
(
a = [ 0, 1, 0, 0, 1, 0, 1, 1 ]; //single;
b = 1 - a; // flip all ones and zeros
c = a ++ b; //concatenate the results
)
resulting in
-> [ 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0 ]
Hi Joesh,
many thanks for taking the time for your reply. The âmusicâ generated with your code sounds similar to the effect needed and it gave me an interesting approach to consider. I might end up end having to looking into Patterns eventually - I have always been working with TempoClock + Routines/Tasks/Functions.
Yes, the faster tempo gives it more of the drum roll effect!
Cheers! k
Thanks @shiihs, works!
(
~gen = { |bpb,x|
a = nil ! (bpb/2);
a.size.asInt.do{ |i|
if(i<x,
{a[i] = i%2}, //true
{a[i] = a[0]} //false
);
};
a.postln;
b = 1 - a; // flip all ones and zeros
c = a ++ b; //concatenate the results
c.postln;
}
)
~gen.value(8,3); //single
~gen.value(12,5); //double
~gen.value(16,7); //triple
hi rodet
Thanks for the reply. As I said, and Iâm sure others would agree, it always depends on what youâre planning to do - with whatever. If itâs music, then maybe patterns could be a way to go, giving you plenty of room for development, especially if you turn them into Pbindef
or use ProxySpace
for live coding, etc.
Iâm often working on drum patterns and sounds. Itâs, in my humble opinion, one of the most difficult things to get working, and sound natural. However, itâs a lot of fun, and you learn a lot about Patterns, TempoClocks and also Synthdefs by trying to master this area.
Good luck.
Thanks Joesh,
Yes, I got interested in Ndef âstyleâ live coding a few months ago.
The natural sound, yes, I am after that as well! The sequencer I have been building triggers short sound recordings made on a frame drum. I will try to connect this paradiddle part to the rest and perhaps ask for feedback on how natural it sounds
Earlier I got help here for loading a whole folder of audio samples into buffers, so now the sequencer can somewhat randomly choose between a large number of âalmostâ identical sounds - hopefully this will add some umami!
Cheers, k
When talking about ânaturalâ sound, I guess one should also consider adding subtle âerrorsâ (random variations) in timing and velocity to each note, preferably in a clever way to ensure that overall timing after a while doesnât get hopelessly out of sync and that volumes do not derail.