Group 06

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_mj = 117
bpm_queen = 110
step_mj = 60 / bpm_mj / 2
step_queen = 60 / bpm_queen / 2

Patterns

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

# Michael Jackson - Billie Jean

def maracas(sample_rate):
  return open_hat(duration=0.07, tau=0.025, amplitude=0.10, sample_rate=sample_rate)

track_mj_1 = [
    ("x...x...", kick, step_mj),
    ("..x...x.", snare, step_mj),
    ("xxxxxxxx", closed_hat, step_mj),
]*2

track_mj_2 = [
    ("x...x...", kick, step_mj),
    ("..x...x.", snare, step_mj),
    ("xxxxxxxx", closed_hat, step_mj),
    ("xxxxxxxx", maracas, step_mj),
]*2

bar_mj = (render_tracks(track_mj_1)*2) + (render_tracks(track_mj_2)*2)
# Queen - Another One Bites the Dust

track_queen = [
    ("x.x.x.x.", kick, step_queen),
    ("..x...x.", snare, step_queen),
    ("xxxxxxxx", closed_hat, step_queen),
]

bar_queen = (render_tracks(track_queen)*2)
# Mashup| Billie Jean & Another One Bites the Dust

bpm_mashup = 117
step_mashup = 60 / bpm_mashup / 2

track_queen_mashup = [
    ("x.x.x.x.", kick, step_mashup),
    ("..x...x.", snare, step_mashup),
    ("xxxxxxxx", closed_hat, step_mashup),
]

bar_queen_mashup = render_tracks(track_queen_mashup)

Listen

play(bar_mj)
play(bar_queen)
play(bar_queen_mashup+ bar_mj)