@drop-ai/core 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +316 -0
- package/dist/actions/ActionRegistry.d.ts +33 -0
- package/dist/actions/ActionRegistry.d.ts.map +1 -0
- package/dist/actions/ActionRegistry.js +96 -0
- package/dist/actions/ActionRegistry.js.map +1 -0
- package/dist/actions/types.d.ts +31 -0
- package/dist/actions/types.d.ts.map +1 -0
- package/dist/actions/types.js +11 -0
- package/dist/actions/types.js.map +1 -0
- package/dist/analysis/TransientDetector.d.ts +28 -0
- package/dist/analysis/TransientDetector.d.ts.map +1 -0
- package/dist/analysis/TransientDetector.js +109 -0
- package/dist/analysis/TransientDetector.js.map +1 -0
- package/dist/audio/AudioEngine.d.ts +107 -0
- package/dist/audio/AudioEngine.d.ts.map +1 -0
- package/dist/audio/AudioEngine.js +798 -0
- package/dist/audio/AudioEngine.js.map +1 -0
- package/dist/audio/AudioProvider.d.ts +96 -0
- package/dist/audio/AudioProvider.d.ts.map +1 -0
- package/dist/audio/AudioProvider.js +2 -0
- package/dist/audio/AudioProvider.js.map +1 -0
- package/dist/audio/BufferPool.d.ts +92 -0
- package/dist/audio/BufferPool.d.ts.map +1 -0
- package/dist/audio/BufferPool.js +172 -0
- package/dist/audio/BufferPool.js.map +1 -0
- package/dist/audio/LoudnessUtils.d.ts +18 -0
- package/dist/audio/LoudnessUtils.d.ts.map +1 -0
- package/dist/audio/LoudnessUtils.js +91 -0
- package/dist/audio/LoudnessUtils.js.map +1 -0
- package/dist/audio/MeterUtils.d.ts +37 -0
- package/dist/audio/MeterUtils.d.ts.map +1 -0
- package/dist/audio/MeterUtils.js +71 -0
- package/dist/audio/MeterUtils.js.map +1 -0
- package/dist/audio/OfflineExporter.d.ts +48 -0
- package/dist/audio/OfflineExporter.d.ts.map +1 -0
- package/dist/audio/OfflineExporter.js +202 -0
- package/dist/audio/OfflineExporter.js.map +1 -0
- package/dist/audio/ProcessingGraph.d.ts +152 -0
- package/dist/audio/ProcessingGraph.d.ts.map +1 -0
- package/dist/audio/ProcessingGraph.js +360 -0
- package/dist/audio/ProcessingGraph.js.map +1 -0
- package/dist/audio/SourceCache.d.ts +124 -0
- package/dist/audio/SourceCache.d.ts.map +1 -0
- package/dist/audio/SourceCache.js +205 -0
- package/dist/audio/SourceCache.js.map +1 -0
- package/dist/audio/dto.d.ts +50 -0
- package/dist/audio/dto.d.ts.map +1 -0
- package/dist/audio/dto.js +2 -0
- package/dist/audio/dto.js.map +1 -0
- package/dist/audio/engine/PlaylistEngine.d.ts +19 -0
- package/dist/audio/engine/PlaylistEngine.d.ts.map +1 -0
- package/dist/audio/engine/PlaylistEngine.js +83 -0
- package/dist/audio/engine/PlaylistEngine.js.map +1 -0
- package/dist/automation/AutomationCurve.d.ts +61 -0
- package/dist/automation/AutomationCurve.d.ts.map +1 -0
- package/dist/automation/AutomationCurve.js +198 -0
- package/dist/automation/AutomationCurve.js.map +1 -0
- package/dist/automation/AutomationList.d.ts +185 -0
- package/dist/automation/AutomationList.d.ts.map +1 -0
- package/dist/automation/AutomationList.js +459 -0
- package/dist/automation/AutomationList.js.map +1 -0
- package/dist/automation/AutomationMode.d.ts +17 -0
- package/dist/automation/AutomationMode.d.ts.map +1 -0
- package/dist/automation/AutomationMode.js +18 -0
- package/dist/automation/AutomationMode.js.map +1 -0
- package/dist/automation/ParameterDescriptor.d.ts +65 -0
- package/dist/automation/ParameterDescriptor.d.ts.map +1 -0
- package/dist/automation/ParameterDescriptor.js +113 -0
- package/dist/automation/ParameterDescriptor.js.map +1 -0
- package/dist/automation/PointThinning.d.ts +14 -0
- package/dist/automation/PointThinning.d.ts.map +1 -0
- package/dist/automation/PointThinning.js +52 -0
- package/dist/automation/PointThinning.js.map +1 -0
- package/dist/automation/types.d.ts +14 -0
- package/dist/automation/types.d.ts.map +1 -0
- package/dist/automation/types.js +9 -0
- package/dist/automation/types.js.map +1 -0
- package/dist/commands/Command.d.ts +8 -0
- package/dist/commands/Command.d.ts.map +1 -0
- package/dist/commands/Command.js +2 -0
- package/dist/commands/Command.js.map +1 -0
- package/dist/commands/CommandExecutor.d.ts +36 -0
- package/dist/commands/CommandExecutor.d.ts.map +1 -0
- package/dist/commands/CommandExecutor.js +108 -0
- package/dist/commands/CommandExecutor.js.map +1 -0
- package/dist/commands/CommandHistory.d.ts +155 -0
- package/dist/commands/CommandHistory.d.ts.map +1 -0
- package/dist/commands/CommandHistory.js +316 -0
- package/dist/commands/CommandHistory.js.map +1 -0
- package/dist/commands/CommandRegistry.d.ts +110 -0
- package/dist/commands/CommandRegistry.d.ts.map +1 -0
- package/dist/commands/CommandRegistry.js +91 -0
- package/dist/commands/CommandRegistry.js.map +1 -0
- package/dist/commands/UndoTransaction.d.ts +54 -0
- package/dist/commands/UndoTransaction.d.ts.map +1 -0
- package/dist/commands/UndoTransaction.js +77 -0
- package/dist/commands/UndoTransaction.js.map +1 -0
- package/dist/commands/handlers/AutomationHandler.d.ts +14 -0
- package/dist/commands/handlers/AutomationHandler.d.ts.map +1 -0
- package/dist/commands/handlers/AutomationHandler.js +84 -0
- package/dist/commands/handlers/AutomationHandler.js.map +1 -0
- package/dist/commands/handlers/CommandHandler.d.ts +57 -0
- package/dist/commands/handlers/CommandHandler.d.ts.map +1 -0
- package/dist/commands/handlers/CommandHandler.js +22 -0
- package/dist/commands/handlers/CommandHandler.js.map +1 -0
- package/dist/commands/handlers/ExportHandler.d.ts +14 -0
- package/dist/commands/handlers/ExportHandler.d.ts.map +1 -0
- package/dist/commands/handlers/ExportHandler.js +166 -0
- package/dist/commands/handlers/ExportHandler.js.map +1 -0
- package/dist/commands/handlers/HistoryHandler.d.ts +29 -0
- package/dist/commands/handlers/HistoryHandler.d.ts.map +1 -0
- package/dist/commands/handlers/HistoryHandler.js +124 -0
- package/dist/commands/handlers/HistoryHandler.js.map +1 -0
- package/dist/commands/handlers/IOHandler.d.ts +14 -0
- package/dist/commands/handlers/IOHandler.d.ts.map +1 -0
- package/dist/commands/handlers/IOHandler.js +59 -0
- package/dist/commands/handlers/IOHandler.js.map +1 -0
- package/dist/commands/handlers/MarkerHandler.d.ts +13 -0
- package/dist/commands/handlers/MarkerHandler.d.ts.map +1 -0
- package/dist/commands/handlers/MarkerHandler.js +95 -0
- package/dist/commands/handlers/MarkerHandler.js.map +1 -0
- package/dist/commands/handlers/MidiHandler.d.ts +14 -0
- package/dist/commands/handlers/MidiHandler.d.ts.map +1 -0
- package/dist/commands/handlers/MidiHandler.js +153 -0
- package/dist/commands/handlers/MidiHandler.js.map +1 -0
- package/dist/commands/handlers/MixerSceneHandler.d.ts +12 -0
- package/dist/commands/handlers/MixerSceneHandler.d.ts.map +1 -0
- package/dist/commands/handlers/MixerSceneHandler.js +113 -0
- package/dist/commands/handlers/MixerSceneHandler.js.map +1 -0
- package/dist/commands/handlers/RangeHandler.d.ts +14 -0
- package/dist/commands/handlers/RangeHandler.d.ts.map +1 -0
- package/dist/commands/handlers/RangeHandler.js +108 -0
- package/dist/commands/handlers/RangeHandler.js.map +1 -0
- package/dist/commands/handlers/RegionHandler.d.ts +14 -0
- package/dist/commands/handlers/RegionHandler.d.ts.map +1 -0
- package/dist/commands/handlers/RegionHandler.js +313 -0
- package/dist/commands/handlers/RegionHandler.js.map +1 -0
- package/dist/commands/handlers/SendBusHandler.d.ts +14 -0
- package/dist/commands/handlers/SendBusHandler.d.ts.map +1 -0
- package/dist/commands/handlers/SendBusHandler.js +55 -0
- package/dist/commands/handlers/SendBusHandler.js.map +1 -0
- package/dist/commands/handlers/SessionHandler.d.ts +14 -0
- package/dist/commands/handlers/SessionHandler.d.ts.map +1 -0
- package/dist/commands/handlers/SessionHandler.js +80 -0
- package/dist/commands/handlers/SessionHandler.js.map +1 -0
- package/dist/commands/handlers/TrackGroupHandler.d.ts +18 -0
- package/dist/commands/handlers/TrackGroupHandler.d.ts.map +1 -0
- package/dist/commands/handlers/TrackGroupHandler.js +210 -0
- package/dist/commands/handlers/TrackGroupHandler.js.map +1 -0
- package/dist/commands/handlers/TrackHandler.d.ts +14 -0
- package/dist/commands/handlers/TrackHandler.d.ts.map +1 -0
- package/dist/commands/handlers/TrackHandler.js +241 -0
- package/dist/commands/handlers/TrackHandler.js.map +1 -0
- package/dist/commands/handlers/TransportHandler.d.ts +14 -0
- package/dist/commands/handlers/TransportHandler.d.ts.map +1 -0
- package/dist/commands/handlers/TransportHandler.js +117 -0
- package/dist/commands/handlers/TransportHandler.js.map +1 -0
- package/dist/commands/handlers/index.d.ts +18 -0
- package/dist/commands/handlers/index.d.ts.map +1 -0
- package/dist/commands/handlers/index.js +17 -0
- package/dist/commands/handlers/index.js.map +1 -0
- package/dist/commands/impl/AddAutomationPointCommand.d.ts +20 -0
- package/dist/commands/impl/AddAutomationPointCommand.d.ts.map +1 -0
- package/dist/commands/impl/AddAutomationPointCommand.js +45 -0
- package/dist/commands/impl/AddAutomationPointCommand.js.map +1 -0
- package/dist/commands/impl/AddAuxTrackCommand.d.ts +11 -0
- package/dist/commands/impl/AddAuxTrackCommand.d.ts.map +1 -0
- package/dist/commands/impl/AddAuxTrackCommand.js +23 -0
- package/dist/commands/impl/AddAuxTrackCommand.js.map +1 -0
- package/dist/commands/impl/AddBusTrackCommand.d.ts +11 -0
- package/dist/commands/impl/AddBusTrackCommand.d.ts.map +1 -0
- package/dist/commands/impl/AddBusTrackCommand.js +23 -0
- package/dist/commands/impl/AddBusTrackCommand.js.map +1 -0
- package/dist/commands/impl/AddMarkerCommand.d.ts +13 -0
- package/dist/commands/impl/AddMarkerCommand.d.ts.map +1 -0
- package/dist/commands/impl/AddMarkerCommand.js +25 -0
- package/dist/commands/impl/AddMarkerCommand.js.map +1 -0
- package/dist/commands/impl/AddMidiNoteCommand.d.ts +22 -0
- package/dist/commands/impl/AddMidiNoteCommand.d.ts.map +1 -0
- package/dist/commands/impl/AddMidiNoteCommand.js +45 -0
- package/dist/commands/impl/AddMidiNoteCommand.js.map +1 -0
- package/dist/commands/impl/AddPluginCommand.d.ts +19 -0
- package/dist/commands/impl/AddPluginCommand.d.ts.map +1 -0
- package/dist/commands/impl/AddPluginCommand.js +43 -0
- package/dist/commands/impl/AddPluginCommand.js.map +1 -0
- package/dist/commands/impl/AddRangeCommand.d.ts +19 -0
- package/dist/commands/impl/AddRangeCommand.d.ts.map +1 -0
- package/dist/commands/impl/AddRangeCommand.js +32 -0
- package/dist/commands/impl/AddRangeCommand.js.map +1 -0
- package/dist/commands/impl/AddRegionCommand.d.ts +19 -0
- package/dist/commands/impl/AddRegionCommand.d.ts.map +1 -0
- package/dist/commands/impl/AddRegionCommand.js +58 -0
- package/dist/commands/impl/AddRegionCommand.js.map +1 -0
- package/dist/commands/impl/AddSendBusCommand.d.ts +23 -0
- package/dist/commands/impl/AddSendBusCommand.d.ts.map +1 -0
- package/dist/commands/impl/AddSendBusCommand.js +30 -0
- package/dist/commands/impl/AddSendBusCommand.js.map +1 -0
- package/dist/commands/impl/AddSourceCommand.d.ts +12 -0
- package/dist/commands/impl/AddSourceCommand.d.ts.map +1 -0
- package/dist/commands/impl/AddSourceCommand.js +16 -0
- package/dist/commands/impl/AddSourceCommand.js.map +1 -0
- package/dist/commands/impl/AddTempoChangeCommand.d.ts +15 -0
- package/dist/commands/impl/AddTempoChangeCommand.d.ts.map +1 -0
- package/dist/commands/impl/AddTempoChangeCommand.js +45 -0
- package/dist/commands/impl/AddTempoChangeCommand.js.map +1 -0
- package/dist/commands/impl/AddTrackCommand.d.ts +13 -0
- package/dist/commands/impl/AddTrackCommand.d.ts.map +1 -0
- package/dist/commands/impl/AddTrackCommand.js +26 -0
- package/dist/commands/impl/AddTrackCommand.js.map +1 -0
- package/dist/commands/impl/ConnectIOCommand.d.ts +13 -0
- package/dist/commands/impl/ConnectIOCommand.d.ts.map +1 -0
- package/dist/commands/impl/ConnectIOCommand.js +31 -0
- package/dist/commands/impl/ConnectIOCommand.js.map +1 -0
- package/dist/commands/impl/CopyRegionCommand.d.ts +12 -0
- package/dist/commands/impl/CopyRegionCommand.d.ts.map +1 -0
- package/dist/commands/impl/CopyRegionCommand.js +42 -0
- package/dist/commands/impl/CopyRegionCommand.js.map +1 -0
- package/dist/commands/impl/DisconnectIOCommand.d.ts +13 -0
- package/dist/commands/impl/DisconnectIOCommand.d.ts.map +1 -0
- package/dist/commands/impl/DisconnectIOCommand.js +24 -0
- package/dist/commands/impl/DisconnectIOCommand.js.map +1 -0
- package/dist/commands/impl/DuplicateRegionCommand.d.ts +15 -0
- package/dist/commands/impl/DuplicateRegionCommand.d.ts.map +1 -0
- package/dist/commands/impl/DuplicateRegionCommand.js +49 -0
- package/dist/commands/impl/DuplicateRegionCommand.js.map +1 -0
- package/dist/commands/impl/ExportCommand.d.ts +17 -0
- package/dist/commands/impl/ExportCommand.d.ts.map +1 -0
- package/dist/commands/impl/ExportCommand.js +92 -0
- package/dist/commands/impl/ExportCommand.js.map +1 -0
- package/dist/commands/impl/FreezeTrackCommand.d.ts +25 -0
- package/dist/commands/impl/FreezeTrackCommand.d.ts.map +1 -0
- package/dist/commands/impl/FreezeTrackCommand.js +94 -0
- package/dist/commands/impl/FreezeTrackCommand.js.map +1 -0
- package/dist/commands/impl/GroupRegionsCommand.d.ts +15 -0
- package/dist/commands/impl/GroupRegionsCommand.d.ts.map +1 -0
- package/dist/commands/impl/GroupRegionsCommand.js +28 -0
- package/dist/commands/impl/GroupRegionsCommand.js.map +1 -0
- package/dist/commands/impl/LoadSessionCommand.d.ts +24 -0
- package/dist/commands/impl/LoadSessionCommand.d.ts.map +1 -0
- package/dist/commands/impl/LoadSessionCommand.js +77 -0
- package/dist/commands/impl/LoadSessionCommand.js.map +1 -0
- package/dist/commands/impl/LockRegionCommand.d.ts +16 -0
- package/dist/commands/impl/LockRegionCommand.d.ts.map +1 -0
- package/dist/commands/impl/LockRegionCommand.js +37 -0
- package/dist/commands/impl/LockRegionCommand.js.map +1 -0
- package/dist/commands/impl/MergeRegionsCommand.d.ts +19 -0
- package/dist/commands/impl/MergeRegionsCommand.d.ts.map +1 -0
- package/dist/commands/impl/MergeRegionsCommand.js +85 -0
- package/dist/commands/impl/MergeRegionsCommand.js.map +1 -0
- package/dist/commands/impl/MoveAutomationPointCommand.d.ts +20 -0
- package/dist/commands/impl/MoveAutomationPointCommand.d.ts.map +1 -0
- package/dist/commands/impl/MoveAutomationPointCommand.js +73 -0
- package/dist/commands/impl/MoveAutomationPointCommand.js.map +1 -0
- package/dist/commands/impl/MoveMarkerCommand.d.ts +13 -0
- package/dist/commands/impl/MoveMarkerCommand.d.ts.map +1 -0
- package/dist/commands/impl/MoveMarkerCommand.js +29 -0
- package/dist/commands/impl/MoveMarkerCommand.js.map +1 -0
- package/dist/commands/impl/MoveMidiNoteCommand.d.ts +20 -0
- package/dist/commands/impl/MoveMidiNoteCommand.d.ts.map +1 -0
- package/dist/commands/impl/MoveMidiNoteCommand.js +55 -0
- package/dist/commands/impl/MoveMidiNoteCommand.js.map +1 -0
- package/dist/commands/impl/MoveRegionCommand.d.ts +22 -0
- package/dist/commands/impl/MoveRegionCommand.d.ts.map +1 -0
- package/dist/commands/impl/MoveRegionCommand.js +148 -0
- package/dist/commands/impl/MoveRegionCommand.js.map +1 -0
- package/dist/commands/impl/NewSessionCommand.d.ts +17 -0
- package/dist/commands/impl/NewSessionCommand.d.ts.map +1 -0
- package/dist/commands/impl/NewSessionCommand.js +88 -0
- package/dist/commands/impl/NewSessionCommand.js.map +1 -0
- package/dist/commands/impl/NormalizeRegionCommand.d.ts +24 -0
- package/dist/commands/impl/NormalizeRegionCommand.d.ts.map +1 -0
- package/dist/commands/impl/NormalizeRegionCommand.js +60 -0
- package/dist/commands/impl/NormalizeRegionCommand.js.map +1 -0
- package/dist/commands/impl/PasteRegionCommand.d.ts +18 -0
- package/dist/commands/impl/PasteRegionCommand.d.ts.map +1 -0
- package/dist/commands/impl/PasteRegionCommand.js +66 -0
- package/dist/commands/impl/PasteRegionCommand.js.map +1 -0
- package/dist/commands/impl/RemoveAutomationPointCommand.d.ts +17 -0
- package/dist/commands/impl/RemoveAutomationPointCommand.d.ts.map +1 -0
- package/dist/commands/impl/RemoveAutomationPointCommand.js +69 -0
- package/dist/commands/impl/RemoveAutomationPointCommand.js.map +1 -0
- package/dist/commands/impl/RemoveMarkerCommand.d.ts +14 -0
- package/dist/commands/impl/RemoveMarkerCommand.d.ts.map +1 -0
- package/dist/commands/impl/RemoveMarkerCommand.js +32 -0
- package/dist/commands/impl/RemoveMarkerCommand.js.map +1 -0
- package/dist/commands/impl/RemoveMidiNoteCommand.d.ts +16 -0
- package/dist/commands/impl/RemoveMidiNoteCommand.d.ts.map +1 -0
- package/dist/commands/impl/RemoveMidiNoteCommand.js +38 -0
- package/dist/commands/impl/RemoveMidiNoteCommand.js.map +1 -0
- package/dist/commands/impl/RemovePluginCommand.d.ts +17 -0
- package/dist/commands/impl/RemovePluginCommand.d.ts.map +1 -0
- package/dist/commands/impl/RemovePluginCommand.js +55 -0
- package/dist/commands/impl/RemovePluginCommand.js.map +1 -0
- package/dist/commands/impl/RemoveRangeCommand.d.ts +15 -0
- package/dist/commands/impl/RemoveRangeCommand.d.ts.map +1 -0
- package/dist/commands/impl/RemoveRangeCommand.js +34 -0
- package/dist/commands/impl/RemoveRangeCommand.js.map +1 -0
- package/dist/commands/impl/RemoveRegionCommand.d.ts +17 -0
- package/dist/commands/impl/RemoveRegionCommand.d.ts.map +1 -0
- package/dist/commands/impl/RemoveRegionCommand.js +58 -0
- package/dist/commands/impl/RemoveRegionCommand.js.map +1 -0
- package/dist/commands/impl/RemoveSendBusCommand.d.ts +17 -0
- package/dist/commands/impl/RemoveSendBusCommand.d.ts.map +1 -0
- package/dist/commands/impl/RemoveSendBusCommand.js +34 -0
- package/dist/commands/impl/RemoveSendBusCommand.js.map +1 -0
- package/dist/commands/impl/RemoveTempoChangeCommand.d.ts +11 -0
- package/dist/commands/impl/RemoveTempoChangeCommand.d.ts.map +1 -0
- package/dist/commands/impl/RemoveTempoChangeCommand.js +32 -0
- package/dist/commands/impl/RemoveTempoChangeCommand.js.map +1 -0
- package/dist/commands/impl/RemoveTrackCommand.d.ts +11 -0
- package/dist/commands/impl/RemoveTrackCommand.d.ts.map +1 -0
- package/dist/commands/impl/RemoveTrackCommand.js +28 -0
- package/dist/commands/impl/RemoveTrackCommand.js.map +1 -0
- package/dist/commands/impl/ReorderTrackCommand.d.ts +15 -0
- package/dist/commands/impl/ReorderTrackCommand.d.ts.map +1 -0
- package/dist/commands/impl/ReorderTrackCommand.js +25 -0
- package/dist/commands/impl/ReorderTrackCommand.js.map +1 -0
- package/dist/commands/impl/ResizeRegionCommand.d.ts +18 -0
- package/dist/commands/impl/ResizeRegionCommand.d.ts.map +1 -0
- package/dist/commands/impl/ResizeRegionCommand.js +65 -0
- package/dist/commands/impl/ResizeRegionCommand.js.map +1 -0
- package/dist/commands/impl/ReverseRegionCommand.d.ts +22 -0
- package/dist/commands/impl/ReverseRegionCommand.d.ts.map +1 -0
- package/dist/commands/impl/ReverseRegionCommand.js +50 -0
- package/dist/commands/impl/ReverseRegionCommand.js.map +1 -0
- package/dist/commands/impl/SaveSessionCommand.d.ts +11 -0
- package/dist/commands/impl/SaveSessionCommand.d.ts.map +1 -0
- package/dist/commands/impl/SaveSessionCommand.js +33 -0
- package/dist/commands/impl/SaveSessionCommand.js.map +1 -0
- package/dist/commands/impl/SaveSnapshotCommand.d.ts +15 -0
- package/dist/commands/impl/SaveSnapshotCommand.d.ts.map +1 -0
- package/dist/commands/impl/SaveSnapshotCommand.js +34 -0
- package/dist/commands/impl/SaveSnapshotCommand.js.map +1 -0
- package/dist/commands/impl/SetGridCommand.d.ts +20 -0
- package/dist/commands/impl/SetGridCommand.d.ts.map +1 -0
- package/dist/commands/impl/SetGridCommand.js +35 -0
- package/dist/commands/impl/SetGridCommand.js.map +1 -0
- package/dist/commands/impl/SetLoopRangeCommand.d.ts +18 -0
- package/dist/commands/impl/SetLoopRangeCommand.d.ts.map +1 -0
- package/dist/commands/impl/SetLoopRangeCommand.js +44 -0
- package/dist/commands/impl/SetLoopRangeCommand.js.map +1 -0
- package/dist/commands/impl/SetPluginParameterCommand.d.ts +16 -0
- package/dist/commands/impl/SetPluginParameterCommand.d.ts.map +1 -0
- package/dist/commands/impl/SetPluginParameterCommand.js +49 -0
- package/dist/commands/impl/SetPluginParameterCommand.js.map +1 -0
- package/dist/commands/impl/SetPunchRangeCommand.d.ts +18 -0
- package/dist/commands/impl/SetPunchRangeCommand.d.ts.map +1 -0
- package/dist/commands/impl/SetPunchRangeCommand.js +42 -0
- package/dist/commands/impl/SetPunchRangeCommand.js.map +1 -0
- package/dist/commands/impl/SetRangeCommand.d.ts +27 -0
- package/dist/commands/impl/SetRangeCommand.d.ts.map +1 -0
- package/dist/commands/impl/SetRangeCommand.js +66 -0
- package/dist/commands/impl/SetRangeCommand.js.map +1 -0
- package/dist/commands/impl/SetRegionFadesCommand.d.ts +16 -0
- package/dist/commands/impl/SetRegionFadesCommand.d.ts.map +1 -0
- package/dist/commands/impl/SetRegionFadesCommand.js +46 -0
- package/dist/commands/impl/SetRegionFadesCommand.js.map +1 -0
- package/dist/commands/impl/SetRegionPlaybackRateCommand.d.ts +23 -0
- package/dist/commands/impl/SetRegionPlaybackRateCommand.d.ts.map +1 -0
- package/dist/commands/impl/SetRegionPlaybackRateCommand.js +46 -0
- package/dist/commands/impl/SetRegionPlaybackRateCommand.js.map +1 -0
- package/dist/commands/impl/SetRegionTimeDomainCommand.d.ts +16 -0
- package/dist/commands/impl/SetRegionTimeDomainCommand.d.ts.map +1 -0
- package/dist/commands/impl/SetRegionTimeDomainCommand.js +42 -0
- package/dist/commands/impl/SetRegionTimeDomainCommand.js.map +1 -0
- package/dist/commands/impl/SetSendLevelCommand.d.ts +18 -0
- package/dist/commands/impl/SetSendLevelCommand.d.ts.map +1 -0
- package/dist/commands/impl/SetSendLevelCommand.js +35 -0
- package/dist/commands/impl/SetSendLevelCommand.js.map +1 -0
- package/dist/commands/impl/SetTrackMuteCommand.d.ts +15 -0
- package/dist/commands/impl/SetTrackMuteCommand.d.ts.map +1 -0
- package/dist/commands/impl/SetTrackMuteCommand.js +29 -0
- package/dist/commands/impl/SetTrackMuteCommand.js.map +1 -0
- package/dist/commands/impl/SetTrackPanCommand.d.ts +15 -0
- package/dist/commands/impl/SetTrackPanCommand.d.ts.map +1 -0
- package/dist/commands/impl/SetTrackPanCommand.js +29 -0
- package/dist/commands/impl/SetTrackPanCommand.js.map +1 -0
- package/dist/commands/impl/SetTrackSoloCommand.d.ts +15 -0
- package/dist/commands/impl/SetTrackSoloCommand.d.ts.map +1 -0
- package/dist/commands/impl/SetTrackSoloCommand.js +29 -0
- package/dist/commands/impl/SetTrackSoloCommand.js.map +1 -0
- package/dist/commands/impl/SetTrackVolumeCommand.d.ts +15 -0
- package/dist/commands/impl/SetTrackVolumeCommand.d.ts.map +1 -0
- package/dist/commands/impl/SetTrackVolumeCommand.js +29 -0
- package/dist/commands/impl/SetTrackVolumeCommand.js.map +1 -0
- package/dist/commands/impl/SplitAtPlayheadCommand.d.ts +32 -0
- package/dist/commands/impl/SplitAtPlayheadCommand.d.ts.map +1 -0
- package/dist/commands/impl/SplitAtPlayheadCommand.js +100 -0
- package/dist/commands/impl/SplitAtPlayheadCommand.js.map +1 -0
- package/dist/commands/impl/SplitRegionCommand.d.ts +22 -0
- package/dist/commands/impl/SplitRegionCommand.d.ts.map +1 -0
- package/dist/commands/impl/SplitRegionCommand.js +69 -0
- package/dist/commands/impl/SplitRegionCommand.js.map +1 -0
- package/dist/commands/impl/StripSilenceCommand.d.ts +26 -0
- package/dist/commands/impl/StripSilenceCommand.d.ts.map +1 -0
- package/dist/commands/impl/StripSilenceCommand.js +83 -0
- package/dist/commands/impl/StripSilenceCommand.js.map +1 -0
- package/dist/commands/impl/TimeStretchRegionCommand.d.ts +28 -0
- package/dist/commands/impl/TimeStretchRegionCommand.d.ts.map +1 -0
- package/dist/commands/impl/TimeStretchRegionCommand.js +55 -0
- package/dist/commands/impl/TimeStretchRegionCommand.js.map +1 -0
- package/dist/commands/impl/ToggleLoopCommand.d.ts +12 -0
- package/dist/commands/impl/ToggleLoopCommand.d.ts.map +1 -0
- package/dist/commands/impl/ToggleLoopCommand.js +27 -0
- package/dist/commands/impl/ToggleLoopCommand.js.map +1 -0
- package/dist/commands/impl/TrimRegionCommand.d.ts +22 -0
- package/dist/commands/impl/TrimRegionCommand.d.ts.map +1 -0
- package/dist/commands/impl/TrimRegionCommand.js +92 -0
- package/dist/commands/impl/TrimRegionCommand.js.map +1 -0
- package/dist/commands/impl/UngroupRegionsCommand.d.ts +14 -0
- package/dist/commands/impl/UngroupRegionsCommand.d.ts.map +1 -0
- package/dist/commands/impl/UngroupRegionsCommand.js +28 -0
- package/dist/commands/impl/UngroupRegionsCommand.js.map +1 -0
- package/dist/commands/types.d.ts +1895 -0
- package/dist/commands/types.d.ts.map +1 -0
- package/dist/commands/types.js +1338 -0
- package/dist/commands/types.js.map +1 -0
- package/dist/domain/ABComparison.d.ts +33 -0
- package/dist/domain/ABComparison.d.ts.map +1 -0
- package/dist/domain/ABComparison.js +78 -0
- package/dist/domain/ABComparison.js.map +1 -0
- package/dist/domain/CDMarker.d.ts +36 -0
- package/dist/domain/CDMarker.d.ts.map +1 -0
- package/dist/domain/CDMarker.js +78 -0
- package/dist/domain/CDMarker.js.map +1 -0
- package/dist/domain/ClockMode.d.ts +19 -0
- package/dist/domain/ClockMode.d.ts.map +1 -0
- package/dist/domain/ClockMode.js +65 -0
- package/dist/domain/ClockMode.js.map +1 -0
- package/dist/domain/CrossfadeEngine.d.ts +27 -0
- package/dist/domain/CrossfadeEngine.d.ts.map +1 -0
- package/dist/domain/CrossfadeEngine.js +47 -0
- package/dist/domain/CrossfadeEngine.js.map +1 -0
- package/dist/domain/DragManager.d.ts +21 -0
- package/dist/domain/DragManager.d.ts.map +1 -0
- package/dist/domain/DragManager.js +37 -0
- package/dist/domain/DragManager.js.map +1 -0
- package/dist/domain/EditMode.d.ts +15 -0
- package/dist/domain/EditMode.d.ts.map +1 -0
- package/dist/domain/EditMode.js +16 -0
- package/dist/domain/EditMode.js.map +1 -0
- package/dist/domain/ExportConfig.d.ts +55 -0
- package/dist/domain/ExportConfig.d.ts.map +1 -0
- package/dist/domain/ExportConfig.js +115 -0
- package/dist/domain/ExportConfig.js.map +1 -0
- package/dist/domain/ExportStatus.d.ts +46 -0
- package/dist/domain/ExportStatus.d.ts.map +1 -0
- package/dist/domain/ExportStatus.js +113 -0
- package/dist/domain/ExportStatus.js.map +1 -0
- package/dist/domain/FadeEnvelope.d.ts +31 -0
- package/dist/domain/FadeEnvelope.d.ts.map +1 -0
- package/dist/domain/FadeEnvelope.js +44 -0
- package/dist/domain/FadeEnvelope.js.map +1 -0
- package/dist/domain/GridSettings.d.ts +99 -0
- package/dist/domain/GridSettings.d.ts.map +1 -0
- package/dist/domain/GridSettings.js +213 -0
- package/dist/domain/GridSettings.js.map +1 -0
- package/dist/domain/Marker.d.ts +31 -0
- package/dist/domain/Marker.d.ts.map +1 -0
- package/dist/domain/Marker.js +56 -0
- package/dist/domain/Marker.js.map +1 -0
- package/dist/domain/MeterData.d.ts +26 -0
- package/dist/domain/MeterData.d.ts.map +1 -0
- package/dist/domain/MeterData.js +2 -0
- package/dist/domain/MeterData.js.map +1 -0
- package/dist/domain/MeterType.d.ts +22 -0
- package/dist/domain/MeterType.d.ts.map +1 -0
- package/dist/domain/MeterType.js +24 -0
- package/dist/domain/MeterType.js.map +1 -0
- package/dist/domain/MidiClip.d.ts +56 -0
- package/dist/domain/MidiClip.d.ts.map +1 -0
- package/dist/domain/MidiClip.js +119 -0
- package/dist/domain/MidiClip.js.map +1 -0
- package/dist/domain/MidiNote.d.ts +38 -0
- package/dist/domain/MidiNote.d.ts.map +1 -0
- package/dist/domain/MidiNote.js +82 -0
- package/dist/domain/MidiNote.js.map +1 -0
- package/dist/domain/MidiRegion.d.ts +65 -0
- package/dist/domain/MidiRegion.d.ts.map +1 -0
- package/dist/domain/MidiRegion.js +123 -0
- package/dist/domain/MidiRegion.js.map +1 -0
- package/dist/domain/MixerScene.d.ts +62 -0
- package/dist/domain/MixerScene.d.ts.map +1 -0
- package/dist/domain/MixerScene.js +131 -0
- package/dist/domain/MixerScene.js.map +1 -0
- package/dist/domain/MonitorMode.d.ts +15 -0
- package/dist/domain/MonitorMode.d.ts.map +1 -0
- package/dist/domain/MonitorMode.js +16 -0
- package/dist/domain/MonitorMode.js.map +1 -0
- package/dist/domain/MouseMode.d.ts +25 -0
- package/dist/domain/MouseMode.d.ts.map +1 -0
- package/dist/domain/MouseMode.js +26 -0
- package/dist/domain/MouseMode.js.map +1 -0
- package/dist/domain/OverlapType.d.ts +18 -0
- package/dist/domain/OverlapType.d.ts.map +1 -0
- package/dist/domain/OverlapType.js +19 -0
- package/dist/domain/OverlapType.js.map +1 -0
- package/dist/domain/Playlist.d.ts +83 -0
- package/dist/domain/Playlist.d.ts.map +1 -0
- package/dist/domain/Playlist.js +205 -0
- package/dist/domain/Playlist.js.map +1 -0
- package/dist/domain/Range.d.ts +35 -0
- package/dist/domain/Range.d.ts.map +1 -0
- package/dist/domain/Range.js +59 -0
- package/dist/domain/Range.js.map +1 -0
- package/dist/domain/RecordMode.d.ts +13 -0
- package/dist/domain/RecordMode.d.ts.map +1 -0
- package/dist/domain/RecordMode.js +14 -0
- package/dist/domain/RecordMode.js.map +1 -0
- package/dist/domain/Region.d.ts +96 -0
- package/dist/domain/Region.d.ts.map +1 -0
- package/dist/domain/Region.js +219 -0
- package/dist/domain/Region.js.map +1 -0
- package/dist/domain/RegionClipboard.d.ts +56 -0
- package/dist/domain/RegionClipboard.d.ts.map +1 -0
- package/dist/domain/RegionClipboard.js +70 -0
- package/dist/domain/RegionClipboard.js.map +1 -0
- package/dist/domain/RegionGroup.d.ts +16 -0
- package/dist/domain/RegionGroup.d.ts.map +1 -0
- package/dist/domain/RegionGroup.js +36 -0
- package/dist/domain/RegionGroup.js.map +1 -0
- package/dist/domain/Route.d.ts +104 -0
- package/dist/domain/Route.d.ts.map +1 -0
- package/dist/domain/Route.js +192 -0
- package/dist/domain/Route.js.map +1 -0
- package/dist/domain/RulerType.d.ts +21 -0
- package/dist/domain/RulerType.d.ts.map +1 -0
- package/dist/domain/RulerType.js +22 -0
- package/dist/domain/RulerType.js.map +1 -0
- package/dist/domain/SelectionHistory.d.ts +38 -0
- package/dist/domain/SelectionHistory.d.ts.map +1 -0
- package/dist/domain/SelectionHistory.js +70 -0
- package/dist/domain/SelectionHistory.js.map +1 -0
- package/dist/domain/SendBus.d.ts +28 -0
- package/dist/domain/SendBus.d.ts.map +1 -0
- package/dist/domain/SendBus.js +43 -0
- package/dist/domain/SendBus.js.map +1 -0
- package/dist/domain/Session.d.ts +347 -0
- package/dist/domain/Session.d.ts.map +1 -0
- package/dist/domain/Session.js +965 -0
- package/dist/domain/Session.js.map +1 -0
- package/dist/domain/SidechainConfig.d.ts +51 -0
- package/dist/domain/SidechainConfig.d.ts.map +1 -0
- package/dist/domain/SidechainConfig.js +84 -0
- package/dist/domain/SidechainConfig.js.map +1 -0
- package/dist/domain/Source.d.ts +11 -0
- package/dist/domain/Source.d.ts.map +1 -0
- package/dist/domain/Source.js +11 -0
- package/dist/domain/Source.js.map +1 -0
- package/dist/domain/Take.d.ts +66 -0
- package/dist/domain/Take.d.ts.map +1 -0
- package/dist/domain/Take.js +106 -0
- package/dist/domain/Take.js.map +1 -0
- package/dist/domain/Track.d.ts +58 -0
- package/dist/domain/Track.d.ts.map +1 -0
- package/dist/domain/Track.js +124 -0
- package/dist/domain/Track.js.map +1 -0
- package/dist/domain/TrackGroup.d.ts +39 -0
- package/dist/domain/TrackGroup.d.ts.map +1 -0
- package/dist/domain/TrackGroup.js +86 -0
- package/dist/domain/TrackGroup.js.map +1 -0
- package/dist/domain/TransportFSM.d.ts +188 -0
- package/dist/domain/TransportFSM.d.ts.map +1 -0
- package/dist/domain/TransportFSM.js +412 -0
- package/dist/domain/TransportFSM.js.map +1 -0
- package/dist/domain/TransportMode.d.ts +23 -0
- package/dist/domain/TransportMode.d.ts.map +1 -0
- package/dist/domain/TransportMode.js +38 -0
- package/dist/domain/TransportMode.js.map +1 -0
- package/dist/domain/VCATrack.d.ts +48 -0
- package/dist/domain/VCATrack.d.ts.map +1 -0
- package/dist/domain/VCATrack.js +85 -0
- package/dist/domain/VCATrack.js.map +1 -0
- package/dist/domain/ZoomFocus.d.ts +21 -0
- package/dist/domain/ZoomFocus.d.ts.map +1 -0
- package/dist/domain/ZoomFocus.js +22 -0
- package/dist/domain/ZoomFocus.js.map +1 -0
- package/dist/domain/index.d.ts +11 -0
- package/dist/domain/index.d.ts.map +1 -0
- package/dist/domain/index.js +12 -0
- package/dist/domain/index.js.map +1 -0
- package/dist/domain/temporal/TempoMap.d.ts +68 -0
- package/dist/domain/temporal/TempoMap.d.ts.map +1 -0
- package/dist/domain/temporal/TempoMap.js +151 -0
- package/dist/domain/temporal/TempoMap.js.map +1 -0
- package/dist/domain/temporal/types.d.ts +34 -0
- package/dist/domain/temporal/types.d.ts.map +1 -0
- package/dist/domain/temporal/types.js +54 -0
- package/dist/domain/temporal/types.js.map +1 -0
- package/dist/domain/types.d.ts +26 -0
- package/dist/domain/types.d.ts.map +1 -0
- package/dist/domain/types.js +11 -0
- package/dist/domain/types.js.map +1 -0
- package/dist/errors/DAWErrors.d.ts +107 -0
- package/dist/errors/DAWErrors.d.ts.map +1 -0
- package/dist/errors/DAWErrors.js +159 -0
- package/dist/errors/DAWErrors.js.map +1 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +59 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/Signal.d.ts +28 -0
- package/dist/lib/Signal.d.ts.map +1 -0
- package/dist/lib/Signal.js +34 -0
- package/dist/lib/Signal.js.map +1 -0
- package/dist/midi/MidiInput.d.ts +61 -0
- package/dist/midi/MidiInput.d.ts.map +1 -0
- package/dist/midi/MidiInput.js +153 -0
- package/dist/midi/MidiInput.js.map +1 -0
- package/dist/plugins/AutomatableParameter.d.ts +28 -0
- package/dist/plugins/AutomatableParameter.d.ts.map +1 -0
- package/dist/plugins/AutomatableParameter.js +89 -0
- package/dist/plugins/AutomatableParameter.js.map +1 -0
- package/dist/plugins/Plugin.d.ts +31 -0
- package/dist/plugins/Plugin.d.ts.map +1 -0
- package/dist/plugins/Plugin.js +7 -0
- package/dist/plugins/Plugin.js.map +1 -0
- package/dist/plugins/PluginManager.d.ts +15 -0
- package/dist/plugins/PluginManager.d.ts.map +1 -0
- package/dist/plugins/PluginManager.js +199 -0
- package/dist/plugins/PluginManager.js.map +1 -0
- package/dist/plugins/PluginPreset.d.ts +50 -0
- package/dist/plugins/PluginPreset.d.ts.map +1 -0
- package/dist/plugins/PluginPreset.js +292 -0
- package/dist/plugins/PluginPreset.js.map +1 -0
- package/dist/plugins/impl/AutoPanPlugin.d.ts +28 -0
- package/dist/plugins/impl/AutoPanPlugin.d.ts.map +1 -0
- package/dist/plugins/impl/AutoPanPlugin.js +48 -0
- package/dist/plugins/impl/AutoPanPlugin.js.map +1 -0
- package/dist/plugins/impl/ConvolutionReverbPlugin.d.ts +35 -0
- package/dist/plugins/impl/ConvolutionReverbPlugin.d.ts.map +1 -0
- package/dist/plugins/impl/ConvolutionReverbPlugin.js +65 -0
- package/dist/plugins/impl/ConvolutionReverbPlugin.js.map +1 -0
- package/dist/plugins/impl/DeEsserPlugin.d.ts +35 -0
- package/dist/plugins/impl/DeEsserPlugin.d.ts.map +1 -0
- package/dist/plugins/impl/DeEsserPlugin.js +87 -0
- package/dist/plugins/impl/DeEsserPlugin.js.map +1 -0
- package/dist/plugins/impl/ExpanderPlugin.d.ts +42 -0
- package/dist/plugins/impl/ExpanderPlugin.d.ts.map +1 -0
- package/dist/plugins/impl/ExpanderPlugin.js +105 -0
- package/dist/plugins/impl/ExpanderPlugin.js.map +1 -0
- package/dist/plugins/impl/GenericPlugin.d.ts +20 -0
- package/dist/plugins/impl/GenericPlugin.d.ts.map +1 -0
- package/dist/plugins/impl/GenericPlugin.js +37 -0
- package/dist/plugins/impl/GenericPlugin.js.map +1 -0
- package/dist/plugins/impl/MultibandCompressorPlugin.d.ts +33 -0
- package/dist/plugins/impl/MultibandCompressorPlugin.d.ts.map +1 -0
- package/dist/plugins/impl/MultibandCompressorPlugin.js +169 -0
- package/dist/plugins/impl/MultibandCompressorPlugin.js.map +1 -0
- package/dist/plugins/impl/ParametricEQPlugin.d.ts +25 -0
- package/dist/plugins/impl/ParametricEQPlugin.d.ts.map +1 -0
- package/dist/plugins/impl/ParametricEQPlugin.js +79 -0
- package/dist/plugins/impl/ParametricEQPlugin.js.map +1 -0
- package/dist/plugins/impl/PhaserPlugin.d.ts +29 -0
- package/dist/plugins/impl/PhaserPlugin.d.ts.map +1 -0
- package/dist/plugins/impl/PhaserPlugin.js +50 -0
- package/dist/plugins/impl/PhaserPlugin.js.map +1 -0
- package/dist/plugins/impl/SyncDelayPlugin.d.ts +52 -0
- package/dist/plugins/impl/SyncDelayPlugin.d.ts.map +1 -0
- package/dist/plugins/impl/SyncDelayPlugin.js +95 -0
- package/dist/plugins/impl/SyncDelayPlugin.js.map +1 -0
- package/dist/plugins/impl/TapeSaturationPlugin.d.ts +35 -0
- package/dist/plugins/impl/TapeSaturationPlugin.d.ts.map +1 -0
- package/dist/plugins/impl/TapeSaturationPlugin.js +87 -0
- package/dist/plugins/impl/TapeSaturationPlugin.js.map +1 -0
- package/dist/plugins/impl/TremoloPlugin.d.ts +29 -0
- package/dist/plugins/impl/TremoloPlugin.d.ts.map +1 -0
- package/dist/plugins/impl/TremoloPlugin.js +50 -0
- package/dist/plugins/impl/TremoloPlugin.js.map +1 -0
- package/dist/plugins/impl/VibratoPlugin.d.ts +28 -0
- package/dist/plugins/impl/VibratoPlugin.d.ts.map +1 -0
- package/dist/plugins/impl/VibratoPlugin.js +48 -0
- package/dist/plugins/impl/VibratoPlugin.js.map +1 -0
- package/dist/preferences/KeyBindings.d.ts +38 -0
- package/dist/preferences/KeyBindings.d.ts.map +1 -0
- package/dist/preferences/KeyBindings.js +83 -0
- package/dist/preferences/KeyBindings.js.map +1 -0
- package/dist/preferences/Preferences.d.ts +49 -0
- package/dist/preferences/Preferences.d.ts.map +1 -0
- package/dist/preferences/Preferences.js +93 -0
- package/dist/preferences/Preferences.js.map +1 -0
- package/dist/preferences/index.d.ts +4 -0
- package/dist/preferences/index.d.ts.map +1 -0
- package/dist/preferences/index.js +3 -0
- package/dist/preferences/index.js.map +1 -0
- package/dist/processing/GainProcessor.d.ts +10 -0
- package/dist/processing/GainProcessor.d.ts.map +1 -0
- package/dist/processing/GainProcessor.js +21 -0
- package/dist/processing/GainProcessor.js.map +1 -0
- package/dist/processing/IO.d.ts +15 -0
- package/dist/processing/IO.d.ts.map +1 -0
- package/dist/processing/IO.js +34 -0
- package/dist/processing/IO.js.map +1 -0
- package/dist/processing/MeterProcessor.d.ts +101 -0
- package/dist/processing/MeterProcessor.d.ts.map +1 -0
- package/dist/processing/MeterProcessor.js +195 -0
- package/dist/processing/MeterProcessor.js.map +1 -0
- package/dist/processing/PanProcessor.d.ts +15 -0
- package/dist/processing/PanProcessor.d.ts.map +1 -0
- package/dist/processing/PanProcessor.js +35 -0
- package/dist/processing/PanProcessor.js.map +1 -0
- package/dist/processing/PluginInsert.d.ts +9 -0
- package/dist/processing/PluginInsert.d.ts.map +1 -0
- package/dist/processing/PluginInsert.js +16 -0
- package/dist/processing/PluginInsert.js.map +1 -0
- package/dist/processing/PolarityProcessor.d.ts +25 -0
- package/dist/processing/PolarityProcessor.d.ts.map +1 -0
- package/dist/processing/PolarityProcessor.js +35 -0
- package/dist/processing/PolarityProcessor.js.map +1 -0
- package/dist/processing/Processor.d.ts +31 -0
- package/dist/processing/Processor.d.ts.map +1 -0
- package/dist/processing/Processor.js +45 -0
- package/dist/processing/Processor.js.map +1 -0
- package/dist/processing/SendProcessor.d.ts +55 -0
- package/dist/processing/SendProcessor.d.ts.map +1 -0
- package/dist/processing/SendProcessor.js +97 -0
- package/dist/processing/SendProcessor.js.map +1 -0
- package/dist/storage/AutoSave.d.ts +48 -0
- package/dist/storage/AutoSave.d.ts.map +1 -0
- package/dist/storage/AutoSave.js +108 -0
- package/dist/storage/AutoSave.js.map +1 -0
- package/dist/storage/SessionStorage.d.ts +74 -0
- package/dist/storage/SessionStorage.d.ts.map +1 -0
- package/dist/storage/SessionStorage.js +192 -0
- package/dist/storage/SessionStorage.js.map +1 -0
- package/dist/storage/SessionTemplate.d.ts +22 -0
- package/dist/storage/SessionTemplate.d.ts.map +1 -0
- package/dist/storage/SessionTemplate.js +77 -0
- package/dist/storage/SessionTemplate.js.map +1 -0
- package/dist/utils/AudioBufferToWav.d.ts +28 -0
- package/dist/utils/AudioBufferToWav.d.ts.map +1 -0
- package/dist/utils/AudioBufferToWav.js +110 -0
- package/dist/utils/AudioBufferToWav.js.map +1 -0
- package/dist/utils/DitherProcessor.d.ts +41 -0
- package/dist/utils/DitherProcessor.d.ts.map +1 -0
- package/dist/utils/DitherProcessor.js +78 -0
- package/dist/utils/DitherProcessor.js.map +1 -0
- package/dist/utils/FlacEncoder.d.ts +22 -0
- package/dist/utils/FlacEncoder.d.ts.map +1 -0
- package/dist/utils/FlacEncoder.js +196 -0
- package/dist/utils/FlacEncoder.js.map +1 -0
- package/dist/utils/OggEncoder.d.ts +40 -0
- package/dist/utils/OggEncoder.d.ts.map +1 -0
- package/dist/utils/OggEncoder.js +183 -0
- package/dist/utils/OggEncoder.js.map +1 -0
- package/package.json +67 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 drop.ai
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
# @drop-ai/core
|
|
2
|
+
|
|
3
|
+
drop.ai DAW의 헤드리스 코어 라이브러리. 오디오 편집 도메인 로직, 커맨드 시스템, 오토메이션, 플러그인, MIDI 등 UI 독립적인 모든 기능을 포함한다.
|
|
4
|
+
|
|
5
|
+
## 왜 분리했는가
|
|
6
|
+
|
|
7
|
+
기존에는 `src/core/`에 있던 코어 로직이 Next.js 앱과 같은 디렉토리에 섞여 있었다. 문제점:
|
|
8
|
+
|
|
9
|
+
- **Tone.js 커플링**: `AudioEngine`이 `ToneAudioProvider`를 직접 import하여 브라우저 없이 사용 불가
|
|
10
|
+
- **Zustand 커플링**: `EditorHandler`, `defaultActions`, `dawQueryTool`이 `useDAWStore`를 직접 import
|
|
11
|
+
- **테스트 격리 불가**: Node.js CLI나 headless 환경에서 코어 로직만 테스트하기 어려움
|
|
12
|
+
- **재사용 불가**: 다른 프레임워크(Electron, React Native 등)에서 코어 로직 사용 불가
|
|
13
|
+
|
|
14
|
+
분리 후:
|
|
15
|
+
|
|
16
|
+
- `@drop-ai/core`는 **브라우저/프레임워크 의존성 제로**
|
|
17
|
+
- Node.js CLI, 테스트, 다른 프레임워크에서 독립적으로 사용 가능
|
|
18
|
+
- 향후 npm publish 가능
|
|
19
|
+
|
|
20
|
+
## 아키텍처
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
┌─────────────────────────────────────────────────────────┐
|
|
24
|
+
│ Next.js App (src/) │
|
|
25
|
+
│ ┌──────────┐ ┌──────────────┐ ┌──────────────────────┐ │
|
|
26
|
+
│ │Components│ │ Stores │ │ App-level modules │ │
|
|
27
|
+
│ │(React) │ │ (Zustand) │ │ - ToneAudioProvider │ │
|
|
28
|
+
│ │ │ │ useDAWStore │ │ - EditorHandler │ │
|
|
29
|
+
│ │ │ │ │ │ - defaultActions │ │
|
|
30
|
+
│ │ │ │ │ │ - dawQueryTool │ │
|
|
31
|
+
│ └────┬─────┘ └──────┬───────┘ └──────────┬───────────┘ │
|
|
32
|
+
│ │ │ │ │
|
|
33
|
+
│ └──────────────┼─────────────────────┘ │
|
|
34
|
+
│ │ │
|
|
35
|
+
├──────────────────────┼───────────────────────────────────┤
|
|
36
|
+
│ ▼ │
|
|
37
|
+
│ @drop-ai/core (packages/core/) │
|
|
38
|
+
│ ┌────────┐ ┌────────┐ ┌──────────┐ ┌────────────────┐ │
|
|
39
|
+
│ │Domain │ │Commands│ │Audio │ │Automation │ │
|
|
40
|
+
│ │Session │ │Executor│ │Engine │ │List, Curve, │ │
|
|
41
|
+
│ │Track │ │History │ │Backend(I)│ │Mode │ │
|
|
42
|
+
│ │Region │ │55 Impls│ │Exporter │ └────────────────┘ │
|
|
43
|
+
│ │Playlist│ │15 Hdlrs│ │Meter │ ┌────────────────┐ │
|
|
44
|
+
│ │Source │ └────────┘ └──────────┘ │Plugins │ │
|
|
45
|
+
│ │Range │ ┌────────┐ ┌──────────┐ │EQ, Reverb, │ │
|
|
46
|
+
│ │Marker │ │Lib │ │Processing│ │Compressor, ... │ │
|
|
47
|
+
│ │MIDI │ │Signal │ │Gain, Pan │ └────────────────┘ │
|
|
48
|
+
│ └────────┘ └────────┘ └──────────┘ │
|
|
49
|
+
└─────────────────────────────────────────────────────────┘
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## 모듈 구조 (193 파일)
|
|
53
|
+
|
|
54
|
+
### `domain/` — 도메인 모델 (42 파일)
|
|
55
|
+
|
|
56
|
+
DAW의 핵심 데이터 구조. Ardour의 도메인 모델을 참고하여 설계됨.
|
|
57
|
+
|
|
58
|
+
| 클래스 | 설명 |
|
|
59
|
+
|--------|------|
|
|
60
|
+
| `Session` | 프로젝트 루트. 트랙, 소스, 마커, 레인지, 템포맵 관리 |
|
|
61
|
+
| `Track` | 오디오/MIDI/Bus/AUX 트랙. Route(IO + 프로세서 체인) 포함 |
|
|
62
|
+
| `Region` | 타임라인 위의 오디오 구간. start, length, sourceStart, fades |
|
|
63
|
+
| `Playlist` | 트랙 내 Region 컬렉션. 레이어, 크로스페이드 지원 |
|
|
64
|
+
| `Source` | 오디오 파일 참조. URL, duration, sampleRate |
|
|
65
|
+
| `Range` | 루프/펀치/선택 범위 (start, end) |
|
|
66
|
+
| `Marker` | 타임라인 마커 (위치 + 이름) |
|
|
67
|
+
| `MidiNote` / `MidiRegion` | MIDI 데이터 |
|
|
68
|
+
| `SendBus` | 센드 버스 (pre/post fader) |
|
|
69
|
+
| `GridSettings` | 그리드 타입, 스냅 모드 |
|
|
70
|
+
| `TempoMap` | BPM 변경 이벤트 관리 |
|
|
71
|
+
| `CrossfadeEngine` | 리전 겹침 시 자동 크로스페이드 계산 |
|
|
72
|
+
| `TransportFSM` | 재생/정지/녹음 상태 머신 |
|
|
73
|
+
| `MixerScene` | 믹서 스냅샷 저장/불러오기 |
|
|
74
|
+
|
|
75
|
+
모든 도메인 객체는 `Signal` 기반 이벤트를 발행한다:
|
|
76
|
+
```typescript
|
|
77
|
+
session.trackAdded.connect((track: Track) => { ... });
|
|
78
|
+
session.tempoChanged.connect((bpm: number) => { ... });
|
|
79
|
+
track.muteChanged.connect((muted: boolean) => { ... });
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### `commands/` — 커맨드 시스템 (62 파일)
|
|
83
|
+
|
|
84
|
+
Undo/Redo 지원 커맨드 패턴 구현.
|
|
85
|
+
|
|
86
|
+
- **`CommandExecutor`**: Zod 스키마 검증 → 핸들러 라우팅 → 실행. 싱글톤.
|
|
87
|
+
- **`CommandHistory`**: Undo/Redo 스택 관리. depth 설정 가능.
|
|
88
|
+
- **15개 핸들러**: Transport, Track, Region, Range, Automation, Export, IO, SendBus, Session, Marker, Midi, MixerScene, TrackGroup, History + 앱에서 등록하는 EditorHandler
|
|
89
|
+
- **55개 커맨드 구현체**: AddTrack, MoveRegion, SplitAtPlayhead, SetTrackVolume 등
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
// 커맨드 실행
|
|
93
|
+
await CommandExecutor.getInstance().execute({
|
|
94
|
+
type: CommandType.ADD_TRACK,
|
|
95
|
+
payload: { name: 'Vocals', trackType: 'audio' }
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
// 앱에서 커스텀 핸들러 등록
|
|
99
|
+
CommandExecutor.getInstance().registerHandler(new EditorHandler());
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### `audio/` — 오디오 엔진 (10 파일)
|
|
103
|
+
|
|
104
|
+
- **`AudioEngine`**: 세션과 백엔드를 연결하는 중앙 컨트롤러. 싱글톤.
|
|
105
|
+
- 트랜스포트 (play/stop/pause/seek)
|
|
106
|
+
- 녹음 (audio + MIDI, 펀치, 루프 레코딩)
|
|
107
|
+
- 미터링 (peak/RMS/LUFS)
|
|
108
|
+
- 프로세서 체인 동기화
|
|
109
|
+
- **`AudioProvider`**: 인터페이스. 실제 오디오 I/O 추상화.
|
|
110
|
+
- 앱: `ToneAudioProvider` (Tone.js + Web Audio API)
|
|
111
|
+
- CLI: `HeadlessAudioProvider`
|
|
112
|
+
- 테스트: `MockAudioProvider`
|
|
113
|
+
- **`OfflineExporter`**: WAV/MP3/OGG/FLAC 오프라인 렌더링
|
|
114
|
+
- **`PlaylistEngine`**: 샘플 정확도 리전 렌더링 (AudioWorklet용)
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
// 백엔드 주입 (Dependency Injection)
|
|
118
|
+
const engine = AudioEngine.getInstance(new ToneAudioProvider());
|
|
119
|
+
|
|
120
|
+
// 또는 headless 환경
|
|
121
|
+
const engine = AudioEngine.getInstance(new HeadlessAudioProvider());
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### `automation/` — 오토메이션 (6 파일)
|
|
125
|
+
|
|
126
|
+
| 클래스 | 설명 |
|
|
127
|
+
|--------|------|
|
|
128
|
+
| `AutomationList` | 파라미터별 오토메이션 포인트 컬렉션 |
|
|
129
|
+
| `AutomationCurve` | 보간 (linear, exponential, s-curve) |
|
|
130
|
+
| `AutomationMode` | Read, Write, Touch, Latch |
|
|
131
|
+
| `PointThinning` | 실시간 녹음 시 포인트 간소화 |
|
|
132
|
+
| `ParameterDescriptor` | 파라미터 메타데이터 (min, max, default) |
|
|
133
|
+
|
|
134
|
+
### `plugins/` — 플러그인 시스템 (16 파일)
|
|
135
|
+
|
|
136
|
+
내장 오디오 플러그인:
|
|
137
|
+
|
|
138
|
+
| 플러그인 | 설명 |
|
|
139
|
+
|----------|------|
|
|
140
|
+
| `ParametricEQPlugin` | 6밴드 파라메트릭 EQ |
|
|
141
|
+
| `MultibandCompressorPlugin` | 멀티밴드 컴프레서 |
|
|
142
|
+
| `ConvolutionReverbPlugin` | 컨볼루션 리버브 |
|
|
143
|
+
| `SyncDelayPlugin` | BPM 동기 딜레이 |
|
|
144
|
+
| `TapeSaturationPlugin` | 테이프 새추레이션 |
|
|
145
|
+
| `DeEsserPlugin` | 디에서 |
|
|
146
|
+
| `ExpanderPlugin` | 익스팬더/게이트 |
|
|
147
|
+
| `PhaserPlugin` | 페이저 |
|
|
148
|
+
| `TremoloPlugin` | 트레몰로 |
|
|
149
|
+
| `VibratoPlugin` | 비브라토 |
|
|
150
|
+
| `AutoPanPlugin` | 오토 팬 |
|
|
151
|
+
|
|
152
|
+
`PluginManager`로 등록/생성:
|
|
153
|
+
```typescript
|
|
154
|
+
const manager = PluginManager.getInstance();
|
|
155
|
+
const eq = manager.createPlugin('internal-parametric-eq');
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### `processing/` — 신호 처리 체인 (8 파일)
|
|
159
|
+
|
|
160
|
+
Route(트랙 당 프로세서 체인)를 구성하는 프로세서들:
|
|
161
|
+
|
|
162
|
+
- `GainProcessor` (Fader / Trim)
|
|
163
|
+
- `PanProcessor` (스테레오 패닝 + 폭 조절)
|
|
164
|
+
- `PolarityProcessor` (위상 반전)
|
|
165
|
+
- `SendProcessor` (Pre/Post fader 센드)
|
|
166
|
+
- `MeterProcessor` (피크/RMS 미터링)
|
|
167
|
+
- `PluginInsert` (플러그인 삽입 슬롯)
|
|
168
|
+
|
|
169
|
+
### `lib/` — 유틸리티
|
|
170
|
+
|
|
171
|
+
- **`Signal<T>`**: 타입 안전 이벤트 시스템. Qt의 Signal/Slot 패턴.
|
|
172
|
+
|
|
173
|
+
```typescript
|
|
174
|
+
const signal = new Signal<number>();
|
|
175
|
+
const sub = signal.connect((value) => console.log(value));
|
|
176
|
+
signal.emit(42);
|
|
177
|
+
sub.dispose(); // 구독 해제
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### `actions/` — 액션 레지스트리 (2 파일)
|
|
181
|
+
|
|
182
|
+
키보드 단축키 ↔ 커맨드 매핑 시스템.
|
|
183
|
+
|
|
184
|
+
- `ActionRegistry`: 액션 등록/조회/실행
|
|
185
|
+
- `ActionDefinition`: id, label, category, defaultKey, commandFactory
|
|
186
|
+
|
|
187
|
+
```typescript
|
|
188
|
+
const registry = ActionRegistry.getInstance();
|
|
189
|
+
registry.registerDefaults(defaultActions); // 앱에서 등록
|
|
190
|
+
await registry.execute('transport.togglePlay');
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### `preferences/` — 설정 (3 파일)
|
|
194
|
+
|
|
195
|
+
- `Preferences`: 싱글톤. audioBufferSize, sampleRate, theme, gridSubdivision 등
|
|
196
|
+
- `KeyBindings`: 커스텀 키 바인딩 오버라이드
|
|
197
|
+
|
|
198
|
+
### `storage/` — 세션 저장 (3 파일)
|
|
199
|
+
|
|
200
|
+
- `SessionStorage`: IndexedDB/localStorage 기반 세션 저장/불러오기
|
|
201
|
+
- `AutoSave`: 주기적 자동 저장
|
|
202
|
+
- `SessionTemplate`: 새 세션 템플릿
|
|
203
|
+
|
|
204
|
+
### `ai/` — AI 에이전트 (5 파일)
|
|
205
|
+
|
|
206
|
+
- `DAWAgent`: LLM 기반 DAW 제어 에이전트
|
|
207
|
+
- `dawCommandTool`: AI가 커맨드를 실행하는 도구
|
|
208
|
+
- `dawSystemPrompt`: DAW 컨텍스트 시스템 프롬프트
|
|
209
|
+
|
|
210
|
+
## 앱에서의 사용법
|
|
211
|
+
|
|
212
|
+
### 부트스트랩 (useDAWStore.init)
|
|
213
|
+
|
|
214
|
+
```typescript
|
|
215
|
+
import { AudioEngine } from '@drop-ai/core/audio/AudioEngine';
|
|
216
|
+
import { CommandExecutor } from '@drop-ai/core/commands/CommandExecutor';
|
|
217
|
+
import { ActionRegistry } from '@drop-ai/core/actions/ActionRegistry';
|
|
218
|
+
import { ToneAudioProvider } from '../audio/ToneAudioProvider';
|
|
219
|
+
import { EditorHandler } from '../app-commands/EditorHandler';
|
|
220
|
+
import { defaultActions } from '../app-actions/defaultActions';
|
|
221
|
+
|
|
222
|
+
// 1. 오디오 백엔드 주입
|
|
223
|
+
AudioEngine.getInstance(new ToneAudioProvider());
|
|
224
|
+
|
|
225
|
+
// 2. 앱 전용 커맨드 핸들러 등록
|
|
226
|
+
CommandExecutor.getInstance().registerHandler(new EditorHandler());
|
|
227
|
+
|
|
228
|
+
// 3. 기본 액션(키보드 단축키) 등록
|
|
229
|
+
ActionRegistry.getInstance().registerDefaults(defaultActions);
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### Import 패턴
|
|
233
|
+
|
|
234
|
+
```typescript
|
|
235
|
+
// barrel import (주요 타입)
|
|
236
|
+
import { Session, Track, Region, AudioEngine } from '@drop-ai/core';
|
|
237
|
+
|
|
238
|
+
// deep import (특정 모듈)
|
|
239
|
+
import { AudioEngine } from '@drop-ai/core/audio/AudioEngine';
|
|
240
|
+
import { CommandType } from '@drop-ai/core/commands/types';
|
|
241
|
+
import { Signal } from '@drop-ai/core/lib/Signal';
|
|
242
|
+
import { TempoMap } from '@drop-ai/core/domain/temporal/TempoMap';
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## 앱 쪽에 남긴 파일 (7개)
|
|
246
|
+
|
|
247
|
+
브라우저/스토어 의존성 때문에 코어에 포함할 수 없는 파일들:
|
|
248
|
+
|
|
249
|
+
| 파일 | 위치 | 이유 |
|
|
250
|
+
|------|------|------|
|
|
251
|
+
| `ToneAudioProvider.ts` | `src/audio/` | Tone.js + browser AudioContext |
|
|
252
|
+
| `ToneTrack.ts` | `src/audio/` | Tone.js import |
|
|
253
|
+
| `TrackProcessor.ts` | `src/audio/worklets/` | AudioWorklet browser API |
|
|
254
|
+
| `TimeStretchProcessor.ts` | `src/audio/` | soundtouchjs + OfflineAudioContext |
|
|
255
|
+
| `defaultActions.ts` | `src/app-actions/` | useDAWStore import |
|
|
256
|
+
| `EditorHandler.ts` | `src/app-commands/` | useDAWStore import |
|
|
257
|
+
| `dawQueryTool.ts` | `src/app-ai/` | useDAWStore import |
|
|
258
|
+
|
|
259
|
+
## 디커플링 요약
|
|
260
|
+
|
|
261
|
+
| 변경 | Before | After |
|
|
262
|
+
|------|--------|-------|
|
|
263
|
+
| `AudioEngine` | `ToneAudioProvider` 하드코딩 | 백엔드 주입 필수 (DI) |
|
|
264
|
+
| `CommandExecutor` | `EditorHandler` 내장 | `registerHandler()` API |
|
|
265
|
+
| `ActionRegistry` | `defaultActions` 자동 로드 | `registerDefaults()` API |
|
|
266
|
+
| `KeyBindings` / `Preferences` | `localStorage` 직접 접근 | `typeof localStorage` 가드 |
|
|
267
|
+
| `ExportHandler` | `document.createElement` 직접 호출 | `typeof document` 가드 |
|
|
268
|
+
| `ai/tools` | `dawQueryTool` 내장 | 앱에서 별도 관리 |
|
|
269
|
+
|
|
270
|
+
## 설정 파일
|
|
271
|
+
|
|
272
|
+
### pnpm-workspace.yaml
|
|
273
|
+
```yaml
|
|
274
|
+
packages:
|
|
275
|
+
- "packages/*"
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
### 루트 package.json (의존성)
|
|
279
|
+
```json
|
|
280
|
+
{
|
|
281
|
+
"dependencies": {
|
|
282
|
+
"@drop-ai/core": "workspace:*"
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
### 루트 tsconfig.json (paths)
|
|
288
|
+
```json
|
|
289
|
+
{
|
|
290
|
+
"paths": {
|
|
291
|
+
"@/*": ["./*"],
|
|
292
|
+
"@drop-ai/core": ["./packages/core/src"],
|
|
293
|
+
"@drop-ai/core/*": ["./packages/core/src/*"]
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
## 테스트
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
# 전체 단위 테스트 (308개)
|
|
302
|
+
pnpm test
|
|
303
|
+
|
|
304
|
+
# 코어 패키지 타입 체크
|
|
305
|
+
cd packages/core && npx tsc --noEmit
|
|
306
|
+
|
|
307
|
+
# 루트 프로젝트 타입 체크
|
|
308
|
+
npx tsc --noEmit
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
## 향후 계획
|
|
312
|
+
|
|
313
|
+
- [ ] `packages/core/` 빌드 파이프라인 (`tsc` → `dist/`)
|
|
314
|
+
- [ ] npm publish (`private: false`)
|
|
315
|
+
- [ ] Electron 앱에서 `@drop-ai/core` 재사용
|
|
316
|
+
- [ ] 코어 전용 단위 테스트 (`packages/core/test/`)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ActionDefinition, ActionId } from './types';
|
|
2
|
+
export declare class ActionRegistry {
|
|
3
|
+
private static instance;
|
|
4
|
+
private actions;
|
|
5
|
+
private keyMap;
|
|
6
|
+
private constructor();
|
|
7
|
+
static getInstance(): ActionRegistry;
|
|
8
|
+
registerDefaults(actions: ActionDefinition[]): void;
|
|
9
|
+
register(action: ActionDefinition): void;
|
|
10
|
+
getAction(id: ActionId): ActionDefinition | undefined;
|
|
11
|
+
getAllActions(): ActionDefinition[];
|
|
12
|
+
/**
|
|
13
|
+
* Resolve the effective key for an action, checking custom bindings first,
|
|
14
|
+
* then falling back to the default key.
|
|
15
|
+
*/
|
|
16
|
+
getEffectiveKey(actionId: ActionId): string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Look up an action by key string, checking custom bindings first,
|
|
19
|
+
* then falling back to default key map.
|
|
20
|
+
*/
|
|
21
|
+
getActionIdByKey(key: string): ActionId | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Rebuild the key map (useful after registering new actions or changing bindings).
|
|
24
|
+
*/
|
|
25
|
+
rebuildKeyMap(): void;
|
|
26
|
+
/**
|
|
27
|
+
* Get all actions grouped by category.
|
|
28
|
+
* Category is derived from action ID prefix (e.g., "transport.play" -> "Transport").
|
|
29
|
+
*/
|
|
30
|
+
getActionsByCategory(): Map<string, ActionDefinition[]>;
|
|
31
|
+
execute(id: ActionId, context?: Record<string, unknown>): Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=ActionRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionRegistry.d.ts","sourceRoot":"","sources":["../../src/actions/ActionRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAIrD,qBAAa,cAAc;IACvB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAiB;IACxC,OAAO,CAAC,OAAO,CAA8C;IAC7D,OAAO,CAAC,MAAM,CAAoC;IAElD,OAAO;WAEO,WAAW,IAAI,cAAc;IAOpC,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,EAAE,GAAG,IAAI;IAMnD,QAAQ,CAAC,MAAM,EAAE,gBAAgB;IAOjC,SAAS,CAAC,EAAE,EAAE,QAAQ,GAAG,gBAAgB,GAAG,SAAS;IAIrD,aAAa,IAAI,gBAAgB,EAAE;IAI1C;;;OAGG;IACI,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS;IAQ9D;;;OAGG;IACI,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS;IAc1D;;OAEG;IACI,aAAa,IAAI,IAAI;IAS5B;;;OAGG;IACI,oBAAoB,IAAI,GAAG,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAiBjD,OAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAUvF"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { CommandExecutor } from '../commands/CommandExecutor';
|
|
2
|
+
import { KeyBindings } from '../preferences/KeyBindings';
|
|
3
|
+
export class ActionRegistry {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.actions = new Map();
|
|
6
|
+
this.keyMap = new Map();
|
|
7
|
+
}
|
|
8
|
+
static getInstance() {
|
|
9
|
+
if (!ActionRegistry.instance) {
|
|
10
|
+
ActionRegistry.instance = new ActionRegistry();
|
|
11
|
+
}
|
|
12
|
+
return ActionRegistry.instance;
|
|
13
|
+
}
|
|
14
|
+
registerDefaults(actions) {
|
|
15
|
+
actions.forEach((action) => {
|
|
16
|
+
this.register(action);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
register(action) {
|
|
20
|
+
this.actions.set(action.id, action);
|
|
21
|
+
if (action.defaultKey) {
|
|
22
|
+
this.keyMap.set(action.defaultKey.toLowerCase(), action.id);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
getAction(id) {
|
|
26
|
+
return this.actions.get(id);
|
|
27
|
+
}
|
|
28
|
+
getAllActions() {
|
|
29
|
+
return Array.from(this.actions.values());
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Resolve the effective key for an action, checking custom bindings first,
|
|
33
|
+
* then falling back to the default key.
|
|
34
|
+
*/
|
|
35
|
+
getEffectiveKey(actionId) {
|
|
36
|
+
var _a;
|
|
37
|
+
const customBinding = KeyBindings.getInstance().getBinding(actionId);
|
|
38
|
+
if (customBinding !== undefined) {
|
|
39
|
+
return customBinding;
|
|
40
|
+
}
|
|
41
|
+
return (_a = this.actions.get(actionId)) === null || _a === void 0 ? void 0 : _a.defaultKey;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Look up an action by key string, checking custom bindings first,
|
|
45
|
+
* then falling back to default key map.
|
|
46
|
+
*/
|
|
47
|
+
getActionIdByKey(key) {
|
|
48
|
+
const lowerKey = key.toLowerCase();
|
|
49
|
+
// Check custom bindings first (they take priority)
|
|
50
|
+
const customBindings = KeyBindings.getInstance().getAllBindings();
|
|
51
|
+
for (const [actionId, keyCombo] of customBindings) {
|
|
52
|
+
if (keyCombo.toLowerCase() === lowerKey) {
|
|
53
|
+
return actionId;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return this.keyMap.get(lowerKey);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Rebuild the key map (useful after registering new actions or changing bindings).
|
|
60
|
+
*/
|
|
61
|
+
rebuildKeyMap() {
|
|
62
|
+
this.keyMap.clear();
|
|
63
|
+
for (const action of this.actions.values()) {
|
|
64
|
+
if (action.defaultKey) {
|
|
65
|
+
this.keyMap.set(action.defaultKey.toLowerCase(), action.id);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Get all actions grouped by category.
|
|
71
|
+
* Category is derived from action ID prefix (e.g., "transport.play" -> "Transport").
|
|
72
|
+
*/
|
|
73
|
+
getActionsByCategory() {
|
|
74
|
+
const categories = new Map();
|
|
75
|
+
for (const action of this.actions.values()) {
|
|
76
|
+
const dotIndex = action.id.indexOf('.');
|
|
77
|
+
const categoryKey = dotIndex >= 0 ? action.id.substring(0, dotIndex) : 'general';
|
|
78
|
+
const categoryLabel = categoryKey.charAt(0).toUpperCase() + categoryKey.slice(1);
|
|
79
|
+
if (!categories.has(categoryLabel)) {
|
|
80
|
+
categories.set(categoryLabel, []);
|
|
81
|
+
}
|
|
82
|
+
categories.get(categoryLabel).push(action);
|
|
83
|
+
}
|
|
84
|
+
return categories;
|
|
85
|
+
}
|
|
86
|
+
async execute(id, context) {
|
|
87
|
+
const action = this.actions.get(id);
|
|
88
|
+
if (!action) {
|
|
89
|
+
console.warn(`Action not found: ${id}`);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const command = action.commandFactory(context);
|
|
93
|
+
await CommandExecutor.getInstance().execute(command);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=ActionRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionRegistry.js","sourceRoot":"","sources":["../../src/actions/ActionRegistry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,MAAM,OAAO,cAAc;IAKvB;QAHQ,YAAO,GAAoC,IAAI,GAAG,EAAE,CAAC;QACrD,WAAM,GAA0B,IAAI,GAAG,EAAE,CAAC;IAE3B,CAAC;IAEjB,MAAM,CAAC,WAAW;QACrB,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;YAC3B,cAAc,CAAC,QAAQ,GAAG,IAAI,cAAc,EAAE,CAAC;QACnD,CAAC;QACD,OAAO,cAAc,CAAC,QAAQ,CAAC;IACnC,CAAC;IAEM,gBAAgB,CAAC,OAA2B;QAC/C,OAAO,CAAC,OAAO,CAAC,CAAC,MAAwB,EAAE,EAAE;YACzC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;IACP,CAAC;IAEM,QAAQ,CAAC,MAAwB;QACpC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QACpC,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;YACpB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;QAChE,CAAC;IACL,CAAC;IAEM,SAAS,CAAC,EAAY;QACzB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChC,CAAC;IAEM,aAAa;QAChB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED;;;OAGG;IACI,eAAe,CAAC,QAAkB;;QACrC,MAAM,aAAa,GAAG,WAAW,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QACrE,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;YAC9B,OAAO,aAAa,CAAC;QACzB,CAAC;QACD,OAAO,MAAA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,0CAAE,UAAU,CAAC;IAClD,CAAC;IAED;;;OAGG;IACI,gBAAgB,CAAC,GAAW;QAC/B,MAAM,QAAQ,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;QAEnC,mDAAmD;QACnD,MAAM,cAAc,GAAG,WAAW,CAAC,WAAW,EAAE,CAAC,cAAc,EAAE,CAAC;QAClE,KAAK,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,cAAc,EAAE,CAAC;YAChD,IAAI,QAAQ,CAAC,WAAW,EAAE,KAAK,QAAQ,EAAE,CAAC;gBACtC,OAAO,QAAQ,CAAC;YACpB,CAAC;QACL,CAAC;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACrC,CAAC;IAED;;OAEG;IACI,aAAa;QAChB,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACpB,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;YACzC,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;gBACpB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;YAChE,CAAC;QACL,CAAC;IACL,CAAC;IAED;;;OAGG;IACI,oBAAoB;QACvB,MAAM,UAAU,GAAG,IAAI,GAAG,EAA8B,CAAC;QAEzD,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;YACzC,MAAM,QAAQ,GAAG,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACxC,MAAM,WAAW,GAAG,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YACjF,MAAM,aAAa,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAEjF,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;gBACjC,UAAU,CAAC,GAAG,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;YACtC,CAAC;YACD,UAAU,CAAC,GAAG,CAAC,aAAa,CAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAChD,CAAC;QAED,OAAO,UAAU,CAAC;IACtB,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,EAAY,EAAE,OAAiC;QAChE,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACpC,IAAI,CAAC,MAAM,EAAE,CAAC;YACV,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAC;YACxC,OAAO;QACX,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAC/C,MAAM,eAAe,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACzD,CAAC;CACJ"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { AudioCommand } from '../commands/types';
|
|
2
|
+
export type ActionId = string;
|
|
3
|
+
export declare enum ActionCategory {
|
|
4
|
+
TRANSPORT = "Transport",
|
|
5
|
+
TRACK = "Track",
|
|
6
|
+
REGION = "Region",
|
|
7
|
+
EDIT = "Edit",
|
|
8
|
+
VIEW = "View",
|
|
9
|
+
FILE = "File",
|
|
10
|
+
DEBUG = "Debug"
|
|
11
|
+
}
|
|
12
|
+
export interface ActionDefinition {
|
|
13
|
+
id: ActionId;
|
|
14
|
+
label: string;
|
|
15
|
+
category: ActionCategory;
|
|
16
|
+
description?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Factory function to create the command payload.
|
|
19
|
+
* Can accept context arguments if needed.
|
|
20
|
+
*/
|
|
21
|
+
commandFactory: (context?: Record<string, unknown>) => AudioCommand;
|
|
22
|
+
/**
|
|
23
|
+
* Default key binding (e.g. 'Space', 'Control+Z')
|
|
24
|
+
*/
|
|
25
|
+
defaultKey?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface KeyBinding {
|
|
28
|
+
actionId: ActionId;
|
|
29
|
+
key: string;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/actions/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B,oBAAY,cAAc;IACtB,SAAS,cAAc;IACvB,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,IAAI,SAAS;IACb,KAAK,UAAU;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,QAAQ,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,cAAc,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,cAAc,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,YAAY,CAAC;IACpE;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,UAAU;IACvB,QAAQ,EAAE,QAAQ,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export var ActionCategory;
|
|
2
|
+
(function (ActionCategory) {
|
|
3
|
+
ActionCategory["TRANSPORT"] = "Transport";
|
|
4
|
+
ActionCategory["TRACK"] = "Track";
|
|
5
|
+
ActionCategory["REGION"] = "Region";
|
|
6
|
+
ActionCategory["EDIT"] = "Edit";
|
|
7
|
+
ActionCategory["VIEW"] = "View";
|
|
8
|
+
ActionCategory["FILE"] = "File";
|
|
9
|
+
ActionCategory["DEBUG"] = "Debug";
|
|
10
|
+
})(ActionCategory || (ActionCategory = {}));
|
|
11
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/actions/types.ts"],"names":[],"mappings":"AAIA,MAAM,CAAN,IAAY,cAQX;AARD,WAAY,cAAc;IACtB,yCAAuB,CAAA;IACvB,iCAAe,CAAA;IACf,mCAAiB,CAAA;IACjB,+BAAa,CAAA;IACb,+BAAa,CAAA;IACb,+BAAa,CAAA;IACb,iCAAe,CAAA;AACnB,CAAC,EARW,cAAc,KAAd,cAAc,QAQzB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TransientDetector — spectral-flux based onset / transient detection.
|
|
3
|
+
*
|
|
4
|
+
* Uses a windowed FFT approach with spectral flux to identify percussive
|
|
5
|
+
* onsets and transient events in audio data. The algorithm:
|
|
6
|
+
*
|
|
7
|
+
* 1. Slide a Hann window across the signal (window size 1024, hop 512).
|
|
8
|
+
* 2. Compute the magnitude spectrum via a real-valued DFT.
|
|
9
|
+
* 3. For each frame, compute spectral flux — the sum of positive
|
|
10
|
+
* differences between the current and previous magnitude spectrum.
|
|
11
|
+
* 4. Peak-pick: choose frames whose spectral flux exceeds a local
|
|
12
|
+
* threshold (median of a surrounding window, scaled by a sensitivity
|
|
13
|
+
* parameter).
|
|
14
|
+
*
|
|
15
|
+
* This is intentionally a pure-TypeScript implementation that runs without
|
|
16
|
+
* Web Audio API so it can be used in headless / test environments.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Detect transient positions in a mono audio buffer.
|
|
20
|
+
*
|
|
21
|
+
* @param samples Mono audio samples (Float32Array).
|
|
22
|
+
* @param sampleRate Sample rate of the audio (used only for documentation;
|
|
23
|
+
* results are returned in sample frames).
|
|
24
|
+
* @param threshold Sensitivity multiplier (lower = more onsets). Default 1.5.
|
|
25
|
+
* @returns Sorted array of frame positions where transients occur.
|
|
26
|
+
*/
|
|
27
|
+
export declare function detectTransients(samples: Float32Array, sampleRate: number, threshold?: number): number[];
|
|
28
|
+
//# sourceMappingURL=TransientDetector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransientDetector.d.ts","sourceRoot":"","sources":["../../src/analysis/TransientDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAOH;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC5B,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,MAAM,EAClB,SAAS,GAAE,MAA0B,GACtC,MAAM,EAAE,CAmEV"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TransientDetector — spectral-flux based onset / transient detection.
|
|
3
|
+
*
|
|
4
|
+
* Uses a windowed FFT approach with spectral flux to identify percussive
|
|
5
|
+
* onsets and transient events in audio data. The algorithm:
|
|
6
|
+
*
|
|
7
|
+
* 1. Slide a Hann window across the signal (window size 1024, hop 512).
|
|
8
|
+
* 2. Compute the magnitude spectrum via a real-valued DFT.
|
|
9
|
+
* 3. For each frame, compute spectral flux — the sum of positive
|
|
10
|
+
* differences between the current and previous magnitude spectrum.
|
|
11
|
+
* 4. Peak-pick: choose frames whose spectral flux exceeds a local
|
|
12
|
+
* threshold (median of a surrounding window, scaled by a sensitivity
|
|
13
|
+
* parameter).
|
|
14
|
+
*
|
|
15
|
+
* This is intentionally a pure-TypeScript implementation that runs without
|
|
16
|
+
* Web Audio API so it can be used in headless / test environments.
|
|
17
|
+
*/
|
|
18
|
+
const DEFAULT_WINDOW_SIZE = 1024;
|
|
19
|
+
const DEFAULT_HOP_SIZE = 512;
|
|
20
|
+
const DEFAULT_THRESHOLD = 1.5;
|
|
21
|
+
const MEDIAN_WINDOW = 11; // frames around current for adaptive threshold
|
|
22
|
+
/**
|
|
23
|
+
* Detect transient positions in a mono audio buffer.
|
|
24
|
+
*
|
|
25
|
+
* @param samples Mono audio samples (Float32Array).
|
|
26
|
+
* @param sampleRate Sample rate of the audio (used only for documentation;
|
|
27
|
+
* results are returned in sample frames).
|
|
28
|
+
* @param threshold Sensitivity multiplier (lower = more onsets). Default 1.5.
|
|
29
|
+
* @returns Sorted array of frame positions where transients occur.
|
|
30
|
+
*/
|
|
31
|
+
export function detectTransients(samples, sampleRate, threshold = DEFAULT_THRESHOLD) {
|
|
32
|
+
const windowSize = DEFAULT_WINDOW_SIZE;
|
|
33
|
+
const hopSize = DEFAULT_HOP_SIZE;
|
|
34
|
+
const halfWindow = windowSize >>> 1;
|
|
35
|
+
if (samples.length < windowSize) {
|
|
36
|
+
return [];
|
|
37
|
+
}
|
|
38
|
+
// Pre-compute Hann window
|
|
39
|
+
const hann = new Float32Array(windowSize);
|
|
40
|
+
for (let i = 0; i < windowSize; i++) {
|
|
41
|
+
hann[i] = 0.5 * (1 - Math.cos((2 * Math.PI * i) / (windowSize - 1)));
|
|
42
|
+
}
|
|
43
|
+
const numFrames = Math.floor((samples.length - windowSize) / hopSize) + 1;
|
|
44
|
+
const fluxValues = new Array(numFrames);
|
|
45
|
+
let prevMagnitudes = new Array(halfWindow + 1).fill(0);
|
|
46
|
+
for (let frame = 0; frame < numFrames; frame++) {
|
|
47
|
+
const offset = frame * hopSize;
|
|
48
|
+
// Apply Hann window
|
|
49
|
+
const windowed = new Float32Array(windowSize);
|
|
50
|
+
for (let i = 0; i < windowSize; i++) {
|
|
51
|
+
windowed[i] = samples[offset + i] * hann[i];
|
|
52
|
+
}
|
|
53
|
+
// Compute magnitude spectrum via real DFT (only positive frequencies)
|
|
54
|
+
const magnitudes = realDFTMagnitudes(windowed, halfWindow);
|
|
55
|
+
// Spectral flux: sum of positive differences
|
|
56
|
+
let flux = 0;
|
|
57
|
+
for (let k = 0; k <= halfWindow; k++) {
|
|
58
|
+
const diff = magnitudes[k] - prevMagnitudes[k];
|
|
59
|
+
if (diff > 0) {
|
|
60
|
+
flux += diff;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
fluxValues[frame] = flux;
|
|
64
|
+
prevMagnitudes = magnitudes;
|
|
65
|
+
}
|
|
66
|
+
// Adaptive peak picking using a median-based threshold
|
|
67
|
+
const transients = [];
|
|
68
|
+
const halfMedian = (MEDIAN_WINDOW - 1) >>> 1;
|
|
69
|
+
for (let frame = 0; frame < numFrames; frame++) {
|
|
70
|
+
// Gather surrounding flux values for median computation
|
|
71
|
+
const start = Math.max(0, frame - halfMedian);
|
|
72
|
+
const end = Math.min(numFrames - 1, frame + halfMedian);
|
|
73
|
+
const neighbourhood = [];
|
|
74
|
+
for (let j = start; j <= end; j++) {
|
|
75
|
+
neighbourhood.push(fluxValues[j]);
|
|
76
|
+
}
|
|
77
|
+
neighbourhood.sort((a, b) => a - b);
|
|
78
|
+
const median = neighbourhood[neighbourhood.length >>> 1];
|
|
79
|
+
if (fluxValues[frame] > median * threshold && fluxValues[frame] > 0) {
|
|
80
|
+
// Convert frame index to sample position (center of hop)
|
|
81
|
+
const samplePos = frame * hopSize + (halfWindow);
|
|
82
|
+
transients.push(samplePos);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return transients;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Compute magnitude spectrum for real-valued input via a naive DFT.
|
|
89
|
+
*
|
|
90
|
+
* Only computes bins 0..N/2 (positive frequencies). This is O(N * N/2)
|
|
91
|
+
* which is acceptable for small window sizes (1024).
|
|
92
|
+
*/
|
|
93
|
+
function realDFTMagnitudes(input, halfN) {
|
|
94
|
+
const N = input.length;
|
|
95
|
+
const mags = new Array(halfN + 1);
|
|
96
|
+
for (let k = 0; k <= halfN; k++) {
|
|
97
|
+
let re = 0;
|
|
98
|
+
let im = 0;
|
|
99
|
+
const freqFactor = (2 * Math.PI * k) / N;
|
|
100
|
+
for (let n = 0; n < N; n++) {
|
|
101
|
+
const angle = freqFactor * n;
|
|
102
|
+
re += input[n] * Math.cos(angle);
|
|
103
|
+
im -= input[n] * Math.sin(angle);
|
|
104
|
+
}
|
|
105
|
+
mags[k] = Math.sqrt(re * re + im * im);
|
|
106
|
+
}
|
|
107
|
+
return mags;
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=TransientDetector.js.map
|