Authentic TR-808/909 Drum Synthesis Engine - #137
Conversation
- Refactored all drum models to follow 'Analog Drum Synthesis in Web Audio API' research. - Implemented authentic 15-bit LFSR noise for TR-909 Snare 'Snappy' component. - Implemented Diode Damping emulation for TR-808 Kick using two-stage amplitude envelopes. - Replaced pre-trigger buffer generation with shared pre-calculated noise buffers in `DrumUtils.ts`. - Implemented `randomStart` for all noise-based drums to eliminate the 'machine-gun' effect. - Improved node termination and choking logic using `activeVoices` tracking and explicit oscillator disposal. - Calibrated pitch sweeps and filter frequencies to match hardware specifications (e.g., 909 Kick 4.7x pitch sweep, 808 Hi-Hat 6-oscillator matrix). - Added velocity-sensitivity early exits and strictly positive ramp values for Web Audio stability. 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: 34f442b030
ℹ️ 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".
| gain.gain.exponentialRampToValueAtTime(0.001, time + 0.02); | ||
| this.activeVoices.forEach(voice => { | ||
| voice.oscillators.forEach(osc => { | ||
| osc.stop(time); |
There was a problem hiding this comment.
Let hihat chokes fade before stopping sources
When a closed hat triggers, DrumMachine calls hihatOpen.stop(time) (src/logic/DrumMachine.ts:112/124) to choke the open hat. Stopping each oscillator exactly at time means the subsequent gain.exponentialRampToValueAtTime(..., time + 0.02) has no audio left to fade, so every choke becomes an instantaneous cut at an arbitrary oscillator phase and can click; stop the sources after the fade or leave them running through the gain ramp.
Useful? React with 👍 / 👎.
This PR implements a high-fidelity virtual analog drum synthesis engine for the Telegram Mini App, replacing basic approximations with deep DSP models based on Roland TR-808 and TR-909 research.
Key changes include:
activeVoicessets andsetTimeoutsafety nets, preventing memory leaks and ensuring clean choking.PR created automatically by Jules for task 7081671166178346237 started by @Pitrat-wav