@onjmin/dtm 0.1.43 → 0.1.46
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/dist/index.d.mts +15 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +24 -5
- package/dist/index.mjs +23 -5
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1690,6 +1690,20 @@ declare const DAW_CSS = "\n@font-face {\n font-family: 'k8x12';\n src: url('ht
|
|
|
1690
1690
|
* スタイルを document.head に一度だけ注入する。
|
|
1691
1691
|
*/
|
|
1692
1692
|
declare const injectStyles: (doc?: Document) => void;
|
|
1693
|
+
/**
|
|
1694
|
+
* container 内にローディング画面を表示する。
|
|
1695
|
+
*
|
|
1696
|
+
* - `remove()` でオーバーレイを除去する。
|
|
1697
|
+
* - `setProgress(done, total)` で進捗を反映する。total>0 のときはバーを実測値で
|
|
1698
|
+
* 塗り、`done / total (NN%)` を表示する。total<=0 なら不確定(無限ループ)演出に戻す。
|
|
1699
|
+
*/
|
|
1700
|
+
declare const showLoadingOverlay: (container: HTMLElement, options?: {
|
|
1701
|
+
onSkip?: () => void;
|
|
1702
|
+
skipLabel?: string;
|
|
1703
|
+
}) => {
|
|
1704
|
+
remove: () => void;
|
|
1705
|
+
setProgress: (done: number, total: number, remainingTimeSec?: number | null) => void;
|
|
1706
|
+
};
|
|
1693
1707
|
|
|
1694
1708
|
/**
|
|
1695
1709
|
* 内蔵の簡易square-wave synth + ノイズ系ドラム音。
|
|
@@ -1719,4 +1733,4 @@ declare const createSynth: (ctx: AudioContext, destination?: AudioNode) => Synth
|
|
|
1719
1733
|
|
|
1720
1734
|
declare const VOICE_IMAGES: Record<string, string>;
|
|
1721
1735
|
|
|
1722
|
-
export { type AddNoteOptions, type ApplyChordOptions, type ChordPatternType, type ChordPlacement, type ConsumedSyllable, type CoreEventHandlers, DAW_CSS, DEFAULT_BPM, DEFAULT_GATE, DEFAULT_PAN, DEFAULT_PLAYBACK_VELOCITY, DEFAULT_STEPS_PER_BAR, DEFAULT_VELOCITY, DEFAULT_VOCAL_VOLUME, DRUM_FONT, DRUM_KEYS, DRUM_PATTERNS, type DawInstance, type DawMode, type DawOptions, type DawViewState, type DrumPattern, type DtmStudio, type DtmStudioEngines, type DtmStudioOptions, type ExportMidiOptions, GM_INSTRUMENT_NAMES, INSTRUMENT_PRESETS, type InstrumentPreset, KOE_BASE_URL, KOE_VOICEBANKS, KOE_VOICEBANK_LABELS, KOE_VOICEBANK_TERMS, type KoeVoiceOptions, LinkedList, type LoopConfig, type LoopPoint, type LyricSyllable, type LyricSyncData, type LyricTrack, type LyricsConductor, MAX_VOCAL_VOLUME, MMLCore, type MMLDisplayToken, type MMLNotePlacement, MML_END_MARKER, type MidiExtraction, type MidiNotePlacement, type MidiTrackAnalysis, type MmlMeta, type MmlPlayback, type MmlPlayerInstance, type MmlPlayerOptions, type ModeSwitchInstance, type ModeSwitchOptions, type MountEditorOptions, type MountPlayerOptions, type Note, type NoteData, type NoteRemove, PITCH_MAP, PREWARM_NOTES, type ParseMMLOptions, type ParseMidiFn, type ParsedMML, type PianoRollInstance, type PianoRollOptions, type PitchToken, type PlayDrumEvent, type PlayMmlOptions, type PlayNoteEvent, type PlaySingingMmlOptions, type PlaybackCue, type PlaybackState, type PresetSelectInstance, type PresetSelectOptions, type PreviewSoundCallback, type RenderConfig, type Sequencer, type SequencerOptions, type SequencerTrack, type SingingVoices, type SingingVoicesOptions, type StreamPlaybackOptions, type StreamVoiceNote, type StreamVoiceTrack, type Synth, TRACKS_ADVANCED, TRACKS_SIMPLE, type ToolMode, type TrackConfig, VOICE_IMAGES, VOICE_IMAGE_KEY, type VoiceModel, type VoiceRegistry, analyzeMidiTracks, applyHarmonicFilter, applyMonophonic, buildChordPlacements, buildNameToKeyMapping, collectPitchTokens, createAudioContext, createDtmStudio, createKlattVoice, createKoeVoice, createLyricsConductor, createPianoRoll, createSequencer, createSingingVoices, createSynth, createVoiceRegistry, decodeMml, decomposeToMonophonic, drawGrid, drawHeader, drawKeyboard, drawNotes, drawSelectedNotes, drawSelectionRect, encodeMml, exportMIDI, extractMidiPlacements, extractMidiPlacementsByTrack, formatMmlMeta, freqFromPitch, generateRandomPattern, getDrawOffset, getGridCanvas, getGridContext, getGridPosition, getHeaderCanvas, getMidiBPM, getRenderConfig, getXY, icon, init, injectStyles, isChordHeavyTrack, koeUrl, mountDAW, mountMmlPlayer, normalizeLyrics, onClick, panToStereo, parseLyrics, parseMML, parseMmlMeta, playMML, playSingingMML, setDrawOffset, shiftNotes, stripLyrics, stripMmlMeta, vocalVolumeToGain };
|
|
1736
|
+
export { type AddNoteOptions, type ApplyChordOptions, type ChordPatternType, type ChordPlacement, type ConsumedSyllable, type CoreEventHandlers, DAW_CSS, DEFAULT_BPM, DEFAULT_GATE, DEFAULT_PAN, DEFAULT_PLAYBACK_VELOCITY, DEFAULT_STEPS_PER_BAR, DEFAULT_VELOCITY, DEFAULT_VOCAL_VOLUME, DRUM_FONT, DRUM_KEYS, DRUM_PATTERNS, type DawInstance, type DawMode, type DawOptions, type DawViewState, type DrumPattern, type DtmStudio, type DtmStudioEngines, type DtmStudioOptions, type ExportMidiOptions, GM_INSTRUMENT_NAMES, INSTRUMENT_PRESETS, type InstrumentPreset, KOE_BASE_URL, KOE_VOICEBANKS, KOE_VOICEBANK_LABELS, KOE_VOICEBANK_TERMS, type KoeVoiceOptions, LinkedList, type LoopConfig, type LoopPoint, type LyricSyllable, type LyricSyncData, type LyricTrack, type LyricsConductor, MAX_VOCAL_VOLUME, MMLCore, type MMLDisplayToken, type MMLNotePlacement, MML_END_MARKER, type MidiExtraction, type MidiNotePlacement, type MidiTrackAnalysis, type MmlMeta, type MmlPlayback, type MmlPlayerInstance, type MmlPlayerOptions, type ModeSwitchInstance, type ModeSwitchOptions, type MountEditorOptions, type MountPlayerOptions, type Note, type NoteData, type NoteRemove, PITCH_MAP, PREWARM_NOTES, type ParseMMLOptions, type ParseMidiFn, type ParsedMML, type PianoRollInstance, type PianoRollOptions, type PitchToken, type PlayDrumEvent, type PlayMmlOptions, type PlayNoteEvent, type PlaySingingMmlOptions, type PlaybackCue, type PlaybackState, type PresetSelectInstance, type PresetSelectOptions, type PreviewSoundCallback, type RenderConfig, type Sequencer, type SequencerOptions, type SequencerTrack, type SingingVoices, type SingingVoicesOptions, type StreamPlaybackOptions, type StreamVoiceNote, type StreamVoiceTrack, type Synth, TRACKS_ADVANCED, TRACKS_SIMPLE, type ToolMode, type TrackConfig, VOICE_IMAGES, VOICE_IMAGE_KEY, type VoiceModel, type VoiceRegistry, analyzeMidiTracks, applyHarmonicFilter, applyMonophonic, buildChordPlacements, buildNameToKeyMapping, collectPitchTokens, createAudioContext, createDtmStudio, createKlattVoice, createKoeVoice, createLyricsConductor, createPianoRoll, createSequencer, createSingingVoices, createSynth, createVoiceRegistry, decodeMml, decomposeToMonophonic, drawGrid, drawHeader, drawKeyboard, drawNotes, drawSelectedNotes, drawSelectionRect, encodeMml, exportMIDI, extractMidiPlacements, extractMidiPlacementsByTrack, formatMmlMeta, freqFromPitch, generateRandomPattern, getDrawOffset, getGridCanvas, getGridContext, getGridPosition, getHeaderCanvas, getMidiBPM, getRenderConfig, getXY, icon, init, injectStyles, isChordHeavyTrack, koeUrl, mountDAW, mountMmlPlayer, normalizeLyrics, onClick, panToStereo, parseLyrics, parseMML, parseMmlMeta, playMML, playSingingMML, setDrawOffset, shiftNotes, showLoadingOverlay, stripLyrics, stripMmlMeta, vocalVolumeToGain };
|
package/dist/index.d.ts
CHANGED
|
@@ -1690,6 +1690,20 @@ declare const DAW_CSS = "\n@font-face {\n font-family: 'k8x12';\n src: url('ht
|
|
|
1690
1690
|
* スタイルを document.head に一度だけ注入する。
|
|
1691
1691
|
*/
|
|
1692
1692
|
declare const injectStyles: (doc?: Document) => void;
|
|
1693
|
+
/**
|
|
1694
|
+
* container 内にローディング画面を表示する。
|
|
1695
|
+
*
|
|
1696
|
+
* - `remove()` でオーバーレイを除去する。
|
|
1697
|
+
* - `setProgress(done, total)` で進捗を反映する。total>0 のときはバーを実測値で
|
|
1698
|
+
* 塗り、`done / total (NN%)` を表示する。total<=0 なら不確定(無限ループ)演出に戻す。
|
|
1699
|
+
*/
|
|
1700
|
+
declare const showLoadingOverlay: (container: HTMLElement, options?: {
|
|
1701
|
+
onSkip?: () => void;
|
|
1702
|
+
skipLabel?: string;
|
|
1703
|
+
}) => {
|
|
1704
|
+
remove: () => void;
|
|
1705
|
+
setProgress: (done: number, total: number, remainingTimeSec?: number | null) => void;
|
|
1706
|
+
};
|
|
1693
1707
|
|
|
1694
1708
|
/**
|
|
1695
1709
|
* 内蔵の簡易square-wave synth + ノイズ系ドラム音。
|
|
@@ -1719,4 +1733,4 @@ declare const createSynth: (ctx: AudioContext, destination?: AudioNode) => Synth
|
|
|
1719
1733
|
|
|
1720
1734
|
declare const VOICE_IMAGES: Record<string, string>;
|
|
1721
1735
|
|
|
1722
|
-
export { type AddNoteOptions, type ApplyChordOptions, type ChordPatternType, type ChordPlacement, type ConsumedSyllable, type CoreEventHandlers, DAW_CSS, DEFAULT_BPM, DEFAULT_GATE, DEFAULT_PAN, DEFAULT_PLAYBACK_VELOCITY, DEFAULT_STEPS_PER_BAR, DEFAULT_VELOCITY, DEFAULT_VOCAL_VOLUME, DRUM_FONT, DRUM_KEYS, DRUM_PATTERNS, type DawInstance, type DawMode, type DawOptions, type DawViewState, type DrumPattern, type DtmStudio, type DtmStudioEngines, type DtmStudioOptions, type ExportMidiOptions, GM_INSTRUMENT_NAMES, INSTRUMENT_PRESETS, type InstrumentPreset, KOE_BASE_URL, KOE_VOICEBANKS, KOE_VOICEBANK_LABELS, KOE_VOICEBANK_TERMS, type KoeVoiceOptions, LinkedList, type LoopConfig, type LoopPoint, type LyricSyllable, type LyricSyncData, type LyricTrack, type LyricsConductor, MAX_VOCAL_VOLUME, MMLCore, type MMLDisplayToken, type MMLNotePlacement, MML_END_MARKER, type MidiExtraction, type MidiNotePlacement, type MidiTrackAnalysis, type MmlMeta, type MmlPlayback, type MmlPlayerInstance, type MmlPlayerOptions, type ModeSwitchInstance, type ModeSwitchOptions, type MountEditorOptions, type MountPlayerOptions, type Note, type NoteData, type NoteRemove, PITCH_MAP, PREWARM_NOTES, type ParseMMLOptions, type ParseMidiFn, type ParsedMML, type PianoRollInstance, type PianoRollOptions, type PitchToken, type PlayDrumEvent, type PlayMmlOptions, type PlayNoteEvent, type PlaySingingMmlOptions, type PlaybackCue, type PlaybackState, type PresetSelectInstance, type PresetSelectOptions, type PreviewSoundCallback, type RenderConfig, type Sequencer, type SequencerOptions, type SequencerTrack, type SingingVoices, type SingingVoicesOptions, type StreamPlaybackOptions, type StreamVoiceNote, type StreamVoiceTrack, type Synth, TRACKS_ADVANCED, TRACKS_SIMPLE, type ToolMode, type TrackConfig, VOICE_IMAGES, VOICE_IMAGE_KEY, type VoiceModel, type VoiceRegistry, analyzeMidiTracks, applyHarmonicFilter, applyMonophonic, buildChordPlacements, buildNameToKeyMapping, collectPitchTokens, createAudioContext, createDtmStudio, createKlattVoice, createKoeVoice, createLyricsConductor, createPianoRoll, createSequencer, createSingingVoices, createSynth, createVoiceRegistry, decodeMml, decomposeToMonophonic, drawGrid, drawHeader, drawKeyboard, drawNotes, drawSelectedNotes, drawSelectionRect, encodeMml, exportMIDI, extractMidiPlacements, extractMidiPlacementsByTrack, formatMmlMeta, freqFromPitch, generateRandomPattern, getDrawOffset, getGridCanvas, getGridContext, getGridPosition, getHeaderCanvas, getMidiBPM, getRenderConfig, getXY, icon, init, injectStyles, isChordHeavyTrack, koeUrl, mountDAW, mountMmlPlayer, normalizeLyrics, onClick, panToStereo, parseLyrics, parseMML, parseMmlMeta, playMML, playSingingMML, setDrawOffset, shiftNotes, stripLyrics, stripMmlMeta, vocalVolumeToGain };
|
|
1736
|
+
export { type AddNoteOptions, type ApplyChordOptions, type ChordPatternType, type ChordPlacement, type ConsumedSyllable, type CoreEventHandlers, DAW_CSS, DEFAULT_BPM, DEFAULT_GATE, DEFAULT_PAN, DEFAULT_PLAYBACK_VELOCITY, DEFAULT_STEPS_PER_BAR, DEFAULT_VELOCITY, DEFAULT_VOCAL_VOLUME, DRUM_FONT, DRUM_KEYS, DRUM_PATTERNS, type DawInstance, type DawMode, type DawOptions, type DawViewState, type DrumPattern, type DtmStudio, type DtmStudioEngines, type DtmStudioOptions, type ExportMidiOptions, GM_INSTRUMENT_NAMES, INSTRUMENT_PRESETS, type InstrumentPreset, KOE_BASE_URL, KOE_VOICEBANKS, KOE_VOICEBANK_LABELS, KOE_VOICEBANK_TERMS, type KoeVoiceOptions, LinkedList, type LoopConfig, type LoopPoint, type LyricSyllable, type LyricSyncData, type LyricTrack, type LyricsConductor, MAX_VOCAL_VOLUME, MMLCore, type MMLDisplayToken, type MMLNotePlacement, MML_END_MARKER, type MidiExtraction, type MidiNotePlacement, type MidiTrackAnalysis, type MmlMeta, type MmlPlayback, type MmlPlayerInstance, type MmlPlayerOptions, type ModeSwitchInstance, type ModeSwitchOptions, type MountEditorOptions, type MountPlayerOptions, type Note, type NoteData, type NoteRemove, PITCH_MAP, PREWARM_NOTES, type ParseMMLOptions, type ParseMidiFn, type ParsedMML, type PianoRollInstance, type PianoRollOptions, type PitchToken, type PlayDrumEvent, type PlayMmlOptions, type PlayNoteEvent, type PlaySingingMmlOptions, type PlaybackCue, type PlaybackState, type PresetSelectInstance, type PresetSelectOptions, type PreviewSoundCallback, type RenderConfig, type Sequencer, type SequencerOptions, type SequencerTrack, type SingingVoices, type SingingVoicesOptions, type StreamPlaybackOptions, type StreamVoiceNote, type StreamVoiceTrack, type Synth, TRACKS_ADVANCED, TRACKS_SIMPLE, type ToolMode, type TrackConfig, VOICE_IMAGES, VOICE_IMAGE_KEY, type VoiceModel, type VoiceRegistry, analyzeMidiTracks, applyHarmonicFilter, applyMonophonic, buildChordPlacements, buildNameToKeyMapping, collectPitchTokens, createAudioContext, createDtmStudio, createKlattVoice, createKoeVoice, createLyricsConductor, createPianoRoll, createSequencer, createSingingVoices, createSynth, createVoiceRegistry, decodeMml, decomposeToMonophonic, drawGrid, drawHeader, drawKeyboard, drawNotes, drawSelectedNotes, drawSelectionRect, encodeMml, exportMIDI, extractMidiPlacements, extractMidiPlacementsByTrack, formatMmlMeta, freqFromPitch, generateRandomPattern, getDrawOffset, getGridCanvas, getGridContext, getGridPosition, getHeaderCanvas, getMidiBPM, getRenderConfig, getXY, icon, init, injectStyles, isChordHeavyTrack, koeUrl, mountDAW, mountMmlPlayer, normalizeLyrics, onClick, panToStereo, parseLyrics, parseMML, parseMmlMeta, playMML, playSingingMML, setDrawOffset, shiftNotes, showLoadingOverlay, stripLyrics, stripMmlMeta, vocalVolumeToGain };
|
package/dist/index.js
CHANGED
|
@@ -103,6 +103,7 @@ __export(index_exports, {
|
|
|
103
103
|
playSingingMML: () => playSingingMML,
|
|
104
104
|
setDrawOffset: () => setDrawOffset,
|
|
105
105
|
shiftNotes: () => shiftNotes,
|
|
106
|
+
showLoadingOverlay: () => showLoadingOverlay,
|
|
106
107
|
stripLyrics: () => stripLyrics,
|
|
107
108
|
stripMmlMeta: () => stripMmlMeta,
|
|
108
109
|
vocalVolumeToGain: () => vocalVolumeToGain
|
|
@@ -7954,8 +7955,25 @@ var mountDAW = (target, options = {}) => {
|
|
|
7954
7955
|
const initScrollbarDrag = () => {
|
|
7955
7956
|
let draggingH = false;
|
|
7956
7957
|
let draggingV = false;
|
|
7958
|
+
let hScrollWasPlaying = false;
|
|
7959
|
+
const finishHScroll = () => {
|
|
7960
|
+
if (!draggingH) return;
|
|
7961
|
+
draggingH = false;
|
|
7962
|
+
if (hScrollWasPlaying) {
|
|
7963
|
+
hScrollWasPlaying = false;
|
|
7964
|
+
const snappedStep = Math.max(
|
|
7965
|
+
0,
|
|
7966
|
+
Math.floor(currentOffsetX / renderConfig.stepWidth / snapGridSteps) * snapGridSteps
|
|
7967
|
+
);
|
|
7968
|
+
pausedPlayStep = snappedStep;
|
|
7969
|
+
currentPlayStep = snappedStep;
|
|
7970
|
+
void play();
|
|
7971
|
+
}
|
|
7972
|
+
};
|
|
7957
7973
|
refs.hScroll.addEventListener("pointerdown", (e) => {
|
|
7958
7974
|
draggingH = true;
|
|
7975
|
+
hScrollWasPlaying = playbackState === "playing";
|
|
7976
|
+
if (hScrollWasPlaying) pause();
|
|
7959
7977
|
e.preventDefault();
|
|
7960
7978
|
refs.hScroll.setPointerCapture(e.pointerId);
|
|
7961
7979
|
moveH(e.clientX);
|
|
@@ -7972,9 +7990,7 @@ var mountDAW = (target, options = {}) => {
|
|
|
7972
7990
|
refs.vScroll.addEventListener("pointermove", (e) => {
|
|
7973
7991
|
if (draggingV) moveV(e.clientY);
|
|
7974
7992
|
});
|
|
7975
|
-
refs.hScroll.addEventListener("pointerup",
|
|
7976
|
-
draggingH = false;
|
|
7977
|
-
});
|
|
7993
|
+
refs.hScroll.addEventListener("pointerup", finishHScroll);
|
|
7978
7994
|
refs.vScroll.addEventListener("pointerup", () => {
|
|
7979
7995
|
draggingV = false;
|
|
7980
7996
|
});
|
|
@@ -7983,7 +7999,7 @@ var mountDAW = (target, options = {}) => {
|
|
|
7983
7999
|
if (draggingV) moveV(e.clientY);
|
|
7984
8000
|
});
|
|
7985
8001
|
document.addEventListener("pointerup", () => {
|
|
7986
|
-
|
|
8002
|
+
finishHScroll();
|
|
7987
8003
|
draggingV = false;
|
|
7988
8004
|
});
|
|
7989
8005
|
const moveH = (clientX) => {
|
|
@@ -10997,9 +11013,9 @@ var createDtmStudio = async (options = {}) => {
|
|
|
10997
11013
|
const daw = mountDAW(target, base);
|
|
10998
11014
|
mountedEditors.push(daw);
|
|
10999
11015
|
const wantPresetUI = presetUI ?? features.presetUI;
|
|
11016
|
+
const rollEl = target.querySelector('[data-dtm="roll"]');
|
|
11000
11017
|
if (wantPresetUI) {
|
|
11001
11018
|
editorPresetSelects.get(target)?.destroy();
|
|
11002
|
-
const rollEl = target.querySelector('[data-dtm="roll"]');
|
|
11003
11019
|
presetSelect = mountPresetSelect(target, {
|
|
11004
11020
|
getDaw: () => daw,
|
|
11005
11021
|
getTrackIds: () => trackIds,
|
|
@@ -11014,12 +11030,14 @@ var createDtmStudio = async (options = {}) => {
|
|
|
11014
11030
|
editorPresetSelects.set(target, presetSelect);
|
|
11015
11031
|
}
|
|
11016
11032
|
daw.setInstrument(initialPreset);
|
|
11033
|
+
const initialOverlay = rollEl ? showLoadingOverlay(rollEl) : null;
|
|
11017
11034
|
daw.setLoading?.(true);
|
|
11018
11035
|
void loadPreset(
|
|
11019
11036
|
initialPreset,
|
|
11020
11037
|
trackIds,
|
|
11021
11038
|
isAdvancedMode ? "advanced" : "simple"
|
|
11022
11039
|
).finally(() => {
|
|
11040
|
+
initialOverlay?.remove();
|
|
11023
11041
|
daw.setLoading?.(false);
|
|
11024
11042
|
});
|
|
11025
11043
|
const destroy = () => {
|
|
@@ -11318,6 +11336,7 @@ var createDtmStudio = async (options = {}) => {
|
|
|
11318
11336
|
playSingingMML,
|
|
11319
11337
|
setDrawOffset,
|
|
11320
11338
|
shiftNotes,
|
|
11339
|
+
showLoadingOverlay,
|
|
11321
11340
|
stripLyrics,
|
|
11322
11341
|
stripMmlMeta,
|
|
11323
11342
|
vocalVolumeToGain
|
package/dist/index.mjs
CHANGED
|
@@ -7843,8 +7843,25 @@ var mountDAW = (target, options = {}) => {
|
|
|
7843
7843
|
const initScrollbarDrag = () => {
|
|
7844
7844
|
let draggingH = false;
|
|
7845
7845
|
let draggingV = false;
|
|
7846
|
+
let hScrollWasPlaying = false;
|
|
7847
|
+
const finishHScroll = () => {
|
|
7848
|
+
if (!draggingH) return;
|
|
7849
|
+
draggingH = false;
|
|
7850
|
+
if (hScrollWasPlaying) {
|
|
7851
|
+
hScrollWasPlaying = false;
|
|
7852
|
+
const snappedStep = Math.max(
|
|
7853
|
+
0,
|
|
7854
|
+
Math.floor(currentOffsetX / renderConfig.stepWidth / snapGridSteps) * snapGridSteps
|
|
7855
|
+
);
|
|
7856
|
+
pausedPlayStep = snappedStep;
|
|
7857
|
+
currentPlayStep = snappedStep;
|
|
7858
|
+
void play();
|
|
7859
|
+
}
|
|
7860
|
+
};
|
|
7846
7861
|
refs.hScroll.addEventListener("pointerdown", (e) => {
|
|
7847
7862
|
draggingH = true;
|
|
7863
|
+
hScrollWasPlaying = playbackState === "playing";
|
|
7864
|
+
if (hScrollWasPlaying) pause();
|
|
7848
7865
|
e.preventDefault();
|
|
7849
7866
|
refs.hScroll.setPointerCapture(e.pointerId);
|
|
7850
7867
|
moveH(e.clientX);
|
|
@@ -7861,9 +7878,7 @@ var mountDAW = (target, options = {}) => {
|
|
|
7861
7878
|
refs.vScroll.addEventListener("pointermove", (e) => {
|
|
7862
7879
|
if (draggingV) moveV(e.clientY);
|
|
7863
7880
|
});
|
|
7864
|
-
refs.hScroll.addEventListener("pointerup",
|
|
7865
|
-
draggingH = false;
|
|
7866
|
-
});
|
|
7881
|
+
refs.hScroll.addEventListener("pointerup", finishHScroll);
|
|
7867
7882
|
refs.vScroll.addEventListener("pointerup", () => {
|
|
7868
7883
|
draggingV = false;
|
|
7869
7884
|
});
|
|
@@ -7872,7 +7887,7 @@ var mountDAW = (target, options = {}) => {
|
|
|
7872
7887
|
if (draggingV) moveV(e.clientY);
|
|
7873
7888
|
});
|
|
7874
7889
|
document.addEventListener("pointerup", () => {
|
|
7875
|
-
|
|
7890
|
+
finishHScroll();
|
|
7876
7891
|
draggingV = false;
|
|
7877
7892
|
});
|
|
7878
7893
|
const moveH = (clientX) => {
|
|
@@ -10885,9 +10900,9 @@ var createDtmStudio = async (options = {}) => {
|
|
|
10885
10900
|
const daw = mountDAW(target, base);
|
|
10886
10901
|
mountedEditors.push(daw);
|
|
10887
10902
|
const wantPresetUI = presetUI ?? features.presetUI;
|
|
10903
|
+
const rollEl = target.querySelector('[data-dtm="roll"]');
|
|
10888
10904
|
if (wantPresetUI) {
|
|
10889
10905
|
editorPresetSelects.get(target)?.destroy();
|
|
10890
|
-
const rollEl = target.querySelector('[data-dtm="roll"]');
|
|
10891
10906
|
presetSelect = mountPresetSelect(target, {
|
|
10892
10907
|
getDaw: () => daw,
|
|
10893
10908
|
getTrackIds: () => trackIds,
|
|
@@ -10902,12 +10917,14 @@ var createDtmStudio = async (options = {}) => {
|
|
|
10902
10917
|
editorPresetSelects.set(target, presetSelect);
|
|
10903
10918
|
}
|
|
10904
10919
|
daw.setInstrument(initialPreset);
|
|
10920
|
+
const initialOverlay = rollEl ? showLoadingOverlay(rollEl) : null;
|
|
10905
10921
|
daw.setLoading?.(true);
|
|
10906
10922
|
void loadPreset(
|
|
10907
10923
|
initialPreset,
|
|
10908
10924
|
trackIds,
|
|
10909
10925
|
isAdvancedMode ? "advanced" : "simple"
|
|
10910
10926
|
).finally(() => {
|
|
10927
|
+
initialOverlay?.remove();
|
|
10911
10928
|
daw.setLoading?.(false);
|
|
10912
10929
|
});
|
|
10913
10930
|
const destroy = () => {
|
|
@@ -11205,6 +11222,7 @@ export {
|
|
|
11205
11222
|
playSingingMML,
|
|
11206
11223
|
setDrawOffset,
|
|
11207
11224
|
shiftNotes,
|
|
11225
|
+
showLoadingOverlay,
|
|
11208
11226
|
stripLyrics,
|
|
11209
11227
|
stripMmlMeta,
|
|
11210
11228
|
vocalVolumeToGain
|
package/package.json
CHANGED