docs: add initial project plan and README
Added comprehensive implementation plan (PLAN.md) with 15 phases covering: - Project setup with Next.js 16 and Tailwind CSS 4 - Web Audio API integration - Waveform visualization - Multi-track editing - Audio effects and automation - Recording capabilities - Export/import functionality 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
761
PLAN.md
Normal file
761
PLAN.md
Normal file
@@ -0,0 +1,761 @@
|
||||
# Audio Editor Implementation Plan
|
||||
|
||||
## Overview
|
||||
|
||||
A sophisticated browser-only audio editor built with Next.js 16, React 19, and Tailwind CSS 4. This project aims to provide all AudioMass features plus advanced capabilities like multi-track editing, advanced effects, automation, and more.
|
||||
|
||||
## Project Goals
|
||||
|
||||
- **100% Client-Side**: All processing happens in the browser using Web Audio API
|
||||
- **Modern Stack**: Next.js 16 with React 19, TypeScript 5, Tailwind CSS 4
|
||||
- **Professional Features**: Multi-track editing, advanced effects, automation lanes
|
||||
- **Privacy-First**: No server uploads, all data stays local
|
||||
- **Export Ready**: Static site generation for easy deployment
|
||||
|
||||
## Technology Stack
|
||||
|
||||
### Core Framework
|
||||
- **Next.js 16** - React framework with Turbopack
|
||||
- **React 19** - Latest React with concurrent features
|
||||
- **TypeScript 5** - Type safety and better DX
|
||||
- **Tailwind CSS 4** - Utility-first CSS with OKLCH colors
|
||||
|
||||
### Audio Technologies
|
||||
- **Web Audio API** - Native browser audio processing
|
||||
- **MediaRecorder API** - Audio recording from microphone
|
||||
- **Canvas API** - Waveform visualization
|
||||
- **WebGL** (Optional) - High-performance rendering
|
||||
- **AudioWorklets** - Custom low-latency audio processing
|
||||
|
||||
### Libraries & Dependencies
|
||||
- **lamejs** - MP3 encoding (Web Audio doesn't support MP3 export)
|
||||
- **fflate** - FLAC encoding for lossless export
|
||||
- **idb** - IndexedDB wrapper for project storage
|
||||
- **lucide-react** - Modern icon library
|
||||
- **clsx** + **tailwind-merge** - Conditional class names
|
||||
- **zustand** or **jotai** (Optional) - Lightweight state management
|
||||
|
||||
### Storage & Persistence
|
||||
- **IndexedDB** - Project files and audio buffers
|
||||
- **LocalStorage** - User settings and preferences
|
||||
- **File System Access API** (Optional) - Direct file system access
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
audio-ui/
|
||||
├── app/
|
||||
│ ├── layout.tsx # Root layout with theme support
|
||||
│ ├── page.tsx # Main editor page
|
||||
│ └── globals.css # Tailwind + custom styles
|
||||
├── components/
|
||||
│ ├── ui/ # Reusable UI components
|
||||
│ │ ├── Button.tsx
|
||||
│ │ ├── Card.tsx
|
||||
│ │ ├── Slider.tsx
|
||||
│ │ ├── Select.tsx
|
||||
│ │ ├── Input.tsx
|
||||
│ │ ├── Progress.tsx
|
||||
│ │ ├── Toast.tsx
|
||||
│ │ ├── Modal.tsx
|
||||
│ │ ├── Tabs.tsx
|
||||
│ │ └── Tooltip.tsx
|
||||
│ ├── editor/ # Audio editor components
|
||||
│ │ ├── AudioEditor.tsx # Main editor container
|
||||
│ │ ├── Timeline.tsx # Timeline ruler
|
||||
│ │ ├── Waveform.tsx # Waveform display
|
||||
│ │ ├── WaveformCanvas.tsx # Canvas renderer
|
||||
│ │ ├── PlaybackControls.tsx
|
||||
│ │ ├── TransportBar.tsx
|
||||
│ │ ├── RegionManager.tsx
|
||||
│ │ ├── MarkerList.tsx
|
||||
│ │ └── SelectionInfo.tsx
|
||||
│ ├── tracks/ # Multi-track components
|
||||
│ │ ├── TrackList.tsx
|
||||
│ │ ├── Track.tsx
|
||||
│ │ ├── TrackHeader.tsx
|
||||
│ │ ├── TrackControls.tsx
|
||||
│ │ ├── Mixer.tsx
|
||||
│ │ └── MixerChannel.tsx
|
||||
│ ├── effects/ # Audio effects UI
|
||||
│ │ ├── EffectRack.tsx
|
||||
│ │ ├── EffectSlot.tsx
|
||||
│ │ ├── EQEffect.tsx
|
||||
│ │ ├── CompressorEffect.tsx
|
||||
│ │ ├── ReverbEffect.tsx
|
||||
│ │ ├── DelayEffect.tsx
|
||||
│ │ └── EffectPresets.tsx
|
||||
│ ├── automation/ # Automation components
|
||||
│ │ ├── AutomationLane.tsx
|
||||
│ │ ├── AutomationPoint.tsx
|
||||
│ │ └── AutomationEditor.tsx
|
||||
│ ├── analysis/ # Analysis tools
|
||||
│ │ ├── FrequencyAnalyzer.tsx
|
||||
│ │ ├── Spectrogram.tsx
|
||||
│ │ ├── PhaseMeter.tsx
|
||||
│ │ └── LoudnessMeter.tsx
|
||||
│ ├── recording/ # Recording components
|
||||
│ │ ├── RecordingPanel.tsx
|
||||
│ │ ├── InputSelector.tsx
|
||||
│ │ └── RecordingMonitor.tsx
|
||||
│ ├── export/ # Export components
|
||||
│ │ ├── ExportModal.tsx
|
||||
│ │ ├── FormatSelector.tsx
|
||||
│ │ └── RenderSettings.tsx
|
||||
│ ├── project/ # Project management
|
||||
│ │ ├── ProjectManager.tsx
|
||||
│ │ ├── ProjectList.tsx
|
||||
│ │ └── ProjectSettings.tsx
|
||||
│ └── layout/ # Layout components
|
||||
│ ├── ThemeToggle.tsx
|
||||
│ ├── Toolbar.tsx
|
||||
│ ├── Sidebar.tsx
|
||||
│ ├── StatusBar.tsx
|
||||
│ └── KeyboardShortcuts.tsx
|
||||
├── lib/
|
||||
│ ├── audio/ # Web Audio API logic
|
||||
│ │ ├── context.ts # AudioContext management
|
||||
│ │ ├── engine.ts # Core audio engine
|
||||
│ │ ├── player.ts # Playback controller
|
||||
│ │ ├── recorder.ts # Audio recording
|
||||
│ │ ├── decoder.ts # Audio file decoding
|
||||
│ │ ├── encoder.ts # Audio export encoding
|
||||
│ │ ├── buffer-utils.ts # AudioBuffer utilities
|
||||
│ │ ├── effects/ # Effect implementations
|
||||
│ │ │ ├── equalizer.ts
|
||||
│ │ │ ├── compressor.ts
|
||||
│ │ │ ├── reverb.ts
|
||||
│ │ │ ├── delay.ts
|
||||
│ │ │ ├── chorus.ts
|
||||
│ │ │ ├── phaser.ts
|
||||
│ │ │ └── pitch-shift.ts
|
||||
│ │ ├── analysis/ # Analysis tools
|
||||
│ │ │ ├── fft.ts
|
||||
│ │ │ ├── spectrogram.ts
|
||||
│ │ │ └── loudness.ts
|
||||
│ │ └── worklets/ # AudioWorklet processors
|
||||
│ │ └── custom-processor.ts
|
||||
│ ├── storage/ # Data persistence
|
||||
│ │ ├── db.ts # IndexedDB setup
|
||||
│ │ ├── projects.ts # Project storage
|
||||
│ │ ├── audio-cache.ts # Audio buffer cache
|
||||
│ │ └── settings.ts # User settings
|
||||
│ ├── history/ # Undo/redo system
|
||||
│ │ ├── command.ts # Command interface
|
||||
│ │ ├── history-manager.ts # History stack
|
||||
│ │ └── commands/ # Edit commands
|
||||
│ │ ├── cut.ts
|
||||
│ │ ├── paste.ts
|
||||
│ │ ├── delete.ts
|
||||
│ │ └── effect.ts
|
||||
│ ├── waveform/ # Waveform processing
|
||||
│ │ ├── peaks.ts # Waveform peak generation
|
||||
│ │ ├── renderer.ts # Canvas rendering
|
||||
│ │ └── zoom.ts # Zoom calculations
|
||||
│ ├── utils/ # Utility functions
|
||||
│ │ ├── time.ts # Time format conversion
|
||||
│ │ ├── math.ts # Math utilities
|
||||
│ │ ├── color.ts # Color utilities
|
||||
│ │ └── file.ts # File handling
|
||||
│ └── hooks/ # Custom React hooks
|
||||
│ ├── useAudioContext.ts
|
||||
│ ├── useAudioPlayer.ts
|
||||
│ ├── useWaveform.ts
|
||||
│ ├── useRecording.ts
|
||||
│ ├── useKeyboardShortcuts.ts
|
||||
│ ├── useHistory.ts
|
||||
│ └── useProject.ts
|
||||
├── types/
|
||||
│ ├── audio.ts # Audio type definitions
|
||||
│ ├── editor.ts # Editor state types
|
||||
│ ├── effects.ts # Effect types
|
||||
│ └── project.ts # Project types
|
||||
├── public/
|
||||
│ └── impulse-responses/ # Reverb IR files
|
||||
├── package.json
|
||||
├── next.config.ts
|
||||
├── tsconfig.json
|
||||
└── PLAN.md # This file
|
||||
```
|
||||
|
||||
## Implementation Phases
|
||||
|
||||
### Phase 1: Project Setup & Core Infrastructure
|
||||
|
||||
#### 1.1 Initialize Project
|
||||
- [x] Create Next.js 16 project with TypeScript
|
||||
- [x] Install and configure Tailwind CSS 4
|
||||
- [x] Set up project structure
|
||||
- [x] Configure static export mode
|
||||
- [x] Set up Turbopack
|
||||
|
||||
#### 1.2 Core UI Components
|
||||
- [ ] Button component with variants
|
||||
- [ ] Card component
|
||||
- [ ] Slider component (critical for audio controls)
|
||||
- [ ] Select dropdown
|
||||
- [ ] Input fields
|
||||
- [ ] Progress bars
|
||||
- [ ] Toast notifications
|
||||
- [ ] Modal dialogs
|
||||
- [ ] Tabs component
|
||||
- [ ] Tooltip component
|
||||
|
||||
#### 1.3 Theme System
|
||||
- [ ] CSS variables setup (OKLCH colors)
|
||||
- [ ] Dark/Light mode toggle
|
||||
- [ ] Theme persistence (LocalStorage)
|
||||
- [ ] Color palette for waveforms
|
||||
- [ ] Custom animations
|
||||
|
||||
#### 1.4 Basic Layout
|
||||
- [ ] Header with app title
|
||||
- [ ] Toolbar with primary actions
|
||||
- [ ] Main editor area
|
||||
- [ ] Sidebar for tools/effects
|
||||
- [ ] Status bar with info
|
||||
- [ ] Footer
|
||||
|
||||
### Phase 2: Audio Engine Foundation
|
||||
|
||||
#### 2.1 Web Audio API Setup
|
||||
- [ ] AudioContext initialization
|
||||
- [ ] Audio context state management
|
||||
- [ ] Sample rate detection
|
||||
- [ ] Buffer size configuration
|
||||
- [ ] Audio device enumeration
|
||||
|
||||
#### 2.2 Audio File Handling
|
||||
- [ ] File upload component
|
||||
- [ ] Drag-and-drop support
|
||||
- [ ] Audio file decoding (MP3, WAV, OGG, FLAC, etc.)
|
||||
- [ ] Format detection
|
||||
- [ ] Error handling for unsupported formats
|
||||
|
||||
#### 2.3 Audio Buffer Management
|
||||
- [ ] AudioBuffer creation and storage
|
||||
- [ ] Multi-channel support (mono, stereo, surround)
|
||||
- [ ] Buffer slicing and concatenation
|
||||
- [ ] Memory management for large files
|
||||
|
||||
#### 2.4 Basic Playback
|
||||
- [ ] Play/Pause/Stop controls
|
||||
- [ ] Playback position tracking
|
||||
- [ ] Loop functionality
|
||||
- [ ] Playback speed control
|
||||
- [ ] Real-time position display
|
||||
|
||||
### Phase 3: Waveform Visualization
|
||||
|
||||
#### 3.1 Waveform Rendering
|
||||
- [ ] Canvas-based waveform renderer
|
||||
- [ ] Peak calculation from AudioBuffer
|
||||
- [ ] Multi-resolution peaks (for zooming)
|
||||
- [ ] Stereo waveform display
|
||||
- [ ] Color customization
|
||||
|
||||
#### 3.2 Waveform Interaction
|
||||
- [ ] Click to set playhead position
|
||||
- [ ] Drag to scrub audio
|
||||
- [ ] Horizontal scrolling
|
||||
- [ ] Zoom in/out (horizontal)
|
||||
- [ ] Vertical zoom (amplitude)
|
||||
|
||||
#### 3.3 Timeline & Ruler
|
||||
- [ ] Time ruler with markers
|
||||
- [ ] Time format switching (samples/seconds/minutes)
|
||||
- [ ] Grid lines with snap-to-grid
|
||||
- [ ] Measure/beat markers (optional)
|
||||
|
||||
#### 3.4 Performance Optimization
|
||||
- [ ] OffscreenCanvas for background rendering
|
||||
- [ ] Debounced rendering during zoom/scroll
|
||||
- [ ] Viewport culling (render only visible region)
|
||||
- [ ] Web Worker for peak calculation
|
||||
|
||||
### Phase 4: Selection & Editing
|
||||
|
||||
#### 4.1 Region Selection
|
||||
- [ ] Click-and-drag selection
|
||||
- [ ] Keyboard-based selection (Shift+Arrow)
|
||||
- [ ] Select all (Ctrl+A)
|
||||
- [ ] Clear selection (Escape)
|
||||
- [ ] Selection visual feedback
|
||||
|
||||
#### 4.2 Region Markers
|
||||
- [ ] Add/Remove region markers
|
||||
- [ ] Named regions
|
||||
- [ ] Color-coded regions
|
||||
- [ ] Region list panel
|
||||
- [ ] Loop region
|
||||
|
||||
#### 4.3 Basic Edit Operations
|
||||
- [ ] Cut (Ctrl+X)
|
||||
- [ ] Copy (Ctrl+C)
|
||||
- [ ] Paste (Ctrl+V)
|
||||
- [ ] Delete (Delete key)
|
||||
- [ ] Trim to selection
|
||||
- [ ] Split at cursor
|
||||
- [ ] Duplicate selection
|
||||
|
||||
#### 4.4 Clipboard Management
|
||||
- [ ] Internal clipboard for audio data
|
||||
- [ ] Multiple clipboard slots (optional)
|
||||
- [ ] Clipboard preview
|
||||
|
||||
### Phase 5: Undo/Redo System
|
||||
|
||||
#### 5.1 Command Pattern
|
||||
- [ ] Command interface
|
||||
- [ ] Execute/Undo/Redo methods
|
||||
- [ ] Command factory
|
||||
|
||||
#### 5.2 History Manager
|
||||
- [ ] History stack (50-100 operations)
|
||||
- [ ] Undo (Ctrl+Z)
|
||||
- [ ] Redo (Ctrl+Y or Ctrl+Shift+Z)
|
||||
- [ ] Clear history
|
||||
- [ ] History limit configuration
|
||||
|
||||
#### 5.3 Specific Commands
|
||||
- [ ] EditCommand (cut/paste/delete)
|
||||
- [ ] EffectCommand (apply effects)
|
||||
- [ ] VolumeCommand (gain changes)
|
||||
- [ ] SplitCommand (split regions)
|
||||
|
||||
### Phase 6: Audio Effects
|
||||
|
||||
#### 6.1 Basic Effects
|
||||
- [ ] Gain/Volume adjustment
|
||||
- [ ] Pan (stereo positioning)
|
||||
- [ ] Fade In/Fade Out (linear/exponential/logarithmic)
|
||||
- [ ] Normalize (peak/RMS)
|
||||
- [ ] Reverse
|
||||
- [ ] Silence generator
|
||||
|
||||
#### 6.2 Filters & EQ
|
||||
- [ ] Parametric EQ (3-band, 10-band, 31-band)
|
||||
- [ ] Low-pass filter
|
||||
- [ ] High-pass filter
|
||||
- [ ] Band-pass filter
|
||||
- [ ] Notch filter
|
||||
- [ ] Shelf filters (low/high)
|
||||
- [ ] Visual EQ curve editor
|
||||
|
||||
#### 6.3 Dynamics Processing
|
||||
- [ ] Compressor (threshold, ratio, attack, release, knee)
|
||||
- [ ] Limiter
|
||||
- [ ] Gate/Expander
|
||||
- [ ] Visual gain reduction meter
|
||||
|
||||
#### 6.4 Time-Based Effects
|
||||
- [ ] Delay/Echo (time, feedback, mix)
|
||||
- [ ] Reverb (Convolution Reverb with IR files)
|
||||
- [ ] Chorus (depth, rate, delay)
|
||||
- [ ] Flanger
|
||||
- [ ] Phaser
|
||||
|
||||
#### 6.5 Advanced Effects
|
||||
- [ ] Pitch shifter (semitones, cents)
|
||||
- [ ] Time stretcher (without pitch change)
|
||||
- [ ] Distortion/Overdrive
|
||||
- [ ] Bitcrusher (bit depth, sample rate reduction)
|
||||
|
||||
#### 6.6 Effect Management
|
||||
- [ ] Effect rack/chain
|
||||
- [ ] Effect presets
|
||||
- [ ] Effect bypass toggle
|
||||
- [ ] Wet/Dry mix control
|
||||
- [ ] Effect reordering
|
||||
|
||||
### Phase 7: Multi-Track Support
|
||||
|
||||
#### 7.1 Track Management
|
||||
- [ ] Add/Remove tracks
|
||||
- [ ] Track reordering (drag-and-drop)
|
||||
- [ ] Track naming
|
||||
- [ ] Track colors
|
||||
- [ ] Track groups/folders (optional)
|
||||
|
||||
#### 7.2 Track Controls
|
||||
- [ ] Solo/Mute per track
|
||||
- [ ] Volume fader per track
|
||||
- [ ] Pan knob per track
|
||||
- [ ] Record enable per track
|
||||
- [ ] Track height adjustment
|
||||
|
||||
#### 7.3 Mixer
|
||||
- [ ] Master volume
|
||||
- [ ] Master output meter
|
||||
- [ ] Track routing
|
||||
- [ ] Send/Return effects
|
||||
- [ ] Sidechain support (advanced)
|
||||
|
||||
#### 7.4 Track Effects
|
||||
- [ ] Per-track effect chain
|
||||
- [ ] Effect rack UI
|
||||
- [ ] Effect bypass per track
|
||||
|
||||
### Phase 8: Recording
|
||||
|
||||
#### 8.1 Audio Input
|
||||
- [ ] Microphone permission request
|
||||
- [ ] Audio input device selection
|
||||
- [ ] Input level meter
|
||||
- [ ] Input monitoring (with latency compensation)
|
||||
|
||||
#### 8.2 Recording Controls
|
||||
- [ ] Arm recording
|
||||
- [ ] Start/Stop recording
|
||||
- [ ] Punch-in/Punch-out recording
|
||||
- [ ] Overdub mode
|
||||
- [ ] Recording indicator
|
||||
|
||||
#### 8.3 Recording Settings
|
||||
- [ ] Sample rate matching
|
||||
- [ ] Input gain control
|
||||
- [ ] Mono/Stereo recording
|
||||
- [ ] File naming conventions
|
||||
|
||||
### Phase 9: Automation
|
||||
|
||||
#### 9.1 Automation Lanes
|
||||
- [ ] Show/Hide automation lanes per track
|
||||
- [ ] Automation lane for volume
|
||||
- [ ] Automation lane for pan
|
||||
- [ ] Automation lanes for effect parameters
|
||||
|
||||
#### 9.2 Automation Points
|
||||
- [ ] Add/Remove automation points
|
||||
- [ ] Drag automation points
|
||||
- [ ] Automation curves (linear/bezier/step)
|
||||
- [ ] Copy/Paste automation
|
||||
|
||||
#### 9.3 Automation Playback
|
||||
- [ ] Real-time automation during playback
|
||||
- [ ] Automation recording (write mode)
|
||||
- [ ] Automation editing modes (read/write/touch/latch)
|
||||
|
||||
### Phase 10: Analysis Tools
|
||||
|
||||
#### 10.1 Frequency Analyzer
|
||||
- [ ] Real-time FFT analyzer
|
||||
- [ ] Frequency spectrum display
|
||||
- [ ] Peak/Average display modes
|
||||
- [ ] Logarithmic/Linear frequency scale
|
||||
|
||||
#### 10.2 Spectrogram
|
||||
- [ ] Time-frequency spectrogram view
|
||||
- [ ] Color scale customization
|
||||
- [ ] FFT size configuration
|
||||
- [ ] Overlay on waveform (optional)
|
||||
|
||||
#### 10.3 Metering
|
||||
- [ ] Peak meter
|
||||
- [ ] RMS meter
|
||||
- [ ] Phase correlation meter
|
||||
- [ ] Loudness meter (LUFS - optional)
|
||||
- [ ] Clip indicator
|
||||
|
||||
#### 10.4 Audio Statistics
|
||||
- [ ] File duration
|
||||
- [ ] Sample rate, bit depth, channels
|
||||
- [ ] Peak amplitude
|
||||
- [ ] RMS level
|
||||
- [ ] Dynamic range
|
||||
|
||||
### Phase 11: Export & Import
|
||||
|
||||
#### 11.1 Export Formats
|
||||
- [ ] WAV export (PCM, various bit depths)
|
||||
- [ ] MP3 export (using lamejs)
|
||||
- [ ] OGG Vorbis export
|
||||
- [ ] FLAC export (using fflate)
|
||||
- [ ] Format selection UI
|
||||
|
||||
#### 11.2 Export Settings
|
||||
- [ ] Sample rate conversion
|
||||
- [ ] Bit depth selection
|
||||
- [ ] Quality/bitrate settings (for lossy formats)
|
||||
- [ ] Dithering options
|
||||
- [ ] Normalization before export
|
||||
|
||||
#### 11.3 Export Regions
|
||||
- [ ] Export entire project
|
||||
- [ ] Export selected region
|
||||
- [ ] Batch export all regions
|
||||
- [ ] Export individual tracks
|
||||
|
||||
#### 11.4 Import
|
||||
- [ ] Support for WAV, MP3, OGG, FLAC, M4A, AIFF
|
||||
- [ ] Sample rate conversion on import
|
||||
- [ ] Stereo to mono conversion
|
||||
- [ ] File metadata reading
|
||||
|
||||
### Phase 12: Project Management
|
||||
|
||||
#### 12.1 Save/Load Projects
|
||||
- [ ] Save project to IndexedDB
|
||||
- [ ] Load project from IndexedDB
|
||||
- [ ] Project list UI
|
||||
- [ ] Auto-save functionality
|
||||
- [ ] Save-as functionality
|
||||
|
||||
#### 12.2 Project Structure
|
||||
- [ ] JSON project format
|
||||
- [ ] Track information
|
||||
- [ ] Audio buffer references
|
||||
- [ ] Effect settings
|
||||
- [ ] Automation data
|
||||
- [ ] Region markers
|
||||
|
||||
#### 12.3 Project Export/Import
|
||||
- [ ] Export project as JSON (with audio files)
|
||||
- [ ] Import project from JSON
|
||||
- [ ] Project templates
|
||||
|
||||
#### 12.4 Project Settings
|
||||
- [ ] Sample rate
|
||||
- [ ] Bit depth
|
||||
- [ ] Default track count
|
||||
- [ ] Project name/description
|
||||
|
||||
### Phase 13: Keyboard Shortcuts
|
||||
|
||||
#### 13.1 Playback Shortcuts
|
||||
- [ ] Spacebar - Play/Pause
|
||||
- [ ] Home - Go to start
|
||||
- [ ] End - Go to end
|
||||
- [ ] Left/Right Arrow - Move cursor
|
||||
- [ ] Ctrl+Left/Right - Move by larger increment
|
||||
|
||||
#### 13.2 Editing Shortcuts
|
||||
- [ ] Ctrl+Z - Undo
|
||||
- [ ] Ctrl+Y / Ctrl+Shift+Z - Redo
|
||||
- [ ] Ctrl+X - Cut
|
||||
- [ ] Ctrl+C - Copy
|
||||
- [ ] Ctrl+V - Paste
|
||||
- [ ] Delete - Delete selection
|
||||
- [ ] Ctrl+A - Select All
|
||||
- [ ] Escape - Clear selection
|
||||
|
||||
#### 13.3 View Shortcuts
|
||||
- [ ] Ctrl+Plus - Zoom in
|
||||
- [ ] Ctrl+Minus - Zoom out
|
||||
- [ ] Ctrl+0 - Fit to window
|
||||
- [ ] F - Toggle fullscreen (optional)
|
||||
|
||||
#### 13.4 Custom Shortcuts
|
||||
- [ ] Keyboard shortcuts manager
|
||||
- [ ] User-configurable shortcuts
|
||||
- [ ] Shortcut conflict detection
|
||||
|
||||
### Phase 14: Settings & Preferences
|
||||
|
||||
#### 14.1 Audio Settings
|
||||
- [ ] Audio output device selection
|
||||
- [ ] Buffer size/latency configuration
|
||||
- [ ] Sample rate preference
|
||||
- [ ] Auto-normalize on import
|
||||
|
||||
#### 14.2 UI Settings
|
||||
- [ ] Theme selection (dark/light/auto)
|
||||
- [ ] Color scheme customization
|
||||
- [ ] Waveform colors
|
||||
- [ ] Font size
|
||||
|
||||
#### 14.3 Editor Settings
|
||||
- [ ] Auto-save interval
|
||||
- [ ] Undo history limit
|
||||
- [ ] Snap-to-grid toggle
|
||||
- [ ] Grid resolution
|
||||
- [ ] Default zoom level
|
||||
|
||||
#### 14.4 Performance Settings
|
||||
- [ ] Peak calculation quality
|
||||
- [ ] Waveform rendering quality
|
||||
- [ ] Enable/disable spectrogram
|
||||
- [ ] Maximum file size limit
|
||||
|
||||
### Phase 15: Polish & Optimization
|
||||
|
||||
#### 15.1 Performance Optimization
|
||||
- [ ] Web Worker for heavy computations
|
||||
- [ ] AudioWorklet for custom processing
|
||||
- [ ] Lazy loading for effects
|
||||
- [ ] Code splitting for route optimization
|
||||
- [ ] Memory leak prevention
|
||||
|
||||
#### 15.2 Responsive Design
|
||||
- [ ] Mobile-friendly layout
|
||||
- [ ] Touch gesture support
|
||||
- [ ] Adaptive toolbar (hide on mobile)
|
||||
- [ ] Vertical scrolling for track list
|
||||
|
||||
#### 15.3 Error Handling
|
||||
- [ ] Graceful error messages
|
||||
- [ ] File format error handling
|
||||
- [ ] Memory limit warnings
|
||||
- [ ] Browser compatibility checks
|
||||
|
||||
#### 15.4 Documentation
|
||||
- [ ] User guide
|
||||
- [ ] Keyboard shortcuts reference
|
||||
- [ ] Effect descriptions
|
||||
- [ ] Troubleshooting guide
|
||||
|
||||
#### 15.5 Testing
|
||||
- [ ] Unit tests for audio utilities
|
||||
- [ ] Component tests
|
||||
- [ ] Integration tests
|
||||
- [ ] Browser compatibility testing
|
||||
- [ ] Performance benchmarking
|
||||
|
||||
## Feature Comparison: AudioMass vs Our Editor
|
||||
|
||||
### AudioMass Features (Baseline)
|
||||
✅ Waveform editing
|
||||
✅ Basic effects (EQ, filters)
|
||||
✅ Recording from microphone
|
||||
✅ File export (WAV)
|
||||
✅ Region markers
|
||||
✅ Undo/redo
|
||||
✅ Cut/Copy/Paste
|
||||
✅ Normalize, Fade, Reverse
|
||||
|
||||
### Our Additional Features (Beyond AudioMass)
|
||||
🚀 **Multi-track editing** - Work with multiple audio tracks simultaneously
|
||||
🚀 **Mixer with routing** - Professional mixing capabilities
|
||||
🚀 **Advanced effects** - Reverb, delay, chorus, phaser, pitch shift
|
||||
🚀 **Automation lanes** - Automate volume, pan, and effect parameters
|
||||
🚀 **Spectrogram view** - Time-frequency visualization
|
||||
🚀 **LUFS metering** - Professional loudness metering
|
||||
🚀 **Better keyboard shortcuts** - Extensive shortcuts for fast workflow
|
||||
🚀 **Dark mode** - Modern dark theme with Tailwind CSS 4
|
||||
🚀 **Project save/load** - Save and load complete projects
|
||||
🚀 **Export formats** - MP3, OGG, FLAC in addition to WAV
|
||||
🚀 **Better UX** - Modern React patterns, responsive design
|
||||
🚀 **Effect presets** - Save and load effect settings
|
||||
🚀 **Track colors & organization** - Visual organization
|
||||
🚀 **Auto-save** - Never lose your work
|
||||
🚀 **Recording overdub** - Layer recordings on top of each other
|
||||
|
||||
## Technical Considerations
|
||||
|
||||
### Web Audio API Limitations
|
||||
- **MP3 Encoding**: Web Audio API doesn't support MP3 export. We'll use `lamejs` for encoding.
|
||||
- **Sample Rate**: Limited to hardware sample rate (usually 44.1kHz or 48kHz).
|
||||
- **Latency**: Recording latency depends on buffer size and browser implementation.
|
||||
- **Browser Support**: Some features may require modern browsers (Chrome 90+, Firefox 88+, Safari 14+).
|
||||
|
||||
### Performance Considerations
|
||||
- **Large Files**: Files over 100MB may cause memory issues. We'll implement warnings and chunked processing.
|
||||
- **Waveform Rendering**: Use OffscreenCanvas and Web Workers for smooth rendering.
|
||||
- **Real-time Effects**: AudioWorklets provide lower latency than ScriptProcessorNode (deprecated).
|
||||
- **Mobile Performance**: May need to disable some features (spectrogram) on mobile devices.
|
||||
|
||||
### Storage Considerations
|
||||
- **IndexedDB Limits**: Varies by browser, typically 50MB-unlimited (with user permission).
|
||||
- **Audio Buffer Memory**: Keep track of memory usage, implement buffer pooling.
|
||||
- **Project Size**: Large projects with many tracks may require compression.
|
||||
|
||||
### Browser Compatibility
|
||||
- **Target Browsers**: Chrome 90+, Firefox 88+, Safari 14+, Edge 90+
|
||||
- **Polyfills**: May need polyfills for older browsers (File System Access API)
|
||||
- **Feature Detection**: Use feature detection for optional features
|
||||
|
||||
## Development Workflow
|
||||
|
||||
### Phase Approach
|
||||
1. **Phase 1-3**: Foundation (Setup → Audio Engine → Waveform) - **2-3 weeks**
|
||||
2. **Phase 4-6**: Core Editing (Selection → Undo/Redo → Effects) - **3-4 weeks**
|
||||
3. **Phase 7-9**: Advanced Features (Multi-track → Recording → Automation) - **4-5 weeks**
|
||||
4. **Phase 10-12**: Professional Tools (Analysis → Export → Projects) - **3-4 weeks**
|
||||
5. **Phase 13-15**: Polish (Shortcuts → Settings → Optimization) - **2-3 weeks**
|
||||
|
||||
**Total Estimated Timeline**: 14-19 weeks for full implementation
|
||||
|
||||
### Iteration Strategy
|
||||
- Build MVP with Phases 1-6 first (basic single-track editor)
|
||||
- Test and refine core features
|
||||
- Add multi-track and advanced features incrementally
|
||||
- Continuous testing and optimization
|
||||
|
||||
### Testing Strategy
|
||||
- **Unit Tests**: Audio utilities, time conversion, buffer operations
|
||||
- **Integration Tests**: Playback, recording, effect chains
|
||||
- **Manual Testing**: UI/UX, cross-browser compatibility
|
||||
- **Performance Testing**: Large file handling, memory usage
|
||||
|
||||
## Success Metrics
|
||||
|
||||
### Functional Metrics
|
||||
- ✅ Can load and play audio files
|
||||
- ✅ Can edit audio (cut/copy/paste)
|
||||
- ✅ Can apply effects
|
||||
- ✅ Can record audio
|
||||
- ✅ Can export in multiple formats
|
||||
- ✅ Can save and load projects
|
||||
|
||||
### Performance Metrics
|
||||
- Load time < 3 seconds
|
||||
- Waveform rendering at 60fps
|
||||
- Playback latency < 20ms
|
||||
- Support files up to 500MB
|
||||
|
||||
### UX Metrics
|
||||
- Intuitive interface (minimal learning curve)
|
||||
- Responsive design (works on tablets)
|
||||
- Keyboard-first workflow
|
||||
- Undo/redo for all actions
|
||||
|
||||
## Future Enhancements (Post-Launch)
|
||||
|
||||
### Advanced Features
|
||||
- MIDI support (sequence automation)
|
||||
- VST plugin support (via WASM)
|
||||
- Collaborative editing (WebRTC)
|
||||
- Cloud storage integration
|
||||
- Stem export (separate track files)
|
||||
|
||||
### AI Features
|
||||
- Noise reduction (ML-based)
|
||||
- Auto-mastering
|
||||
- Stem separation (vocals/instruments)
|
||||
- Beat detection and tempo mapping
|
||||
|
||||
### Integration Features
|
||||
- Export to DAW project format
|
||||
- Import from cloud storage
|
||||
- Share projects via URL
|
||||
- Embed player for web
|
||||
|
||||
## Resources & References
|
||||
|
||||
### Web Audio API
|
||||
- [MDN Web Audio API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API)
|
||||
- [Web Audio API Specification](https://www.w3.org/TR/webaudio/)
|
||||
- [AudioWorklet](https://developer.mozilla.org/en-US/docs/Web/API/AudioWorklet)
|
||||
|
||||
### Libraries
|
||||
- [lamejs](https://github.com/zhuker/lamejs) - MP3 encoding
|
||||
- [wavesurfer.js](https://wavesurfer.xyz/) - Waveform inspiration (we'll build custom)
|
||||
- [Tone.js](https://tonejs.github.io/) - Alternative audio framework (reference)
|
||||
|
||||
### Inspiration
|
||||
- [AudioMass](https://github.com/pkalogiros/AudioMass) - Feature baseline
|
||||
- [Audacity](https://www.audacityteam.org/) - Desktop reference
|
||||
- [Soundtrap](https://www.soundtrap.com/) - Web DAW reference
|
||||
|
||||
### Design References
|
||||
- [Ableton Live](https://www.ableton.com/en/live/) - UI/UX inspiration
|
||||
- [FL Studio](https://www.image-line.com/) - Workflow ideas
|
||||
- [Logic Pro](https://www.apple.com/logic-pro/) - Professional features
|
||||
|
||||
## Conclusion
|
||||
|
||||
This project aims to create a professional-grade audio editor that runs entirely in the browser, combining the accessibility of web applications with the power of desktop DAWs. By leveraging modern web technologies (Web Audio API, Next.js 16, Tailwind CSS 4), we can deliver a fast, beautiful, and capable audio editing experience.
|
||||
|
||||
The phased approach ensures we build a solid foundation before adding advanced features, allowing for continuous testing and refinement. The result will be a tool that not only matches AudioMass but significantly exceeds it with multi-track editing, advanced effects, automation, and a modern, polished user interface.
|
||||
|
||||
**Let's build the future of browser-based audio editing!** 🎵🎧
|
||||
53
README.md
Normal file
53
README.md
Normal file
@@ -0,0 +1,53 @@
|
||||
# Audio UI
|
||||
|
||||
A sophisticated browser-only audio editor built with Next.js 16, React 19, and Tailwind CSS 4.
|
||||
|
||||
## Features (Planned)
|
||||
|
||||
- **100% Client-Side**: All audio processing happens in your browser
|
||||
- **Multi-Track Editing**: Professional multi-track audio editing
|
||||
- **Advanced Effects**: EQ, compression, reverb, delay, and more
|
||||
- **Automation**: Automate volume, pan, and effect parameters
|
||||
- **Recording**: Record audio directly from your microphone
|
||||
- **Analysis Tools**: Frequency analyzer, spectrogram, and loudness metering
|
||||
- **Export Formats**: WAV, MP3, OGG, FLAC
|
||||
- **Project Management**: Save and load complete projects
|
||||
- **Privacy-First**: No uploads, all data stays local in your browser
|
||||
|
||||
## Tech Stack
|
||||
|
||||
- **Next.js 16** with React 19
|
||||
- **TypeScript 5**
|
||||
- **Tailwind CSS 4** with OKLCH colors
|
||||
- **Web Audio API** for audio processing
|
||||
- **Canvas API** for waveform visualization
|
||||
- **IndexedDB** for project storage
|
||||
|
||||
## Getting Started
|
||||
|
||||
This project is currently in the planning phase. See [PLAN.md](./PLAN.md) for the complete implementation plan.
|
||||
|
||||
### Development (Coming Soon)
|
||||
|
||||
```bash
|
||||
# Install dependencies
|
||||
pnpm install
|
||||
|
||||
# Run development server
|
||||
pnpm dev
|
||||
|
||||
# Build for production
|
||||
pnpm build
|
||||
```
|
||||
|
||||
## Inspiration
|
||||
|
||||
Inspired by [AudioMass](https://github.com/pkalogiros/AudioMass) and professional DAWs like Ableton Live, Logic Pro, and FL Studio.
|
||||
|
||||
## License
|
||||
|
||||
TBD
|
||||
|
||||
## Contributing
|
||||
|
||||
This is a personal project, but suggestions and ideas are welcome!
|
||||
Reference in New Issue
Block a user