Commit Graph

201 Commits

Author SHA1 Message Date
Xiaohan-Tian d94b53dcf5 feat: add snap-to-grid toggle for track grid regions and playhead 2026-04-10 20:57:34 -07:00
Xiaohan-Tian 1670679c61 feat: add audio region trimming with non-destructive clip offset 2026-04-10 20:17:31 -07:00
Xiaohan-Tian 139684b413 feat: add bar width multiplier (1x–8x horizontal zoom) for track grid 2026-04-10 18:17:36 -07:00
Xiaohan-Tian 1ff9bfcac4 feat: add Open Project modal with project browser, soft delete, and duplicate
Replace the prompt-based project loading with a full modal UI:
- Draggable/resizable panel with overlay and backdrop blur
- Filterable project list with incremental fuzzy matching
- Sortable columns (name, created, updated) with asc/desc toggle
- Duplicate project with auto-rename on name conflict
- Soft delete with trash view, restore, and permanent delete
- Auto-purge trash after 30 days
- Orphan media file cleanup on project open
- Skip folders without valid meta.json in project listing
2026-04-10 13:28:01 -07:00
Xiaohan-Tian 21a19918b5 fix: assigned an image as audio track's instrument-preview background 2026-04-10 12:30:57 -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 2d3ea33ce6 refactor: migrate project storage from IndexedDB to OPFS with folder-based structure
- Replace monolithic KGStorage with KGProjectStorage (OPFS) and KGConfigStorage (IndexedDB)
- Each project stored as folder: project.json + meta.json + media/
- Add KGConfigUpgrader with V1 upgrader to auto-migrate existing IndexedDB projects to OPFS
- Request persistent storage via navigator.storage.persist() to prevent browser eviction
- Show loading spinner during one-time migration
- Enforce safe project name characters (letters, numbers, space, hyphen, underscore, period, parens)
- Export projects as .kgstudio zip bundles instead of raw JSON
- Import supports .kgstudio bundles (with meta.json validation) and legacy JSON files
- Auto-deduplicate project names on import with (1), (2), etc. suffix
- Add OPFS shell debugger (pwd, ls, cd, cat, dl) accessible via KGDebugger.opfs()
- Add ESLint semi rule for consistent semicolons
- Delete KGStorage.ts — all logic absorbed by new storage classes
- Add jszip dependency for zip export/import
2026-04-09 19:25:08 -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
Xiaohan-Tian 58cb4cebef refactor: moved "Add track" button from bottom TrackControl to top-left-spacer for better discoverability 2026-04-08 19:15:01 -07:00
Xiaohan-Tian 63ced27702 feat: added Claude 4.6 model series options. 2026-04-05 23:01:58 -07:00
Xiaohan-Tian 586f0f996c feat: added OpenAI SDK with OpenRouter based Claude model support; updated recommended models in README.md 2026-04-05 22:57:12 -07:00
Xiaohan-Tian 6c49fbfabe feat: added model options for GPT-5.4 families; updated default model to gpt-5.4-mini 2026-04-05 22:23:07 -07:00
Xiaohan-Tian ee31ca087e fix: minor UI enhancements. 2026-04-05 19:59:49 -07:00
Xiaohan-Tian 2cd976ff96 refactor: migrate agent system from XML tool calling to OpenAI SDK with native function calling
- Replace custom XML-based tool parsing (XMLToolExecutor) with OpenAI SDK's
  native tool_calls via `openai` npm package (dangerouslyAllowBrowser)
- Consolidate 4 LLM providers (OpenAI, Claude, Gemini, ClaudeOpenRouter)
  into a single OpenAI SDK-based LLMProvider compatible with any
  OpenAI-style API (OpenAI, OpenRouter, Ollama, vLLM)
- Move agentic tool execution loop from ChatBox into AgentCore
- Update Message type to support tool roles, tool_calls, and tool_call_id
- Update system prompt to remove XML formatting instructions (~45% smaller)
- Remove AttemptCompletionTool (replaced by stop_reason detection),
  ThinkTool, and ThinkingTool
