Commit Graph

7 Commits

Author SHA1 Message Date
Xiaohan-Tian d59ad68f72 feat: added fine tune region position feature 2026-05-01 23:07:44 -07:00
Xiaohan-Tian cbd2fc60a0 fix: updated the spectrogram icon 2026-05-01 20:18:32 -07:00
Xiaohan-Tian 83034455cc feat: implemented piano roll hybrid mode to allow user edit MIDI notes while observing spectrogram as reference 2026-05-01 18:28:45 -07:00
Xiaohan-Tian eafb3a4937 feat: added audio track spectrogram visualization feature 2026-05-01 17:44:29 -07:00
Xiaohan-Tian 83f4bfe47f fix: missing media files when renaming + saving the project 2026-04-10 12:14:20 -07:00
Xiaohan-Tian fc84edfc59 feat: add audio track support with WAV/MP3 playback and looping
Introduce KGAudioTrack and KGAudioRegion as new track/region types
alongside existing MIDI tracks. Users can import WAV, MP3, OGG, FLAC,
and AAC files into audio tracks with full playback, looping, and
solo/mute/volume support.

New core models:
- KGAudioTrack (extends KGTrack with TrackType.Wave)
- KGAudioRegion (extends KGRegion with audio file reference)
- KGAudioPlayerBus (Tone.Gain + ToneBufferSource-based playback)
- KGAudioFileStorage (OPFS media/ directory for binary audio files)

New commands:
- AddAudioTrackCommand (create audio track with player bus)
- ImportAudioCommand (import audio file, create region at playhead,
auto-expand maxBars)

Playback features:
- Audio regions scheduled via Tone.Transport alongside MIDI events
- Loop support with duration capping at loop boundaries
- Resume safety offset to prevent ToneBufferSource timing misses
- Cross-track buffer copy when moving audio regions between tracks
- Proper buffer cleanup on track deletion and project switch

UI changes:
- Separate "+ MIDI" and "+ Audio" buttons in top-left spacer
- Audio track shows upload button instead of instrument selector
- FileImportModal reused for audio file drag-and-drop upload
- Real waveform rendering on audio region canvas
- Green color scheme for audio regions (vs blue for MIDI)
- Pencil icon and resize handles hidden for audio regions
- Cross-type region moves blocked (MIDI ↔ Audio)
- Piano roll blocked for audio regions
- Audio region deletion support

Infrastructure:
- Project structure version bumped to 4 (no-op migration)
- class-transformer discriminators updated for new subtypes
- RemoveTrackCommand updated to clean up audio player buses
2026-04-09 21:54:54 -07:00
Xiaohan-Tian 17610f12f3 refactor: split monolithic App.css into feature-based co-located CSS files 2026-04-09 17:31:49 -07:00