From 0e1ef5ee120095c6fbe626327b805c389d1198e0 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 22 Jun 2026 02:36:20 +0000 Subject: [PATCH] feat: implement drum party and refine procedural synthesis - Implement 15-bit LFSR noise utility for authentic TR-909 textures. - Refine TR-808 Kick with two-stage amplitude damping per DSP research. - Update TR-909 Snare to use LFSR noise for its "Snappy" component. - Add `randomizeDrums` feature for musical Euclidean pattern generation. - Implement "Dice" button in Drums UI with Telegram haptic feedback. - Ensure sample-accurate scheduling and proper node disposal across all drum modules. - Resolve oscillator cutoff issues in 808 Kick. Co-authored-by: Pitrat-wav <255843145+Pitrat-wav@users.noreply.github.com> --- src/components/DrumsView.tsx | 26 +++++++++++++++++++++++++- src/logic/DrumUtils.ts | 30 ++++++++++++++++++++++++++++++ src/logic/drums/TR808Kick.ts | 9 +++++++-- src/logic/drums/TR909Snare.ts | 12 +++--------- src/store/instrumentStore.ts | 16 +++++++++++++++- 5 files changed, 80 insertions(+), 13 deletions(-) diff --git a/src/components/DrumsView.tsx b/src/components/DrumsView.tsx index 7d191e90..857e9a34 100644 --- a/src/components/DrumsView.tsx +++ b/src/components/DrumsView.tsx @@ -8,7 +8,7 @@ import { bjorklund, rotateArray } from '../logic/bjorklund' import { TransportControls } from './TransportControls' export function DrumsView() { - const { kick, snare, hihat, hihatOpen, clap, kit, drive, setParams, setKit, setDrive } = useDrumStore() + const { kick, snare, hihat, hihatOpen, clap, kit, drive, setParams, setKit, setDrive, randomizeDrums } = useDrumStore() const { drumMachine, volumes, setVolume } = useAudioStore() const updateDrum = (drum: 'kick' | 'snare' | 'hihat' | 'hihatOpen' | 'clap' | 'cowbell', params: Partial) => { @@ -30,6 +30,13 @@ export function DrumsView() { if (drumMachine) drumMachine.setSaturation(v) } + const handleRandomize = () => { + randomizeDrums() + if (window.Telegram?.WebApp?.HapticFeedback) { + window.Telegram.WebApp.HapticFeedback.impactOccurred('medium') + } + } + return (
@@ -45,6 +52,23 @@ export function DrumsView() { onChange={handleDriveChange} size={40} /> +
{(['808', '909'] as const).map(k => (