Skip to content

Authentic Analog Drum Synthesis Implementation - #136

Open
Pitrat-wav wants to merge 1 commit into
mainfrom
feat/analog-drum-synthesis-v2-2360922783051045632
Open

Authentic Analog Drum Synthesis Implementation#136
Pitrat-wav wants to merge 1 commit into
mainfrom
feat/analog-drum-synthesis-v2-2360922783051045632

Conversation

@Pitrat-wav

Copy link
Copy Markdown
Owner

This PR significantly upgrades the drum synthesis engine to align with the provided deep DSP research on TR-808 and TR-909 architectures. Key improvements include authentic 15-bit LFSR noise for 909 Snappy, diode damping emulation for 808 Kick, and the complete metallic matrix implementation for 808 Hi-Hats and Cowbells. All synthesis is procedural (no PCM samples), featuring micro-randomization for analog-like organic texture.


PR created automatically by Jules for task 2360922783051045632 started by @Pitrat-wav

- Added centralized noise generation utilities: `generateWhiteNoise` and `generateLFSRNoise` (15-bit).
- Implemented two-stage amplitude envelope for TR-808 Kick to emulate diode damping.
- Refactored TR-808 and TR-909 Snare models to use authentic oscillator configurations and noise sources.
- Implemented TR-808 Hi-Hat and Cowbell metallic matrix synthesis with 6-oscillator square wave cluster and parallel bandpass filters.
- Added micro-randomization (analog drift) for oscillator phase and frequency across all instruments.
- Introduced randomized noise start offsets to eliminate the "machine-gun" effect.
- Improved node disposal and memory management in drum synthesis classes.
- Added state synchronization between the application store and the audio engine on initialization.

Co-authored-by: Pitrat-wav <255843145+Pitrat-wav@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3abfb600d6

ℹ️ 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".


// Use Tone.Oscillator.onstop for cleanup with a safety timeout
oscillators[0].onstop = onEnd;
setTimeout(onEnd, (decayTime + 0.5) * 1000);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Make the fallback cleanup idempotent

On a normal completed hi-hat hit, oscillators[0].onstop invokes onEnd at the scheduled stop time, and this timeout invokes the same cleanup again about 500 ms later. That means every hi-hat trigger attempts to dispose the same oscillators/filters/gain nodes twice (the same pattern was added in TR808Cowbell.ts), which can surface runtime errors or touch already-freed Tone nodes; guard onEnd with a boolean or clear the fallback timer when onstop fires.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant