<jupyter_start><jupyter_text>Let me rephrase the filename, I'll be *trying* to make a drum machine. Let's go!<jupyter_code>import numpy as np
import scipy.signal as signal
import matplotlib.pyplot as plt

import herbie as hb
from nb_utils import play, to_wav
np.random.random()
scale = hb.Scale(mode='chromatic', octave=1, default_note=8)
kick = hb.Generator()

kick.fn = lambda f: np.sin(f * (1.0 - 0.3 * np.random.random()))
attack = (1, 1/64)
decay = (0.01, 1/2)
release = (0, 1/16)
adsr = lambda s: hb.filters.adsr(s, attack, decay, release)
clip = lambda s: hb.filters.clip(s, 0.90, 0.5)
kick.filters = [adsr]
play(kick.sequence(scale.sequence("A A A A A A A A A A A A A A A A A A A A A A A A A A A")))
256 / 44100
hihat = Generator(fn=signal.sawtooth)
hihat.attack = (1, 1/32)
hihat.decay = (0, 1/16)
play(hihat.melody(["C5", "C5", "C5", "C5"]))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16004540295119182, 'fraction_numerical': 0.049943246311010214, 'mean_word_length': 4.313253012048193, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '201314', 'license': 'MIT', 'n_tokens_mistral': 404, 'n_tokens_neox': 374, 'n_words': 114, 'path': 'notebooks/drum_machine.ipynb', 'repo_name': 'filaretov/herbie', 'size': '881'}