1 The Mathematics of Rhythm

The above video contains a demonstration for setting up and playing music on SuperCollider.

First, download this Rhythm Lesson Worksheet.

Then, download SuperCollider: https://supercollider.github.io/download

After you download the Rhythm Lesson Worksheet and SuperCollider, you will also need to download the instrument files linked below.

Tom

Bass Drum

Cowbell 1

Cowbell 2

Tambourine

Snare

Copy and paste the text below into a blank SuperCollider document. Replace all of the lines starting with “/Users/elliottgrabill/Documents…” by clicking and dragging the downloaded audio files (as shown in the above video demonstration).


//HIGHLIGHT “s.boot” and press SHIFT + ENTER. s.boot;

//DOUBLE CLICK to the right of the “(” below. Press SHIFT + ENTER.

(

//Tom

= Buffer.read(s, “/Users/elliottgrabill/Documents/Paper Documents/Math/OER Files/Tom.wav”

);

//Bass Drum

= Buffer.read(s, “/Users/elliottgrabill/Documents/Paper Documents/Math/OER AudioFiles/Bass Drum.wav”

);

// Cowbell 1

= Buffer.read(s, “/Users/elliottgrabill/Documents/Paper Documents/Math/OER Files/Cowbell

1.wav”

);

// Cowbell 2

= Buffer.read(s, “/Users/elliottgrabill/Documents/Paper Documents/Math/OER AudioFiles/Cowbell 2.wav”

);

//Tambourine

= Buffer.read(s, “/Users/elliottgrabill/Documents/Paper Documents/Math/OERFiles/Tambourine.wav”

);

// Snare

= Buffer.read(s, “/Users/elliottgrabill/Documents/Paper Documents/Math/OER AudioFiles/Snare.wav”

);

SynthDef(“normal”, {

arg amp = 1, bufnum = 0, rate = 1.066666667, loop = 0, ffreq = 1000, rel = 10; var snd;

var env = Env.new([0, 5, 1, 0], [0.01, 16, 6],[-5, 0, 3]);

var envgen = EnvGen.ar(env, doneAction: 2);

snd = PlayBuf.ar( numChannels: 2, bufnum: bufnum, rate: rate, loop: loop ) * envgen * amp;

Out.ar([0, 1], snd);

}

).add;

~mySynth = Synth(“normal”, [\bufnum, a, \amp, 0.1, \rel, 10]);

)

// EXAMPLE 1

~drum = Pbind(

\instrument, “normal”,

\bufnum, a,

\dur, Pseq([

1, 0.33333, 0.33333, 0.33333, 1, 2,

1, 2

], 15),

\rate, 1

).play;

// EXAMPLE 2

~drum = Pbind(

\instrument, “normal”,

\bufnum, a,

\dur, Pseq([

2, 2, // MEASURE 1

0.5, 0.5, 2.5, 0.5 // MEASURE 2

], 15),

\rate, 1

).play;

// EXAMPLE 3

// TWO RHYTHMS AT THE SAME TIME

t = TempoClock(144/60);

{

~tambourine = Pbind(

\instrument, “normal”,

\bufnum, e,

\dur, Pseq([

1, 0.33333, 0.33333, 0.33333, 1, 2,

1, 2

], 5),

\rate, 1

).play(t);

~drum = Pbind(

\instrument, “normal”,

\bufnum, c,

\dur, Pseq([

1.5, 2.5,

1.5, 2.5

], 5),

\rate, 1

).play(t);

}.fork(t);

// EXAMPLE 4

// cCHANGING THE TEMPO

t = TempoClock(144/60);

{

~tambourine = Pbind(

\instrument, “normal”,

\bufnum, e,

\dur, Pseq([

1, 1, 0.5, 1,

0.5, 0.5, 0.5, 0.5, 0.5

], 5),

\rate, 1

).play(t);

~drum = Pbind(

\instrument, “normal”,

\bufnum, c,

\dur, Pseq([

1.5, 1.5,

1.5, 1.5

], 5),

\rate, 1

).play(t);

}.fork(t);

License

Icon for the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License

The Mathematics of Rhythm Copyright © by Elliott Grabill is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License, except where otherwise noted.

Share This Book