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:

• Main note A
• Grace note(s)
• Main note B

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

1 Like

iâm realizing now that my previous comment came off as unnecessarily cranky, sorry about that! i just think itâs better if you take a crack at it and let us know if run into more specific questions.

1 Like

In the function, how could I

1. duplicate the first part of the array (a) and
2. swap the 0s and 1s in the duplicated (second half)

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);
)

(
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`.

1 Like

``````(
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 ]
``````
1 Like

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.

1 Like

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.

2 Likes