Commit Graph

383 Commits

Author SHA1 Message Date
3dtours 8fdf93f5d1 fix: đã sửa lỗi MIDI note ghi âm xuất hiện realtime 2026-07-25 20:04:42 +07:00
3dtours 8849f33d07 fix: extend piano roll playhead duration to 10min during recording 2026-07-25 20:03:09 +07:00
3dtours 97855f47d1 fix: add try-catch + nextMetronomeBeatRef init to startPianoRollRecording 2026-07-25 19:56:19 +07:00
3dtours d858628a8f fix: sync notes from st.notes + set isPlaying for playhead + metronome count-in 2026-07-25 19:53:45 +07:00
3dtours f3ad111376 fix: set subTab buffer + fix double stop() call + realtime playhead 2026-07-25 19:48:00 +07:00
3dtours 7f681f23c1 fix: không ghi âm và ghi note MIDI và khong xuất hiện realtime 2026-07-25 19:47:17 +07:00
3dtours 6cc3ae6ab8 fix: use startSubTabPlayback for piano roll recording + pass recTempMidiNotes prop 2026-07-25 19:39:55 +07:00
3dtours 432dec635a fix: không ghi âm và ghi note MIDI 2026-07-25 19:36:56 +07:00
3dtours e6dd7ff13c fix: realtime note display + MIDI key sound via refs 2026-07-25 18:58:30 +07:00
3dtours da760dbb86 fix: MIDI record + key highlight on MIDI key press 2026-07-25 18:55:31 +07:00
3dtours c3edda5c81 fix: call midiRec.start() so MIDI recorder receives messages 2026-07-25 18:44:33 +07:00
3dtours 68eb6d5261 fix: replace stale snapToScale ref with st.snapToScale 2026-07-25 18:39:47 +07:00
3dtours 513a6b082c fix: record midi - setSelectedMidiInputId, snapToScale persist, space stops recording 2026-07-25 18:37:02 +07:00
3dtours 1151f1afa0 feat: bật tính năng ghi midi note trong piano roll tab 2026-07-25 18:36:11 +07:00
3dtours 5af8536e53 fix: add recTempMidiNotes to PianoRollTabEditor props 2026-07-25 18:31:35 +07:00
3dtours dffb8562df fix: piano roll recording - playhead, realtime notes, recording display 2026-07-25 18:30:16 +07:00
3dtours 9498a0d4b0 fix: piano roll record via ARM + INPUT routes to piano roll tab 2026-07-25 18:25:29 +07:00
3dtours 2c91c0156a feat: add Omni MIDI option in piano roll INPUT select 2026-07-25 18:20:42 +07:00
3dtours cdff404437 fix: lỗi không mở được piano roll và thêm các tính năng cho AI 2026-07-25 17:29:35 +07:00
3dtours 1b711ef014 feat: piano roll transport, ARM/INPUT, AI bar range, MIDI recording
- Transport: play/stop/back/next/record buttons in piano roll toolbar
- ARM toggle + MIDI input device selector next to Snap to Scale
- AI bar range selector (bar X to bar Y) for Copilot MIDI generation
- handleAISend detects active piano roll tab and routes MIDI prompt
- Added selectedMidiInputId state + handleMidiInputSelect for MIDI input
2026-07-25 17:22:24 +07:00
3dtours 1a97a4b33b fix: quy định kết quả AI copilot trả về đúng tab đang mở 2026-07-25 16:35:54 +07:00
3dtours a59a36ec90 fix: use configured AI provider for piano roll prompt, not hardcoded
Piano roll AI prompt now selects provider via same logic as main AI
handler (aiProviders, selectedProviderId, baseUrl, apiKey, model).
No longer hardcodes provider:'openai', model:'gpt-4o'.
2026-07-25 16:26:47 +07:00
3dtours 7dd6300500 fix: guard AI response parse against undefined textResponse 2026-07-25 16:21:59 +07:00
3dtours 5628802e08 refactor: remove piano roll AI prompt, reuse Copilot for MIDI gen
- Removed aiPrompt/aiLoading state and handleAIPrompt from PianoRollTabEditor
- Removed AI prompt input UI from piano roll toolbar
- handleAISend now detects active piano roll tab and routes
  prompts to MIDI note generation, appends notes to the tab
