mirror of
https://github.com/kennethreitz/pytheory.git
synced 2026-06-05 06:46:14 +00:00
Add individual audio samples for all 4 Playing Patterns examples
Rock, bossa nova, salsa, and afrobeat each get their own audio player. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
BIN
Binary file not shown.
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
@@ -117,6 +117,24 @@ def gen_rock_beat():
|
||||
render("rock_beat", score)
|
||||
|
||||
|
||||
def gen_bossa_nova_pattern():
|
||||
score = Score("4/4", bpm=140)
|
||||
score.drums("bossa nova", repeats=4)
|
||||
render("bossa_nova_pattern", score)
|
||||
|
||||
|
||||
def gen_salsa_pattern():
|
||||
score = Score("4/4", bpm=180)
|
||||
score.drums("salsa", repeats=4)
|
||||
render("salsa_pattern", score)
|
||||
|
||||
|
||||
def gen_afrobeat_pattern():
|
||||
score = Score("4/4", bpm=110)
|
||||
score.drums("afrobeat", repeats=8)
|
||||
render("afrobeat_pattern", score)
|
||||
|
||||
|
||||
# ── Bossa nova ───────────────────────────────────────────────────────────
|
||||
|
||||
def gen_bossa_nova():
|
||||
@@ -413,6 +431,9 @@ GENERATORS = [
|
||||
gen_dynamics,
|
||||
gen_filter_ramp,
|
||||
gen_rock_beat,
|
||||
gen_bossa_nova_pattern,
|
||||
gen_salsa_pattern,
|
||||
gen_afrobeat_pattern,
|
||||
gen_bossa_nova,
|
||||
gen_djembe,
|
||||
gen_tabla,
|
||||
|
||||
+21
-1
@@ -249,9 +249,29 @@ Playing Patterns
|
||||
play_pattern(Pattern.preset("salsa"), repeats=4, bpm=180)
|
||||
play_pattern(Pattern.preset("afrobeat"), repeats=8, bpm=110)
|
||||
|
||||
Rock:
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<audio controls style="width:100%;margin:0.5em 0 1.5em"><source src="../_static/audio/rock_beat.wav" type="audio/wav"></audio>
|
||||
<audio controls style="width:100%;margin:0.5em 0 1em"><source src="../_static/audio/rock_beat.wav" type="audio/wav"></audio>
|
||||
|
||||
Bossa nova:
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<audio controls style="width:100%;margin:0.5em 0 1em"><source src="../_static/audio/bossa_nova_pattern.wav" type="audio/wav"></audio>
|
||||
|
||||
Salsa:
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<audio controls style="width:100%;margin:0.5em 0 1em"><source src="../_static/audio/salsa_pattern.wav" type="audio/wav"></audio>
|
||||
|
||||
Afrobeat:
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<audio controls style="width:100%;margin:0.5em 0 1.5em"><source src="../_static/audio/afrobeat_pattern.wav" type="audio/wav"></audio>
|
||||
|
||||
Fills
|
||||
-----
|
||||
|
||||
Reference in New Issue
Block a user