@onjmin/dtm 0.1.44 → 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 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
- draggingH = false;
8002
+ finishHScroll();
7987
8003
  draggingV = false;
7988
8004
  });
7989
8005
  const moveH = (clientX) => {
@@ -11320,6 +11336,7 @@ var createDtmStudio = async (options = {}) => {
11320
11336
  playSingingMML,
11321
11337
  setDrawOffset,
11322
11338
  shiftNotes,
11339
+ showLoadingOverlay,
11323
11340
  stripLyrics,
11324
11341
  stripMmlMeta,
11325
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
- draggingH = false;
7890
+ finishHScroll();
7876
7891
  draggingV = false;
7877
7892
  });
7878
7893
  const moveH = (clientX) => {
@@ -11207,6 +11222,7 @@ export {
11207
11222
  playSingingMML,
11208
11223
  setDrawOffset,
11209
11224
  shiftNotes,
11225
+ showLoadingOverlay,
11210
11226
  stripLyrics,
11211
11227
  stripMmlMeta,
11212
11228
  vocalVolumeToGain
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "author": "onjmin",
3
3
  "license": "MIT",
4
4
  "name": "@onjmin/dtm",
5
- "version": "0.1.44",
5
+ "version": "0.1.46",
6
6
  "description": "MMLを中間言語に用いた、モバイルファーストなDAW / ピアノロール打ち込みコンポーネント",
7
7
  "homepage": "https://onjmin.github.io/dtm",
8
8
  "repository": {