Soundbite Scrambler

A playful client-side audio sampler where users record short “soundbites” (via microphone) or upload small audio clips, tag them, and arrange them into a simple grid-based sequencer to create looping mini-beats. The app includes a lightweight waveform preview, per-cell trim/volume controls, and one-click “Shuffle Mix” that randomly rearranges clips while keeping tempo. Projects are saved in localStorage, with export options to download the mix as a single WAV (rendered in-browser) and share a compact JSON preset.

To Do30
Scaffold app stack

Run: npm create vite@latest . -- --template react-ts && npm i && npm i -D tailwindcss postcss autoprefixer && npx tailwindcss init -p && npm i class-variance-authority clsx tailwind-merge lucide-react && npx shadcn@latest init

by system

Add Tailwind globals

Configure src/index.css with Tailwind directives and basic CSS variables for shadcn/ui.

by system

Setup app layout

Create src/App.tsx with a simple shell (header/main/footer) and placeholder panels.

by system

Create UI header

Add src/components/Header.tsx with app title and primary action buttons placeholders.

by system

Define core types

Create src/lib/types.ts defining Soundbite, ClipAsset, SequencerCell, Project, and ExportPreset types.

by system

LocalStorage helpers

Create src/lib/storage.ts with load/save/list project utilities and versioned schema key.

by system

Project state store

Create src/lib/useProjectStore.ts as a React hook managing current project, undo-safe updates, and dirty flag.

by system

Audio context singleton

Create src/lib/audioContext.ts to lazily create/resume a shared AudioContext and handle user-gesture unlock.

by system

Decode audio utility

Create src/lib/decodeAudio.ts to decode ArrayBuffer into AudioBuffer with error handling.

by system

WAV render utility

Create src/lib/renderWav.ts to render a project mix offline and return a WAV Blob for download.

by system

JSON preset export

Create src/lib/exportPreset.ts to serialize/deserialize compact JSON preset without embedding raw audio.

by system

Asset registry

Create src/lib/assetRegistry.ts to store/retrieve audio clip blobs in IndexedDB-like fallback using localStorage chunks.

by system

Record soundbite UI

Add src/components/RecorderPanel.tsx with start/stop recording via MediaRecorder and save as new clip asset.

by system

Upload clip UI

Add src/components/UploadPanel.tsx with file input, size/type checks, and import into clip assets.

by system

Tag editor component

Create src/components/TagEditor.tsx for adding/removing tags on a selected soundbite.

by system

Soundbite list panel

Add src/components/SoundbiteList.tsx showing clips, tags, duration, and selection handling.

by system

Waveform preview

Create src/components/Waveform.tsx that draws a lightweight waveform to canvas from an AudioBuffer.

by system

Trim controls UI

Add src/components/TrimControls.tsx with start/end trim sliders normalized to buffer duration.

by system

Volume control UI

Add src/components/VolumeControl.tsx with per-cell gain slider and mute toggle.

by system

Sequencer grid UI

Create src/components/SequencerGrid.tsx rendering a rows×steps grid with clickable cells and selection state.

by system

Cell assignment logic

Implement src/lib/assignToCell.ts to place selected soundbite into a grid cell and set default trim/volume.

by system

Transport controls

Add src/components/Transport.tsx with play/stop, BPM input, steps per bar, and loop toggle.

by system

Sequencer scheduler

Create src/lib/scheduler.ts to schedule cell playback with lookahead timing using AudioContext currentTime.

by system

Cell playback engine

Create src/lib/playCell.ts to play a trimmed AudioBuffer segment through a GainNode at a scheduled time.

by system

Step indicator overlay

Add src/components/Playhead.tsx to visually highlight the current step while playing.

by system

Shuffle mix action

Create src/lib/shuffleMix.ts to randomly rearrange assigned clips across cells while keeping grid size and tempo.

by system

Project save/load UI

Add src/components/ProjectManager.tsx with new/save/load/delete actions wired to localStorage helpers.

by system

Export WAV UI

Add src/components/ExportWavButton.tsx to render offline WAV and trigger a file download.

by system

Share preset UI

Add src/components/SharePresetDialog.tsx to export/import JSON preset via textarea and file upload.

by system

Error toasts system

Add src/components/Toaster.tsx and a small src/lib/toast.ts wrapper for consistent user-facing errors.

by system

In Progress0
In Review0
Done0