Skip to content

Procedural Drum Synthesis & Techno Patterns Implementation#122

Open
Pitrat-wav wants to merge 1 commit into
mainfrom
feature/procedural-drums-research-impl-15076511406910216954
Open

Procedural Drum Synthesis & Techno Patterns Implementation#122
Pitrat-wav wants to merge 1 commit into
mainfrom
feature/procedural-drums-research-impl-15076511406910216954

Conversation

@Pitrat-wav

Copy link
Copy Markdown
Owner

This PR implements a comprehensive overhaul of the drum synthesis engine based on the research paper "Программный синтез аналоговых ударных инструментов: Глубокий DSP-анализ и реализация на базе Web Audio API".

Key changes:

  1. Authentic Synthesis Models: All 808 and 909 models now use the exact frequencies, routing graphs, and envelope timings described in the research.
    • 808 Hi-Hats: 6-oscillator Schmitt trigger matrix with parallel bandpass filtering.
    • 909 Snare: 15-bit LFSR noise for the snappy component.
    • 909 Kick: Triangle core with soft-clipping saturation and noise click layer.
  2. DSP Utilities: Added generateLFSRNoise and refined applyPitchDrift for musical accuracy.
  3. State Management: Added bulk synchronization between the Zustand store and the internal DrumMachine engine.
  4. UI Enhancement: Added a "Dice" button to the Drums view to instantly generate optimized techno Euclidean patterns.
  5. Stability: Added zero-velocity early exits and ensured all exponentialRampToValueAtTime calls target positive values (0.001) to prevent audio engine glitches.

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

…n research

- Refined all TR-808 and TR-909 synthesis models (Kick, Snare, Hi-Hats, Clap, Cowbell) to strictly follow the DSP research specifications.
- Implemented authentic 15-bit LFSR noise for 909 Snappy component.
- Updated pitch drift to use cent-based logarithmic formula (+/- 1-2 cents).
- Added master saturation with soft-clipping hyperbolic tangent curve.
- Implemented 'Techno Randomization' feature in instrument store and UI.
- Ensured proper node disposal and Web Audio API safety (positive ramp guards).
- Synchronized initial audio engine state with UI parameters.

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: 6ec4aa98d7

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

Comment thread src/logic/DrumMachine.ts
})

// Sync volumes
if (volumes.kick) this.outputKick.gain.value = volumes.kick

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 Preserve zero volumes during sync

A value of 0 is a valid drum volume (the volume knobs allow muting), but this truthiness guard skips it. If the bulk sync runs with a muted channel—for example after restoring or preloading the audio store before constructing a new DrumMachine—the Gain node keeps its constructor default of 1, so the channel plays at full volume instead of staying muted; check for undefined/property presence rather than truthiness.

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