Group 04

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=48000):
    return Audio(wave, rate=sample_rate, normalize=False, autoplay=False)

Tempo and grid

bpm = 100

Patterns

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

hh = fit_4(hihat('closed'), 2, bpm)
ps = pause(10)
hh_sw = swing(hh, hh, 16, 0.66, bpm)
kck = fit_4(kick(), 4, bpm)
snr = fit_4(snare(), 4, bpm)
play(hh_sw*64)

kck_patt = render_pattern_4('xxxx', kck, 4, bpm)
snr_patt = render_pattern_4('.x.x', snr, 4, bpm)
hh_patt = render_pattern_4('xxx..xx.', hh, 8, bpm)
hh_patt_sw = render_pattern_4('...xx..x', hh_sw, 8, bpm)

intro = snr + fit_4(snr, 2, bpm) + swing(snr, snr, 16, 0.66, bpm)

bar = mix(kck_patt, snr_patt, 0.6, 1)
hh_patt_tot = mix(hh_patt, hh_patt_sw)
bar = mix(bar, hh_patt_tot, 1, 0.7)

Listen

play(intro + bar * 4)