2026-07-25 16:19:44 +07:00
3dtours 2fed3eee0b fix: sửa lỗi snap to scale trong piano roll tab 2026-07-25 12:44:08 +07:00
3dtours eaedfebdf0 fix: snap to scale now works on initial click + use refs
- Initial click note pitch now snaps when snapToScale is on
- Added snapToScaleRef and selectedScaleRef for stale-closure safety
- All brush-draw snap paths (mousedown + mousemove) use refs
2026-07-25 12:42:50 +07:00
3dtours f5bc0a8810 feat: Snap to Scale toggle + remove tool buttons + no menu on erase sweep
- Added snapToScale state + toggle switch in piano roll toolbar
- snapPitchToScale only applies when snapToScale is true
- Removed Select/Pen/Eraser tool buttons
- Right-click drag erase sweep sets swallowContextMenuRef=true
  so context menu won't appear during sweep
2026-07-25 12:39:32 +07:00
3dtours 221561d58a fix: right-click delete no menu + scale only for brush drag
- Separate swallowContextMenuRef (not tied to rightClickDragRef) so
  menu is skipped on right-click delete
- Initial click draw uses raw pitch, not snapPitchToScale (scale only
  applies during brush-drag in mousemove)
2026-07-25 12:34:12 +07:00
3dtours 0a17cc91ea fix: right-click delete note no longer shows context menu
Set rightClickDragRef.erasedNote=true on delete. handleContextMenu
checks and skips menu when true.
2026-07-25 12:30:08 +07:00
3dtours 7174773cb3 fix: separate right-click menu vs drag-erase behavior
Right-click on note = delete.
Right-click empty space (no drag) = context menu only (no erase sweep).
Right-click empty space + drag >5px = erase sweep (starts on mousemove).
Uses rightClickDragRef to track pending right-click state.
2026-07-25 12:28:44 +07:00
3dtours 0beb957185 fix: restore erase sweep on right-click-drag
Right-click on note = delete. Right-click + drag on empty space =
erase sweep. Resets on mouseup so brush works after menu closes.
2026-07-25 12:26:11 +07:00
3dtours 963a5519af fix: click empty space always draws note regardless of tool
Removed tool check for drawing. Default tool back to 'select'.
Click + drag on empty piano roll = draw notes, no tool switch needed.
2026-07-25 12:24:47 +07:00
3dtours bf22679506 fix: set default piano roll tool to 'pen' so brush works
ActiveRollTool default changed from 'select' to 'pen' so clicking
empty space draws notes immediately. Users who switch tool must
switch back to 'pen' to draw.
2026-07-25 12:23:23 +07:00
3dtours 66cb05f26c fix: scale sub-menu as separate floating panel, not shifted main menu
Sub-menu items now render as a standalone fixed-position panel
at origin.x+150, not mixed into the main menu. Main menu stays
at its initial position. Hover to open, click to select scale.
2026-07-25 12:22:18 +07:00
3dtours 5497bd1256 fix: scale menu on grid canvas, not keybed; erase sweep removed
- Context menu (Scales) appears at right-click position on grid canvas
- Removed erase sweep on right-click (blocked brush after menu close)
- Removed keybed onContextMenu (was wrong position)
- Store menu origin ref so sub-menus don't drift on hover
2026-07-25 12:19:32 +07:00
3dtours 225c44d98a feat: brush-pen scale snap + scale sub-menu hover + keybed swipe
- Brush (pen tool only) draws notes snapped to selected scale
- Scale sub-menus open on hover instead of click
- Keybed: swipe/drag across keys plays notes (mouseenter+mousedown)
- Global mouseup resets keybed drag state
2026-07-25 12:01:42 +07:00
3dtours 51787e055e feat: piano roll velocity scroll, alt+scroll play, scale menu
- Shift+scroll on note: change velocity; on empty space: horizontal scroll
- Alt+scroll: playhead scrub + play notes (was shift+scroll)
- Fix CC lane height drag direction (up=increase, down=decrease)
- Restructure SCALES hierarchy: Diatonic, Pentatonic, Church, Jazz, Asian, Middle Eastern
- Right-click on keybed pitch row opens scale context menu
2026-07-25 11:56:50 +07:00
3dtours ac78d0aa7a fix: sửa lỗi vẽ section item trên main session 2026-07-25 11:41:57 +07:00
3dtours e90c929885 fix: clip section sub-track content to section bounds
When section duration is resized shorter, sub-track clips and MIDI
notes were still drawn outside the section's visual rectangle.
Added ctx.save/clip/restore around sub-track rendering.
2026-07-25 11:39:43 +07:00
3dtours e0531be65b fix: redraw canvas when section/MIDI item duration changes on resize
Add setCanvasRedrawCount after updateActiveTracks in resize handler
so WaveformLane re-renders with updated notes/waveform.
2026-07-25 11:33:35 +07:00
3dtours a956ae407c fix: sửa lỗi drag nhóm midi note trong piano roll tab 2026-07-25 11:31:01 +07:00
3dtours 569ae9ef3e fix: allow drag-move of already-selected notes in piano roll
Previously clicking an already-selected note played preview and returned
early, preventing drag. Now reuses existing selectedNoteIds for drag.
2026-07-25 11:29:09 +07:00
3dtours 0039f85913 fix: sửa lỗi hiển thị hiển thị bar và timeline hoàn thành cho main session 2026-07-25 11:23:46 +07:00
3dtours 7530738444 fix: remove overflow-hidden wrapper causing canvas width mismatch
Div wrapper with overflow-hidden clipped the sticky canvas right edge.
TempoTrackLane now renders like TimelineRuler — Fragment + spacer + canvas.
2026-07-25 11:16:56 +07:00
3dtours a6a12b36a7 fix: use DOM scrollLeftVal for clip/section/MIDI rendering in WaveformLane
6 render positions (clip, marker, section, MIDI, note, selection) were
using React prop scrollLeft instead of DOM scrollLeftVal, causing
grid-vs-item desync during fast auto-scroll.
2026-07-25 11:12:39 +07:00
3dtours c397545383 fix: read scrollLeft from DOM wrapper for canvas sync
Canvas effects now find nearest scrollable ancestor and read
scrollLeft directly, bypassing React prop latency during auto-scroll.
Applies to TempoTrackLane, WaveformLane, TimelineRuler.
2026-07-25 11:09:20 +07:00
3dtours 5bd61516aa fix: PADDING_LEFT=0, tEnd uses CLIP_BUFFER for right buffer
- PADDING_LEFT=0 in all 3 components (grid aligns with clip origin)
- TempoTrackLane/WaveformLane tEnd uses CLIP_BUFFER/zoom so bars render past right edge
- TimelineRuler tEnd uses CLIP_BUFFER/zoom instead of PADDING_LEFT
2026-07-25 11:06:12 +07:00
3dtours 01cd3d1867 fix: allow item drag/resize to snap at column 0
- Removed Math.max(beatSec, ...) clamp from clip drag, section drag, section resize handlers
- Replaced with Math.max(0, ...) so items can snap to time 0
2026-07-25 10:59:17 +07:00
3dtours cb3e8117b2 fix: sửa lỗi hiển thị hiển thị bar và timeline 2026-07-25 10:58:28 +07:00
3dtours 8be4ce99e1 fix: tempo track height 40px fixed + clamp selection >= 0
- TempoTrackLane canvas height fixed to 40px, wrapper h-10 shrink-0 overflow-hidden
- selLeft/selRight clamped to Math.max(0, ...)
- rulerAnchorRef/setSelectionStart/setSelectionEnd clamped >= 0
2026-07-25 10:55:46 +07:00