- Polish tool descriptions for OpenAI function calling schema compliance
- Normalize base URLs by stripping /chat/completions suffix
2026-04-05 18:59:25 -07:00
Xiaohan-Tian 1c8361d45b feat: implemented playback looping; fixed an linter error in Toolbar.tsx 2026-01-23 15:34:26 -08:00
Xiaohan-Tian 78b798e138 feat: added a hotkey for loop button 2026-01-22 19:05:22 -08:00
Xiaohan-Tian b80e7e84b8 feat: implemented change loop setting command 2026-01-22 18:50:09 -08:00
Xiaohan-Tian f367c84ee8 feat: implemented UI of looping feature 2026-01-22 18:36:25 -08:00
Xiaohan-Tian e8b79efde7 feat: add option to persist API keys on non-localhost (opt-in security feature) 2026-01-17 13:54:15 -08:00
Xiaohan-Tian 4f4e60f84a feat: added latest (as of 2025-12-25) GPT and Claude model support 2025-12-25 14:29:50 -08:00
Xiaohan-Tian b44e6fb1ee feat: added an option to control playhead animation fps 2025-12-21 22:42:01 -08:00
Xiaohan-Tian eaee036fc2 feat: added playback delay configuration 2025-12-21 20:11:27 -08:00
Xiaohan-Tian aadf9e06df feat: added lookAhead option 2025-12-21 18:51:20 -08:00
Xiaohan-Tian 5cceec0c01 feat: implemented chord guide customization feature 2025-12-17 23:07:21 -08:00
Xiaohan-Tian 610b81e4cc feat: merge mode_list.json into functional_chords.json 2025-12-17 22:10:37 -08:00
Xiaohan-Tian 54b227c1be feat: implemented the logic to automatically create a chord when a suitable guide chord is highlighted. 2025-12-15 21:59:56 -08:00
Xiaohan-Tian fbd13eef9f fix: default chord guide note's length to last edited note's length 2025-12-15 21:48:03 -08:00
Xiaohan-Tian bdc7fc899a feat: added highlighted chord guide on piano grid 2025-12-15 20:14:30 -08:00
Xiaohan-Tian 8512fb4204 feat: added logic to get suitable chords (console log only) 2025-12-14 21:52:23 -08:00
Xiaohan-Tian dcd2d89d0f feat: persistence selected mode 2025-12-10 21:54:16 -08:00
Xiaohan-Tian fa201d11c5 fix: display the currently selected mode in the mode dropdown 2025-12-09 23:55:48 -08:00
Xiaohan-Tian 9e0c0cc1f5 feat: add scale highlighting to Piano Roll grid 2025-12-09 23:50:03 -08:00
Xiaohan-Tian 98ed8a60ce feat: added mode list dropdown 2025-12-08 22:59:09 -08:00
Xiaohan-Tian 2bf5328af7 feat: added unit tests for KGMidiRegion and abcNotationUtil; update all deprecated method plainToClass to plainToInstance. 2025-09-03 23:05:13 -07:00
Xiaohan-Tian 0eac49493c feat: implement automated versioning. 2025-08-28 22:23:47 -07:00
Xiaohan-Tian 62b3a8c8d7 fix: reset mute/solo UI states on project/track changes 2025-08-28 19:51:47 -07:00
Xiaohan-Tian efb161dbf4 implemented ClaudeOpenRouterProvider. 2025-08-24 15:23:57 -07:00
Xiaohan-Tian 81c6aeb966 added a configuration option for Claude through OpenRouter. 2025-08-24 13:31:33 -07:00
Xiaohan-Tian 0c54332401 added export conversation feature. 2025-08-21 21:56:22 -07:00
Xiaohan-Tian c1112f41d5 added an option to fix the "Zoom can't capture the sound" problem (it is IMPORTANT to choose "share sound" when share screen in Zoom). 2025-08-20 15:48:26 -07:00
Xiaohan-Tian 8b0ddae58d optimized ChatBox component. 2025-08-16 17:35:40 -07:00
Xiaohan-Tian f5a6c8d92c added a subtle wave animation to the 'processing...' text. 2025-08-15 19:34:13 -07:00
Xiaohan-Tian 2510014580 updated the naming convention for new tracks and regions. New tracks now default to 'Track {i}', and new regions default to '{track_name} Region {i}'. 2025-08-12 21:41:11 -07:00
Xiaohan-Tian 47872287ce prevent users from creating overlapping regions. 2025-08-12 21:18:36 -07:00
Xiaohan-Tian 3534dc7fca hide the ChatBox instead of unmount it to prevent lose chat history. 2025-08-12 19:29:32 -07:00
Xiaohan-Tian 5e5a68e1d7 added a treatment for InstrumentSelection panel when selectedTrackId is empty or doesn't associate with a valid track. 2025-08-12 18:25:00 -07:00
Xiaohan-Tian 7ada648d14 removed instrumentSelectionTrackId from projectStore, align the instrumentSelectionTrackId with selectedTrackId. 2025-08-12 18:14:25 -07:00
Xiaohan-Tian ee34115423 auto-select new created track; delete selected track will change selection to an remaining track. 2025-08-12 18:04:14 -07:00
Xiaohan-Tian bf085dacf2 introduce BASE_URL to the app and set it to /kgstudio/. 2025-08-11 22:35:51 -07:00