mirror of
https://github.com/kennethreitz/pytheory.git
synced 2026-06-05 14:50:18 +00:00
Remove melodic note choke, fix banjo to 16th notes
The melodic renderer was choking all signal at each new note, killing strum/hold resonance. Removed — notes now naturally overlap and ring out. Banjo lick now uses 16th notes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vendored
BIN
Binary file not shown.
@@ -667,10 +667,10 @@ def gen_synth_banjo():
|
||||
# Strum into a picking lick
|
||||
p.strum("G", Duration.WHOLE, velocity=80)
|
||||
p.strum("C", Duration.WHOLE, velocity=78)
|
||||
# Bluegrass lick
|
||||
# Bluegrass lick — 16th note picking
|
||||
for n in ["G4", "B4", "D5", "G5", "D5", "B4", "A4", "G4",
|
||||
"D4", "G4", "B4", "D5", "B4", "G4", "D4", "G4"]:
|
||||
p.add(n, Duration.EIGHTH, velocity=82)
|
||||
p.add(n, Duration.SIXTEENTH, velocity=82)
|
||||
render("synth_banjo", score)
|
||||
|
||||
def gen_synth_mandolin():
|
||||
|
||||
@@ -4607,12 +4607,6 @@ def _render_notes_to_buf(notes, buf, samples_per_beat, total_samples,
|
||||
vel_cutoff = vel_to_filter * vel_scale + 1000
|
||||
mixed = _apply_lowpass(mixed, vel_cutoff, q=filter_q)
|
||||
end = min(start + len(mixed), total_samples)
|
||||
# Choke: fade out any existing signal at this point
|
||||
# so new notes don't pile up on previous tails
|
||||
choke_len = min(int(SAMPLE_RATE * 0.003), start)
|
||||
if choke_len > 0:
|
||||
fade = numpy.linspace(1.0, 0.0, choke_len).astype(numpy.float32)
|
||||
buf[start - choke_len:start] *= fade
|
||||
buf[start:end] += mixed[:end - start] * volume * vel_scale
|
||||
# Spread detuned oscillators into stereo L/R
|
||||
if detune_up is not None and stereo_buf is not None:
|
||||
|
||||
Reference in New Issue
Block a user