diff --git a/docs/_static/audio/synth_acoustic_guitar.wav b/docs/_static/audio/synth_acoustic_guitar.wav index 8ebea9a..9746642 100644 Binary files a/docs/_static/audio/synth_acoustic_guitar.wav and b/docs/_static/audio/synth_acoustic_guitar.wav differ diff --git a/docs/_static/audio/synth_banjo.wav b/docs/_static/audio/synth_banjo.wav index c7a5d38..903be91 100644 Binary files a/docs/_static/audio/synth_banjo.wav and b/docs/_static/audio/synth_banjo.wav differ diff --git a/docs/_static/audio/synth_cello.wav b/docs/_static/audio/synth_cello.wav index 38b0c9f..a5d2171 100644 Binary files a/docs/_static/audio/synth_cello.wav and b/docs/_static/audio/synth_cello.wav differ diff --git a/docs/_static/audio/synth_electric_guitar.wav b/docs/_static/audio/synth_electric_guitar.wav index 4b34a99..6ff7192 100644 Binary files a/docs/_static/audio/synth_electric_guitar.wav and b/docs/_static/audio/synth_electric_guitar.wav differ diff --git a/docs/_static/audio/synth_harp.wav b/docs/_static/audio/synth_harp.wav index 67b7a74..455d530 100644 Binary files a/docs/_static/audio/synth_harp.wav and b/docs/_static/audio/synth_harp.wav differ diff --git a/docs/_static/audio/synth_harpsichord.wav b/docs/_static/audio/synth_harpsichord.wav index 5d30a7e..225ca3c 100644 Binary files a/docs/_static/audio/synth_harpsichord.wav and b/docs/_static/audio/synth_harpsichord.wav differ diff --git a/docs/_static/audio/synth_mandolin.wav b/docs/_static/audio/synth_mandolin.wav index 13d7473..98781de 100644 Binary files a/docs/_static/audio/synth_mandolin.wav and b/docs/_static/audio/synth_mandolin.wav differ diff --git a/docs/_static/audio/synth_piano.wav b/docs/_static/audio/synth_piano.wav index 62b01f8..3b71db8 100644 Binary files a/docs/_static/audio/synth_piano.wav and b/docs/_static/audio/synth_piano.wav differ diff --git a/docs/_static/audio/synth_sitar.wav b/docs/_static/audio/synth_sitar.wav index 8d5014d..b6684fd 100644 Binary files a/docs/_static/audio/synth_sitar.wav and b/docs/_static/audio/synth_sitar.wav differ diff --git a/docs/_static/audio/synth_strings.wav b/docs/_static/audio/synth_strings.wav index 5b4cf6a..a29e757 100644 Binary files a/docs/_static/audio/synth_strings.wav and b/docs/_static/audio/synth_strings.wav differ diff --git a/docs/_static/audio/synth_ukulele.wav b/docs/_static/audio/synth_ukulele.wav index 89647cf..b08bb3d 100644 Binary files a/docs/_static/audio/synth_ukulele.wav and b/docs/_static/audio/synth_ukulele.wav differ diff --git a/docs/generate_audio.py b/docs/generate_audio.py index d06a7b9..7c2aada 100644 --- a/docs/generate_audio.py +++ b/docs/generate_audio.py @@ -416,10 +416,24 @@ def gen_synth_square(): _synth_demo("square", "square") def gen_synth_piano(): - _synth_demo("piano", "piano_synth", envelope="none") + score = Score("4/4", bpm=85) + p = score.part("demo", instrument="piano", volume=0.5, reverb=0.3) + # Hold chords with melody on top + p.hold("C3", Duration.WHOLE * 2, velocity=60) + p.hold("E3", Duration.WHOLE * 2, velocity=55) + p.hold("G3", Duration.WHOLE * 2, velocity=55) + for n in ["E4", "G4", "C5", "G4", "E4", "D4", "C4", "E4"]: + p.add(n, Duration.QUARTER, velocity=80) + render("synth_piano", score) def gen_synth_acoustic_guitar(): - _synth_demo("acoustic_guitar", "acoustic_guitar_synth", envelope="none") + from pytheory import Fretboard + score = Score("4/4", bpm=100) + p = score.part("demo", instrument="acoustic_guitar", volume=0.5, + reverb=0.25, fretboard=Fretboard.guitar()) + for ch in ["G", "D", "Em", "C"]: + p.strum(ch, Duration.WHOLE, velocity=75) + render("synth_acoustic_guitar", score) def gen_synth_fm(): _synth_demo("fm", "fm", envelope="piano") @@ -448,13 +462,33 @@ def gen_synth_oboe(): _synth_demo("oboe", "oboe_synth", envelope="none") def gen_synth_cello(): - _synth_demo("cello", "cello_synth", envelope="bowed") + score = Score("4/4", bpm=70) + p = score.part("demo", instrument="cello", volume=0.5, reverb=0.3, ensemble=3) + for n in ["C3", "E3", "G3", "C4"]: + p.add(n, Duration.WHOLE, velocity=80) + render("synth_cello", score) def gen_synth_harpsichord(): - _synth_demo("harpsichord", "harpsichord_synth", envelope="none") + score = Score("4/4", bpm=100) + p = score.part("demo", synth="harpsichord_synth", envelope="none", + volume=0.5, reverb=0.25) + # Baroque ornamental runs + p.hold("C3", Duration.WHOLE, velocity=70) + for n in ["C4", "D4", "E4", "F4", "G4", "A4", "B4", "C5"]: + p.add(n, Duration.EIGHTH, velocity=80) + p.hold("G3", Duration.WHOLE, velocity=70) + for n in ["C5", "B4", "A4", "G4", "F4", "E4", "D4", "C4"]: + p.add(n, Duration.EIGHTH, velocity=78) + render("synth_harpsichord", score) def gen_synth_electric_guitar(): - _synth_demo("electric_guitar", "electric_guitar_synth", envelope="none") + from pytheory import Fretboard + score = Score("4/4", bpm=110) + p = score.part("demo", instrument="electric_guitar", volume=0.5, + reverb=0.15, fretboard=Fretboard.guitar()) + for ch in ["Am", "F", "C", "G"]: + p.strum(ch, Duration.WHOLE, velocity=80) + render("synth_electric_guitar", score) def gen_synth_kalimba(): score = Score("4/4", bpm=100) @@ -470,16 +504,26 @@ def gen_synth_marimba(): _synth_demo("marimba", "marimba_synth", envelope="mallet") def gen_synth_sitar(): - score = Score("4/4", bpm=100) - p = score.part("demo", synth="sitar_synth", envelope="none", volume=0.5, - reverb=0.3) - for n in ["C4", "E4", "G4", "C5", "G4", "E4", "C4", "E4"]: - p.add(n, Duration.QUARTER, velocity=85) + score = Score("4/4", bpm=80) + p = score.part("demo", instrument="sitar", volume=0.4, reverb=0.35) + # Drone under melody + p.hold("C3", Duration.WHOLE * 4, velocity=55) + for n, d in [("C4", 1.0), ("D4", 0.5), ("E4", 0.5), ("G4", 1.0), + ("A4", 0.5), ("G4", 0.5), ("E4", 1.0), ("D4", 0.5), + ("C4", 0.5), ("D4", 1.0), ("C4", 2.0)]: + p.add(n, d, velocity=75) render("synth_sitar", score) def gen_synth_harp(): - _synth_demo("harp", "harp_synth", envelope="none") + score = Score("4/4", bpm=80) + p = score.part("demo", synth="harp_synth", envelope="none", + volume=0.5, reverb=0.3) + # Arpeggiated chords with hold — harp style + p.hold("C3", Duration.WHOLE * 2, velocity=70) + for n in ["E4", "G4", "C5", "E5", "G5", "C5", "G4", "E4"]: + p.add(n, Duration.QUARTER, velocity=75) + render("synth_harp", score) def gen_synth_upright_bass(): score = Score("4/4", bpm=100) @@ -493,7 +537,12 @@ def gen_synth_timpani(): _synth_demo("timpani", "timpani_synth", envelope="none") def gen_synth_strings(): - _synth_demo("strings", "strings_synth", envelope="bowed") + score = Score("4/4", bpm=70) + p = score.part("demo", synth="strings_synth", envelope="bowed", + volume=0.5, reverb=0.35, ensemble=8) + for n in ["C4", "E4", "G4", "C5"]: + p.add(n, Duration.WHOLE, velocity=75) + render("synth_strings", score) def gen_synth_saxophone(): score = Score("4/4", bpm=100) @@ -544,24 +593,30 @@ def gen_synth_bagpipe(): render("synth_bagpipe", score) def gen_synth_banjo(): - score = Score("4/4", bpm=100) - p = score.part("demo", instrument="banjo", volume=0.5, reverb=0.2) - for n in ["C4", "E4", "G4", "C5", "G4", "E4", "C4", "E4"]: - p.add(n, Duration.QUARTER, velocity=85) + from pytheory import Fretboard + score = Score("4/4", bpm=120) + p = score.part("demo", instrument="banjo", volume=0.5, reverb=0.15, + fretboard=Fretboard.guitar()) + for ch in ["G", "C", "D", "G"]: + p.strum(ch, Duration.WHOLE, velocity=80) render("synth_banjo", score) def gen_synth_mandolin(): - score = Score("4/4", bpm=100) + score = Score("4/4", bpm=120) p = score.part("demo", instrument="mandolin", volume=0.5, reverb=0.2) - for n in ["C4", "E4", "G4", "C5", "G4", "E4", "C4", "E4"]: - p.add(n, Duration.QUARTER, velocity=85) + # Fast tremolo picking + for n in ["G4", "G4", "A4", "A4", "B4", "B4", "C5", "C5", + "D5", "D5", "C5", "C5", "B4", "B4", "A4", "G4"]: + p.add(n, Duration.EIGHTH, velocity=82) render("synth_mandolin", score) def gen_synth_ukulele(): - score = Score("4/4", bpm=100) - p = score.part("demo", instrument="ukulele", volume=0.5, reverb=0.2) - for n in ["C4", "E4", "G4", "C5", "G4", "E4", "C4", "E4"]: - p.add(n, Duration.QUARTER, velocity=85) + from pytheory import Fretboard + score = Score("4/4", bpm=110) + p = score.part("demo", instrument="ukulele", volume=0.5, reverb=0.25, + fretboard=Fretboard.ukulele()) + for ch in ["C", "Am", "F", "G"]: + p.strum(ch, Duration.WHOLE, velocity=72) render("synth_ukulele", score) def gen_synth_granular():