From 90f2f4209cd76ae9861ea3722a87c2189b45f36b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Forment?= Date: Mon, 6 Oct 2025 14:31:05 +0200 Subject: [PATCH] Weird hybrid --- src/App.tsx | 31 ++- src/components/controls/EngineControls.tsx | 3 +- src/components/modals/HelpModal.tsx | 4 + src/components/ui/Knob.tsx | 9 +- src/components/ui/Slider.tsx | 10 +- src/config/parameters.ts | 16 +- src/domain/audio/effects/DelayEffect.ts | 221 +++++++++++++-------- src/hooks/useKeyboardShortcuts.ts | 7 + src/hooks/useParameterSync.ts | 203 ++++++++++++++++++- src/hooks/useTileGrid.ts | 4 +- 10 files changed, 405 insertions(+), 103 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 53a48d63..ac0c882e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,6 +1,6 @@ import { useState, useRef } from 'react' import { useStore } from '@nanostores/react' -import { Square, Archive, Dices, Sparkles } from 'lucide-react' +import { Square, Archive, Dices, Sparkles, Blend } from 'lucide-react' import { DownloadService } from './services/DownloadService' import { generateRandomFormula } from './utils/bytebeatFormulas' import { BytebeatTile } from './components/tile/BytebeatTile' @@ -55,7 +55,7 @@ function App() { } }) - const { saveCurrentParams, loadParams, handleEngineChange, handleEffectChange, randomizeParams, randomizeAllParams } = + const { saveCurrentParams, loadParams, handleEngineChange, handleEffectChange, randomizeParams, randomizeAllParams, interpolateParams } = useParameterSync({ tiles, setTiles, @@ -171,9 +171,18 @@ function App() { } } + const handleRegenerate = (row: number, col: number) => { + const newTile = regenerateTile(row, col) + const tileId = getTileId(row, col) + + if (playing === tileId) { + play(newTile.formula, tileId, newTile) + } + } + const handleKeyboardR = () => { if (focusedTile !== 'custom') { - regenerateTile(focusedTile.row, focusedTile.col) + handleRegenerate(focusedTile.row, focusedTile.col) } } @@ -200,6 +209,7 @@ function App() { onShiftR: handleRandom, onC: handleKeyboardC, onShiftC: randomizeAllParams, + onI: interpolateParams, onEscape: exitMappingMode }) @@ -296,6 +306,12 @@ function App() { > + +