Skip to content

Deep DSP Drum Synthesis Implementation - #139

Open
Pitrat-wav wants to merge 1 commit into
mainfrom
feature/deep-dsp-drums-7614412750372832522
Open

Deep DSP Drum Synthesis Implementation#139
Pitrat-wav wants to merge 1 commit into
mainfrom
feature/deep-dsp-drums-7614412750372832522

Conversation

@Pitrat-wav

Copy link
Copy Markdown
Owner

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

- 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>
@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: 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);

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 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 👍 / 👎.

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