Deep DSP Drum Synthesis Implementation - #139
Conversation
- Added 15-bit LFSR noise generator in DrumUtils for authentic TR-909 Snappy. - Refined TR-808 Kick with two-stage amplitude envelope (diode damping emulation). - Updated TR-909 Snare to use LFSR noise and randomized start offsets. - Implemented early exit for zero-velocity triggers across all drum instruments. - Added randomized noise buffer offsets for all noise-based instruments to avoid 'machine-gun' effect. - Ensured strict positivity for exponential ramps to prevent Web Audio API errors. - Verified build and DSP compliance. Co-authored-by: Pitrat-wav <255843145+Pitrat-wav@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 16a9496aef
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| noiseGain.gain.setValueAtTime(velocity * 0.7, time); | ||
| // Use random offset within noise buffer for unique hits | ||
| const randomStart = Math.random() * (this.noiseBuffer.duration - snappyDecay - 0.1); |
There was a problem hiding this comment.
Clamp random noise offsets before starting buffers
With Snappy near 1, snappyDecay can reach the full 0.5s buffer length (and variance can push it higher), so this.noiseBuffer.duration - snappyDecay - 0.1 becomes negative and the value is passed as the BufferSource start offset below. Negative AudioBufferSource offsets are rejected at runtime, so high-snappy 909 snare hits can throw/drop instead of playing; clamp the random offset to at least 0 or make the generated buffer longer. The same pattern was added in the 808 clap/snare paths.
Useful? React with 👍 / 👎.
This PR implements high-fidelity virtual analog drum synthesis for the Telegram Mini App drum machine, strictly following the provided 'Deep DSP Analysis' research. Key improvements include authentic 15-bit LFSR noise for 909 instruments, non-linear amplitude envelopes for the 808 Kick, and various performance and stability optimizations for the Web Audio API.
PR created automatically by Jules for task 7614412750372832522 started by @Pitrat-wav