Group 01

Download .ipynb

This notebook comes from outside the course materials: it is shown here to read, not to run.

Rebuild the groove

Groove id: …
Category: fidelity / remix / mashup
Group: [removed]…

Use drumkit.py and the Python standard library. Keep play(...) as the last cell: it is what we listen to.

from IPython.display import Audio
from drumkit import *

def play(wave, sample_rate=SR):
    return Audio(wave, rate=sample_rate, normalize=False, autoplay=False)

Tempo and grid

bpm = 100
step_s = 60 / bpm / 4   # one step = one sixteenth

Patterns

One track per instrument. Replace this example with what you hear.

#          1 e & a 2 e & a 3 e & a 4 e & a
tracks = [
    ("x.......x.......", kick, step_s),
    ("....x.......x...", snare, step_s),
    ("x.x.x.x.x.x.x.x.", closed_hat, step_s),
]

bar = render_tracks(tracks)

Listen

play(bar * 4)