@onjmin/dtm 2.1.5 → 2.1.6

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
@@ -2274,6 +2274,48 @@ declare const TRACKS_ADVANCED: TrackConfig[];
2274
2274
  */
2275
2275
  declare const mountDAW: (target: HTMLElement, options?: DawOptions) => DawInstance;
2276
2276
 
2277
+ /**
2278
+ * 全体トラック設定アコーディオン内で選択された設定値の localStorage 永続化
2279
+ *
2280
+ * 音律、ループ再生、全体音量、グルーコンプ、マスタリバーブ(量・Decay・PreDelay)、
2281
+ * マスタディレイ(量・音価)、フェードイン、フェードアウトの各設定を保持し、
2282
+ * 次回ロード時に復元できるようにする。
2283
+ */
2284
+ declare const GLOBAL_STORAGE_KEYS: {
2285
+ readonly edo: "dtm-global:edo";
2286
+ readonly loop: "dtm-global:loop";
2287
+ readonly masterVolume: "dtm-global:master-volume";
2288
+ readonly masterComp: "dtm-global:master-comp";
2289
+ readonly reverbAmount: "dtm-global:reverb-amount";
2290
+ readonly reverbDecay: "dtm-global:reverb-decay";
2291
+ readonly reverbPreDelay: "dtm-global:reverb-predelay";
2292
+ readonly delayAmount: "dtm-global:delay-amount";
2293
+ readonly delayDivision: "dtm-global:delay-division";
2294
+ readonly fadeIn: "dtm-global:fade-in";
2295
+ readonly fadeOut: "dtm-global:fade-out";
2296
+ };
2297
+ type GlobalStorageKey = keyof typeof GLOBAL_STORAGE_KEYS;
2298
+ /**
2299
+ * 全体トラック設定の単一項目を localStorage から取得する。
2300
+ * 未設定または localStorage にアクセスできない場合は null を返す。
2301
+ */
2302
+ declare const readGlobalSetting: (key: GlobalStorageKey) => string | null;
2303
+ /**
2304
+ * 全体トラック設定の単一項目を localStorage に保存する。
2305
+ * localStorage にアクセスできない環境や容量制限等は無視する。
2306
+ */
2307
+ declare const writeGlobalSetting: (key: GlobalStorageKey, value: string) => void;
2308
+ /**
2309
+ * 全体トラック設定の数値項目を localStorage から取得し、クランプして返す。
2310
+ * 未設定・パース失敗の場合は null を返す。
2311
+ */
2312
+ declare const readGlobalNumber: (key: GlobalStorageKey, min: number, max: number) => number | null;
2313
+ /**
2314
+ * 全体トラック設定の真偽値項目を localStorage から取得して返す。
2315
+ * 未設定・不正値の場合は null を返す。
2316
+ */
2317
+ declare const readGlobalBool: (key: GlobalStorageKey) => boolean | null;
2318
+
2277
2319
  /**
2278
2320
  * playMML — DOM非依存(ヘッドレス)の MML 再生関数。
2279
2321
  *
@@ -3570,4 +3612,4 @@ declare const encodeWavPCM16: (channels: Float32Array[], sampleRate: number) =>
3570
3612
  /** Float32Array のチャンクを1本へ連結する。 */
3571
3613
  declare const concatFloat32: (chunks: Float32Array[]) => Float32Array;
3572
3614
 
3573
- export { A4_HZ, A4_UNITS, type AddNoteOptions, type AnyDrumPattern, type ApplyChordOptions, BREATH_MARK, type Band, CENTS_PER_UNIT, COMPOSE_KEYS, COMPOSE_MOOD_GROUPS, CORPUS_BANDS, CORPUS_SIZE, type ChordPatternType, type ChordPlacement, type ChordPlayerInstance, type ComposeKeyTarget, type ComposeMoodGroup, type ComposeMoodId, type ComposeOptions, type ComposeResult, type ComposeStats, type ComposedNote, type ConsumedSyllable, type CoreEventHandlers, type CustomVocalDef, DAW_CSS, DEFAULT_BPM, DEFAULT_EDO, DEFAULT_GATE, DEFAULT_PAN, DEFAULT_PLAYBACK_VELOCITY, DEFAULT_SECTIONS, 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 DrumPatternDef, type DtmStudio, type DtmStudioEngines, type DtmStudioOptions, EDO31_NAMES, type Edo, type ExportMidiOptions, FADE_IN_MARK, FADE_OUT_MARK, type FadeScheduleParams, GM_INSTRUMENT_NAMES, INSTRUMENT_PRESETS, type InstrumentPreset, KEY_COUNT, KOE_BASE_URL, KOE_VOICEBANKS, KOE_VOICEBANK_LABELS, KOE_VOICEBANK_TERMS, type KeyMode, type KoeVoiceOptions, LinkedList, type LoopConfig, type LoopPoint, type LyricSyllable, type LyricSyllableKind, type LyricSyncData, type LyricTrack, type LyricsConductor, MACRO_STORAGE_KEYS, MAJOR_KEY_IDS, MAX_VOCAL_VOLUME, MICRO_STEP, MINOR_KEY_IDS, MMLCore, type MMLDisplayToken, type MMLNotePlacement, MML_END_MARKER, type MacroStorageKey, type MetricNote, type MetricOptions, type MidiExtraction, type MidiNote, type MidiNotePlacement, MidiSearchClient, type MidiSearchConfig, type MidiTrackAnalysis, type MmlMeta, type MmlPlayback, type MmlPlayerInstance, type MmlPlayerOptions, type ModeSwitchInstance, type ModeSwitchOptions, type MountChordPlayerOptions, type MountEditorOptions, type MountPlayerOptions, type Note, type NoteData, type NoteRemove, type OctaveUnisonMode, PITCH_ENCODING_VERSION, PITCH_MAP, PITCH_RANGE_END, PITCH_RANGE_START, PORTAMENTO_MARK, PREWARM_NOTES, type ParseMMLOptions, type ParseMidiFn, type ParsedMML, type PianoRollInstance, type PianoRollOptions, type PicotuneSearchParams, type PicotuneSong, type PitchSegment, type PitchToken, type PlacedSection, type PlayChordsOptions, type PlayDrumEvent, type PlayMmlOptions, type PlayNoteEvent, type PlayNoteOptions, type PlayPlacementsOptions, type PlaySingingMmlOptions, type PlaybackCue, type PlaybackState, type PresetSelectInstance, type PresetSelectOptions, type PreviewSoundCallback, REST_MARK, type RenderConfig, type Renderer, type ResolvedComposeKey, SECTION_LABELS, SECTION_ORDER, SECTION_SPECS, STOP_MARK, type SectionKind, type SectionSpec, type Sequencer, type SequencerOptions, type SequencerTrack, type SingingVoices, type SingingVoicesOptions, type StreamPlaybackOptions, type StreamVoiceNote, type StreamVoiceNoteOptions, type StreamVoiceTrack, type StructureFeatures, type Synth, TIE_MARK, TIE_MERGE_MAX_SEC, TRACKS_ADVANCED, TRACKS_SIMPLE, type TensionFeatures, type TieSourceNote, type ToolMode, type TrackConfig, UNITS_PER_EDO31_DEGREE, UNITS_PER_OCTAVE, UNITS_PER_SEMITONE, type Units, VIBRATO_MIN_SEC, VOICE_IMAGES, VOICE_IMAGE_KEY, type VoiceExpression, type VoiceModel, type VoiceRegistry, addUnits, analyzeMidiTracks, applyHarmonicFilter, applyMonophonic, band, buildChordPlacements, buildDrumPatternJson, buildNameToKeyMapping, buildSectionPlan, buildStreamVoiceNotes, chromaticStep, collectPitchTokens, complementarity, composeSong, concatFloat32, createAudioContext, createDtmStudio, createKlattVoice, createKoeVoice, createLyricsConductor, createPianoRoll, createRenderer, createSequencer, createSingingVoices, createSynth, createVoiceRegistry, decodeMml, decomposeToMonophonic, displayKana, durationEntropy, encodeMml, encodeWavPCM16, exportMIDI, extractDrumPatternFromNotes, extractMidiDrumPattern, extractMidiPlacements, extractMidiPlacementsByTrack, featureDistance, featureVector, fifthToStep, fifthToUnits, formatMmlMeta, freqFromPitch, generateRandomPattern, getComposeKeyDescription, getDrumPatternKeys, getMidiBPM, icon, injectStyles, isChordHeavyTrack, isNaturalLetter, isPlausibleMidiTranscription, isValidHttpUrl, keyCountFor, koeUrl, midiNote, midiToUnits, mountChordPlayer, mountDAW, mountMmlPlayer, naturalStep, normalizeDrumPatterns, normalizeLyrics, panToStereo, parseCustomVocals, parseLyrics, parseMML, parseMmlMeta, pitchV1ToUnits, playChords, playMML, playNote, playPlacements, playSingingMML, readMacroSections, readMacroSetting, resolveComposeKey, resolveDrumPattern, resolveLoopPoint, semitonesToUnits, shiftNotes, showLoadingOverlay, spelledToUnits, spellingToUnits, stripCustomVocals, stripLyrics, stripMmlMeta, structureFeatures, syllablesToText, tensionFeatures, transposeNotes, units, unitsPerRow, unitsPerStep, unitsToHz, unitsToMidi, unitsToMidiDetune, unitsToPitchV1, vocalVolumeToGain, writeMacroSections, writeMacroSetting };
3615
+ export { A4_HZ, A4_UNITS, type AddNoteOptions, type AnyDrumPattern, type ApplyChordOptions, BREATH_MARK, type Band, CENTS_PER_UNIT, COMPOSE_KEYS, COMPOSE_MOOD_GROUPS, CORPUS_BANDS, CORPUS_SIZE, type ChordPatternType, type ChordPlacement, type ChordPlayerInstance, type ComposeKeyTarget, type ComposeMoodGroup, type ComposeMoodId, type ComposeOptions, type ComposeResult, type ComposeStats, type ComposedNote, type ConsumedSyllable, type CoreEventHandlers, type CustomVocalDef, DAW_CSS, DEFAULT_BPM, DEFAULT_EDO, DEFAULT_GATE, DEFAULT_PAN, DEFAULT_PLAYBACK_VELOCITY, DEFAULT_SECTIONS, 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 DrumPatternDef, type DtmStudio, type DtmStudioEngines, type DtmStudioOptions, EDO31_NAMES, type Edo, type ExportMidiOptions, FADE_IN_MARK, FADE_OUT_MARK, type FadeScheduleParams, GLOBAL_STORAGE_KEYS, GM_INSTRUMENT_NAMES, type GlobalStorageKey, INSTRUMENT_PRESETS, type InstrumentPreset, KEY_COUNT, KOE_BASE_URL, KOE_VOICEBANKS, KOE_VOICEBANK_LABELS, KOE_VOICEBANK_TERMS, type KeyMode, type KoeVoiceOptions, LinkedList, type LoopConfig, type LoopPoint, type LyricSyllable, type LyricSyllableKind, type LyricSyncData, type LyricTrack, type LyricsConductor, MACRO_STORAGE_KEYS, MAJOR_KEY_IDS, MAX_VOCAL_VOLUME, MICRO_STEP, MINOR_KEY_IDS, MMLCore, type MMLDisplayToken, type MMLNotePlacement, MML_END_MARKER, type MacroStorageKey, type MetricNote, type MetricOptions, type MidiExtraction, type MidiNote, type MidiNotePlacement, MidiSearchClient, type MidiSearchConfig, type MidiTrackAnalysis, type MmlMeta, type MmlPlayback, type MmlPlayerInstance, type MmlPlayerOptions, type ModeSwitchInstance, type ModeSwitchOptions, type MountChordPlayerOptions, type MountEditorOptions, type MountPlayerOptions, type Note, type NoteData, type NoteRemove, type OctaveUnisonMode, PITCH_ENCODING_VERSION, PITCH_MAP, PITCH_RANGE_END, PITCH_RANGE_START, PORTAMENTO_MARK, PREWARM_NOTES, type ParseMMLOptions, type ParseMidiFn, type ParsedMML, type PianoRollInstance, type PianoRollOptions, type PicotuneSearchParams, type PicotuneSong, type PitchSegment, type PitchToken, type PlacedSection, type PlayChordsOptions, type PlayDrumEvent, type PlayMmlOptions, type PlayNoteEvent, type PlayNoteOptions, type PlayPlacementsOptions, type PlaySingingMmlOptions, type PlaybackCue, type PlaybackState, type PresetSelectInstance, type PresetSelectOptions, type PreviewSoundCallback, REST_MARK, type RenderConfig, type Renderer, type ResolvedComposeKey, SECTION_LABELS, SECTION_ORDER, SECTION_SPECS, STOP_MARK, type SectionKind, type SectionSpec, type Sequencer, type SequencerOptions, type SequencerTrack, type SingingVoices, type SingingVoicesOptions, type StreamPlaybackOptions, type StreamVoiceNote, type StreamVoiceNoteOptions, type StreamVoiceTrack, type StructureFeatures, type Synth, TIE_MARK, TIE_MERGE_MAX_SEC, TRACKS_ADVANCED, TRACKS_SIMPLE, type TensionFeatures, type TieSourceNote, type ToolMode, type TrackConfig, UNITS_PER_EDO31_DEGREE, UNITS_PER_OCTAVE, UNITS_PER_SEMITONE, type Units, VIBRATO_MIN_SEC, VOICE_IMAGES, VOICE_IMAGE_KEY, type VoiceExpression, type VoiceModel, type VoiceRegistry, addUnits, analyzeMidiTracks, applyHarmonicFilter, applyMonophonic, band, buildChordPlacements, buildDrumPatternJson, buildNameToKeyMapping, buildSectionPlan, buildStreamVoiceNotes, chromaticStep, collectPitchTokens, complementarity, composeSong, concatFloat32, createAudioContext, createDtmStudio, createKlattVoice, createKoeVoice, createLyricsConductor, createPianoRoll, createRenderer, createSequencer, createSingingVoices, createSynth, createVoiceRegistry, decodeMml, decomposeToMonophonic, displayKana, durationEntropy, encodeMml, encodeWavPCM16, exportMIDI, extractDrumPatternFromNotes, extractMidiDrumPattern, extractMidiPlacements, extractMidiPlacementsByTrack, featureDistance, featureVector, fifthToStep, fifthToUnits, formatMmlMeta, freqFromPitch, generateRandomPattern, getComposeKeyDescription, getDrumPatternKeys, getMidiBPM, icon, injectStyles, isChordHeavyTrack, isNaturalLetter, isPlausibleMidiTranscription, isValidHttpUrl, keyCountFor, koeUrl, midiNote, midiToUnits, mountChordPlayer, mountDAW, mountMmlPlayer, naturalStep, normalizeDrumPatterns, normalizeLyrics, panToStereo, parseCustomVocals, parseLyrics, parseMML, parseMmlMeta, pitchV1ToUnits, playChords, playMML, playNote, playPlacements, playSingingMML, readGlobalBool, readGlobalNumber, readGlobalSetting, readMacroSections, readMacroSetting, resolveComposeKey, resolveDrumPattern, resolveLoopPoint, semitonesToUnits, shiftNotes, showLoadingOverlay, spelledToUnits, spellingToUnits, stripCustomVocals, stripLyrics, stripMmlMeta, structureFeatures, syllablesToText, tensionFeatures, transposeNotes, units, unitsPerRow, unitsPerStep, unitsToHz, unitsToMidi, unitsToMidiDetune, unitsToPitchV1, vocalVolumeToGain, writeGlobalSetting, writeMacroSections, writeMacroSetting };
package/dist/index.d.ts CHANGED
@@ -2274,6 +2274,48 @@ declare const TRACKS_ADVANCED: TrackConfig[];
2274
2274
  */
2275
2275
  declare const mountDAW: (target: HTMLElement, options?: DawOptions) => DawInstance;
2276
2276
 
2277
+ /**
2278
+ * 全体トラック設定アコーディオン内で選択された設定値の localStorage 永続化
2279
+ *
2280
+ * 音律、ループ再生、全体音量、グルーコンプ、マスタリバーブ(量・Decay・PreDelay)、
2281
+ * マスタディレイ(量・音価)、フェードイン、フェードアウトの各設定を保持し、
2282
+ * 次回ロード時に復元できるようにする。
2283
+ */
2284
+ declare const GLOBAL_STORAGE_KEYS: {
2285
+ readonly edo: "dtm-global:edo";
2286
+ readonly loop: "dtm-global:loop";
2287
+ readonly masterVolume: "dtm-global:master-volume";
2288
+ readonly masterComp: "dtm-global:master-comp";
2289
+ readonly reverbAmount: "dtm-global:reverb-amount";
2290
+ readonly reverbDecay: "dtm-global:reverb-decay";
2291
+ readonly reverbPreDelay: "dtm-global:reverb-predelay";
2292
+ readonly delayAmount: "dtm-global:delay-amount";
2293
+ readonly delayDivision: "dtm-global:delay-division";
2294
+ readonly fadeIn: "dtm-global:fade-in";
2295
+ readonly fadeOut: "dtm-global:fade-out";
2296
+ };
2297
+ type GlobalStorageKey = keyof typeof GLOBAL_STORAGE_KEYS;
2298
+ /**
2299
+ * 全体トラック設定の単一項目を localStorage から取得する。
2300
+ * 未設定または localStorage にアクセスできない場合は null を返す。
2301
+ */
2302
+ declare const readGlobalSetting: (key: GlobalStorageKey) => string | null;
2303
+ /**
2304
+ * 全体トラック設定の単一項目を localStorage に保存する。
2305
+ * localStorage にアクセスできない環境や容量制限等は無視する。
2306
+ */
2307
+ declare const writeGlobalSetting: (key: GlobalStorageKey, value: string) => void;
2308
+ /**
2309
+ * 全体トラック設定の数値項目を localStorage から取得し、クランプして返す。
2310
+ * 未設定・パース失敗の場合は null を返す。
2311
+ */
2312
+ declare const readGlobalNumber: (key: GlobalStorageKey, min: number, max: number) => number | null;
2313
+ /**
2314
+ * 全体トラック設定の真偽値項目を localStorage から取得して返す。
2315
+ * 未設定・不正値の場合は null を返す。
2316
+ */
2317
+ declare const readGlobalBool: (key: GlobalStorageKey) => boolean | null;
2318
+
2277
2319
  /**
2278
2320
  * playMML — DOM非依存(ヘッドレス)の MML 再生関数。
2279
2321
  *
@@ -3570,4 +3612,4 @@ declare const encodeWavPCM16: (channels: Float32Array[], sampleRate: number) =>
3570
3612
  /** Float32Array のチャンクを1本へ連結する。 */
3571
3613
  declare const concatFloat32: (chunks: Float32Array[]) => Float32Array;
3572
3614
 
3573
- export { A4_HZ, A4_UNITS, type AddNoteOptions, type AnyDrumPattern, type ApplyChordOptions, BREATH_MARK, type Band, CENTS_PER_UNIT, COMPOSE_KEYS, COMPOSE_MOOD_GROUPS, CORPUS_BANDS, CORPUS_SIZE, type ChordPatternType, type ChordPlacement, type ChordPlayerInstance, type ComposeKeyTarget, type ComposeMoodGroup, type ComposeMoodId, type ComposeOptions, type ComposeResult, type ComposeStats, type ComposedNote, type ConsumedSyllable, type CoreEventHandlers, type CustomVocalDef, DAW_CSS, DEFAULT_BPM, DEFAULT_EDO, DEFAULT_GATE, DEFAULT_PAN, DEFAULT_PLAYBACK_VELOCITY, DEFAULT_SECTIONS, 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 DrumPatternDef, type DtmStudio, type DtmStudioEngines, type DtmStudioOptions, EDO31_NAMES, type Edo, type ExportMidiOptions, FADE_IN_MARK, FADE_OUT_MARK, type FadeScheduleParams, GM_INSTRUMENT_NAMES, INSTRUMENT_PRESETS, type InstrumentPreset, KEY_COUNT, KOE_BASE_URL, KOE_VOICEBANKS, KOE_VOICEBANK_LABELS, KOE_VOICEBANK_TERMS, type KeyMode, type KoeVoiceOptions, LinkedList, type LoopConfig, type LoopPoint, type LyricSyllable, type LyricSyllableKind, type LyricSyncData, type LyricTrack, type LyricsConductor, MACRO_STORAGE_KEYS, MAJOR_KEY_IDS, MAX_VOCAL_VOLUME, MICRO_STEP, MINOR_KEY_IDS, MMLCore, type MMLDisplayToken, type MMLNotePlacement, MML_END_MARKER, type MacroStorageKey, type MetricNote, type MetricOptions, type MidiExtraction, type MidiNote, type MidiNotePlacement, MidiSearchClient, type MidiSearchConfig, type MidiTrackAnalysis, type MmlMeta, type MmlPlayback, type MmlPlayerInstance, type MmlPlayerOptions, type ModeSwitchInstance, type ModeSwitchOptions, type MountChordPlayerOptions, type MountEditorOptions, type MountPlayerOptions, type Note, type NoteData, type NoteRemove, type OctaveUnisonMode, PITCH_ENCODING_VERSION, PITCH_MAP, PITCH_RANGE_END, PITCH_RANGE_START, PORTAMENTO_MARK, PREWARM_NOTES, type ParseMMLOptions, type ParseMidiFn, type ParsedMML, type PianoRollInstance, type PianoRollOptions, type PicotuneSearchParams, type PicotuneSong, type PitchSegment, type PitchToken, type PlacedSection, type PlayChordsOptions, type PlayDrumEvent, type PlayMmlOptions, type PlayNoteEvent, type PlayNoteOptions, type PlayPlacementsOptions, type PlaySingingMmlOptions, type PlaybackCue, type PlaybackState, type PresetSelectInstance, type PresetSelectOptions, type PreviewSoundCallback, REST_MARK, type RenderConfig, type Renderer, type ResolvedComposeKey, SECTION_LABELS, SECTION_ORDER, SECTION_SPECS, STOP_MARK, type SectionKind, type SectionSpec, type Sequencer, type SequencerOptions, type SequencerTrack, type SingingVoices, type SingingVoicesOptions, type StreamPlaybackOptions, type StreamVoiceNote, type StreamVoiceNoteOptions, type StreamVoiceTrack, type StructureFeatures, type Synth, TIE_MARK, TIE_MERGE_MAX_SEC, TRACKS_ADVANCED, TRACKS_SIMPLE, type TensionFeatures, type TieSourceNote, type ToolMode, type TrackConfig, UNITS_PER_EDO31_DEGREE, UNITS_PER_OCTAVE, UNITS_PER_SEMITONE, type Units, VIBRATO_MIN_SEC, VOICE_IMAGES, VOICE_IMAGE_KEY, type VoiceExpression, type VoiceModel, type VoiceRegistry, addUnits, analyzeMidiTracks, applyHarmonicFilter, applyMonophonic, band, buildChordPlacements, buildDrumPatternJson, buildNameToKeyMapping, buildSectionPlan, buildStreamVoiceNotes, chromaticStep, collectPitchTokens, complementarity, composeSong, concatFloat32, createAudioContext, createDtmStudio, createKlattVoice, createKoeVoice, createLyricsConductor, createPianoRoll, createRenderer, createSequencer, createSingingVoices, createSynth, createVoiceRegistry, decodeMml, decomposeToMonophonic, displayKana, durationEntropy, encodeMml, encodeWavPCM16, exportMIDI, extractDrumPatternFromNotes, extractMidiDrumPattern, extractMidiPlacements, extractMidiPlacementsByTrack, featureDistance, featureVector, fifthToStep, fifthToUnits, formatMmlMeta, freqFromPitch, generateRandomPattern, getComposeKeyDescription, getDrumPatternKeys, getMidiBPM, icon, injectStyles, isChordHeavyTrack, isNaturalLetter, isPlausibleMidiTranscription, isValidHttpUrl, keyCountFor, koeUrl, midiNote, midiToUnits, mountChordPlayer, mountDAW, mountMmlPlayer, naturalStep, normalizeDrumPatterns, normalizeLyrics, panToStereo, parseCustomVocals, parseLyrics, parseMML, parseMmlMeta, pitchV1ToUnits, playChords, playMML, playNote, playPlacements, playSingingMML, readMacroSections, readMacroSetting, resolveComposeKey, resolveDrumPattern, resolveLoopPoint, semitonesToUnits, shiftNotes, showLoadingOverlay, spelledToUnits, spellingToUnits, stripCustomVocals, stripLyrics, stripMmlMeta, structureFeatures, syllablesToText, tensionFeatures, transposeNotes, units, unitsPerRow, unitsPerStep, unitsToHz, unitsToMidi, unitsToMidiDetune, unitsToPitchV1, vocalVolumeToGain, writeMacroSections, writeMacroSetting };
3615
+ export { A4_HZ, A4_UNITS, type AddNoteOptions, type AnyDrumPattern, type ApplyChordOptions, BREATH_MARK, type Band, CENTS_PER_UNIT, COMPOSE_KEYS, COMPOSE_MOOD_GROUPS, CORPUS_BANDS, CORPUS_SIZE, type ChordPatternType, type ChordPlacement, type ChordPlayerInstance, type ComposeKeyTarget, type ComposeMoodGroup, type ComposeMoodId, type ComposeOptions, type ComposeResult, type ComposeStats, type ComposedNote, type ConsumedSyllable, type CoreEventHandlers, type CustomVocalDef, DAW_CSS, DEFAULT_BPM, DEFAULT_EDO, DEFAULT_GATE, DEFAULT_PAN, DEFAULT_PLAYBACK_VELOCITY, DEFAULT_SECTIONS, 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 DrumPatternDef, type DtmStudio, type DtmStudioEngines, type DtmStudioOptions, EDO31_NAMES, type Edo, type ExportMidiOptions, FADE_IN_MARK, FADE_OUT_MARK, type FadeScheduleParams, GLOBAL_STORAGE_KEYS, GM_INSTRUMENT_NAMES, type GlobalStorageKey, INSTRUMENT_PRESETS, type InstrumentPreset, KEY_COUNT, KOE_BASE_URL, KOE_VOICEBANKS, KOE_VOICEBANK_LABELS, KOE_VOICEBANK_TERMS, type KeyMode, type KoeVoiceOptions, LinkedList, type LoopConfig, type LoopPoint, type LyricSyllable, type LyricSyllableKind, type LyricSyncData, type LyricTrack, type LyricsConductor, MACRO_STORAGE_KEYS, MAJOR_KEY_IDS, MAX_VOCAL_VOLUME, MICRO_STEP, MINOR_KEY_IDS, MMLCore, type MMLDisplayToken, type MMLNotePlacement, MML_END_MARKER, type MacroStorageKey, type MetricNote, type MetricOptions, type MidiExtraction, type MidiNote, type MidiNotePlacement, MidiSearchClient, type MidiSearchConfig, type MidiTrackAnalysis, type MmlMeta, type MmlPlayback, type MmlPlayerInstance, type MmlPlayerOptions, type ModeSwitchInstance, type ModeSwitchOptions, type MountChordPlayerOptions, type MountEditorOptions, type MountPlayerOptions, type Note, type NoteData, type NoteRemove, type OctaveUnisonMode, PITCH_ENCODING_VERSION, PITCH_MAP, PITCH_RANGE_END, PITCH_RANGE_START, PORTAMENTO_MARK, PREWARM_NOTES, type ParseMMLOptions, type ParseMidiFn, type ParsedMML, type PianoRollInstance, type PianoRollOptions, type PicotuneSearchParams, type PicotuneSong, type PitchSegment, type PitchToken, type PlacedSection, type PlayChordsOptions, type PlayDrumEvent, type PlayMmlOptions, type PlayNoteEvent, type PlayNoteOptions, type PlayPlacementsOptions, type PlaySingingMmlOptions, type PlaybackCue, type PlaybackState, type PresetSelectInstance, type PresetSelectOptions, type PreviewSoundCallback, REST_MARK, type RenderConfig, type Renderer, type ResolvedComposeKey, SECTION_LABELS, SECTION_ORDER, SECTION_SPECS, STOP_MARK, type SectionKind, type SectionSpec, type Sequencer, type SequencerOptions, type SequencerTrack, type SingingVoices, type SingingVoicesOptions, type StreamPlaybackOptions, type StreamVoiceNote, type StreamVoiceNoteOptions, type StreamVoiceTrack, type StructureFeatures, type Synth, TIE_MARK, TIE_MERGE_MAX_SEC, TRACKS_ADVANCED, TRACKS_SIMPLE, type TensionFeatures, type TieSourceNote, type ToolMode, type TrackConfig, UNITS_PER_EDO31_DEGREE, UNITS_PER_OCTAVE, UNITS_PER_SEMITONE, type Units, VIBRATO_MIN_SEC, VOICE_IMAGES, VOICE_IMAGE_KEY, type VoiceExpression, type VoiceModel, type VoiceRegistry, addUnits, analyzeMidiTracks, applyHarmonicFilter, applyMonophonic, band, buildChordPlacements, buildDrumPatternJson, buildNameToKeyMapping, buildSectionPlan, buildStreamVoiceNotes, chromaticStep, collectPitchTokens, complementarity, composeSong, concatFloat32, createAudioContext, createDtmStudio, createKlattVoice, createKoeVoice, createLyricsConductor, createPianoRoll, createRenderer, createSequencer, createSingingVoices, createSynth, createVoiceRegistry, decodeMml, decomposeToMonophonic, displayKana, durationEntropy, encodeMml, encodeWavPCM16, exportMIDI, extractDrumPatternFromNotes, extractMidiDrumPattern, extractMidiPlacements, extractMidiPlacementsByTrack, featureDistance, featureVector, fifthToStep, fifthToUnits, formatMmlMeta, freqFromPitch, generateRandomPattern, getComposeKeyDescription, getDrumPatternKeys, getMidiBPM, icon, injectStyles, isChordHeavyTrack, isNaturalLetter, isPlausibleMidiTranscription, isValidHttpUrl, keyCountFor, koeUrl, midiNote, midiToUnits, mountChordPlayer, mountDAW, mountMmlPlayer, naturalStep, normalizeDrumPatterns, normalizeLyrics, panToStereo, parseCustomVocals, parseLyrics, parseMML, parseMmlMeta, pitchV1ToUnits, playChords, playMML, playNote, playPlacements, playSingingMML, readGlobalBool, readGlobalNumber, readGlobalSetting, readMacroSections, readMacroSetting, resolveComposeKey, resolveDrumPattern, resolveLoopPoint, semitonesToUnits, shiftNotes, showLoadingOverlay, spelledToUnits, spellingToUnits, stripCustomVocals, stripLyrics, stripMmlMeta, structureFeatures, syllablesToText, tensionFeatures, transposeNotes, units, unitsPerRow, unitsPerStep, unitsToHz, unitsToMidi, unitsToMidiDetune, unitsToPitchV1, vocalVolumeToGain, writeGlobalSetting, writeMacroSections, writeMacroSetting };
package/dist/index.js CHANGED
@@ -44,6 +44,7 @@ __export(index_exports, {
44
44
  EDO31_NAMES: () => EDO31_NAMES,
45
45
  FADE_IN_MARK: () => FADE_IN_MARK,
46
46
  FADE_OUT_MARK: () => FADE_OUT_MARK,
47
+ GLOBAL_STORAGE_KEYS: () => GLOBAL_STORAGE_KEYS,
47
48
  GM_INSTRUMENT_NAMES: () => GM_INSTRUMENT_NAMES,
48
49
  INSTRUMENT_PRESETS: () => INSTRUMENT_PRESETS,
49
50
  KEY_COUNT: () => KEY_COUNT,
@@ -155,6 +156,9 @@ __export(index_exports, {
155
156
  playNote: () => playNote,
156
157
  playPlacements: () => playPlacements,
157
158
  playSingingMML: () => playSingingMML,
159
+ readGlobalBool: () => readGlobalBool,
160
+ readGlobalNumber: () => readGlobalNumber,
161
+ readGlobalSetting: () => readGlobalSetting,
158
162
  readMacroSections: () => readMacroSections,
159
163
  readMacroSetting: () => readMacroSetting,
160
164
  resolveComposeKey: () => resolveComposeKey,
@@ -180,6 +184,7 @@ __export(index_exports, {
180
184
  unitsToMidiDetune: () => unitsToMidiDetune,
181
185
  unitsToPitchV1: () => unitsToPitchV1,
182
186
  vocalVolumeToGain: () => vocalVolumeToGain,
187
+ writeGlobalSetting: () => writeGlobalSetting,
183
188
  writeMacroSections: () => writeMacroSections,
184
189
  writeMacroSetting: () => writeMacroSetting
185
190
  });
@@ -18616,7 +18621,7 @@ var COMPOSE_INFO_HTML = `
18616
18621
  <tr><td>\u30A2\u30A6\u30C8\u30ED</td><td>\u6709\u308A</td><td>\u4F4E\u3081</td><td>\u8584\u3044</td><td>\u4E3B\u97F3\u3078\u7740\u5730</td></tr>
18617
18622
  </table>
18618
18623
  <p>\u30A4\u30F3\u30C8\u30ED\u3068\u9593\u594F\u306F\u30E1\u30ED\u30C7\u30A3\u3092\u66F8\u304D\u307E\u305B\u3093\uFF08\u4F34\u594F\u30FB\u30D9\u30FC\u30B9\u30FB\u30C9\u30E9\u30E0\u30FB\u30B5\u30D6\u30E1\u30ED\u3060\u3051\u304C\u9CF4\u308A\u307E\u3059\uFF09\u3002\u3053\u3053\u306B\u6B4C\u30E1\u30ED\u3092\u7F6E\u304F\u3068\u3001\u3069\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u3082\u540C\u3058\u9854\u306B\u306A\u3063\u3066\u300C\u305A\u3063\u3068\u6B4C\u3063\u3066\u3044\u308B\u66F2\u300D\u306B\u306A\u3063\u3066\u3057\u307E\u3046\u305F\u3081\u3067\u3059\u3002\u30BB\u30AF\u30B7\u30E7\u30F3\u306E\u982D\u3067\u306F\u30C9\u30E9\u30E0\u304C\u30AF\u30E9\u30C3\u30B7\u30E5\u3092\u53E9\u304D\u3001\u7D42\u308F\u308A\u306E1\u3064\u624B\u524D\u3067\u30D5\u30A3\u30EB\u304C\u5165\u308A\u307E\u3059\u3002</p>
18619
- <p>\u30CE\u30FC\u30C8\u3092\u914D\u7F6E\u3059\u308B\u3060\u3051\u3067\u3001\u697D\u5668\u30FB\u97F3\u91CF\u30FB\u30DF\u30C3\u30AF\u30B9\u306F\u5909\u3048\u307E\u305B\u3093\u3002\u97F3\u306E\u30D0\u30E9\u30F3\u30B9\u3092\u6574\u3048\u305F\u3044\u3068\u304D\u306F\u300C\u5168\u4F53\u30C8\u30E9\u30C3\u30AF\u8A2D\u5B9A\u300D\u306E<strong>\u304A\u307E\u304B\u305B\u30DE\u30B9\u30BF\u30EA\u30F3\u30B0</strong>\u3092\u7D9A\u3051\u3066\u62BC\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30B7\u30F3\u30D7\u30EB\u30E2\u30FC\u30C9\u306F\u30C8\u30E9\u30C3\u30AF\u305D\u306E\u3082\u306E\u304C\u5F79\u5272\uFF08\u30E1\u30ED\u30C7\u30A3\uFF0F\u30B5\u30D6\u30E1\u30ED\uFF0F\u30D9\u30FC\u30B9\uFF0F\u4F34\u594F\uFF09\u306A\u306E\u3067\u3001\u304A\u307E\u304B\u305B\u30DE\u30B9\u30BF\u30EA\u30F3\u30B0\u306F\u305D\u306E\u5F79\u5272\u3069\u304A\u308A\u306B\u697D\u5668\u3068\u97F3\u91CF\u3092\u5F53\u3066\u307E\u3059\u3002</p>
18624
+ <p>\u30CE\u30FC\u30C8\u306E\u914D\u7F6E\u306B\u52A0\u3048\u3066\u3001\u30C6\u30F3\u30DD\u30FB\u30C9\u30E9\u30E0\u30FB\u697D\u5668\u30FB<strong>\u304A\u307E\u304B\u305B\u30DE\u30B9\u30BF\u30EA\u30F3\u30B0</strong>\uFF08\u5404\u30C8\u30E9\u30C3\u30AF\u306E\u97F3\u91CF\u30D0\u30E9\u30F3\u30B9\u30FB\u5B9A\u4F4D\u30FBEQ\u30FB\u30B3\u30F3\u30D7\u30EC\u30C3\u30B5\u30FC\u30FB\u30EA\u30D0\u30FC\u30D6\u30FB\u30DE\u30B9\u30BF\u8A2D\u5B9A\uFF09\u3082\u81EA\u52D5\u3067\u4E00\u62EC\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002\u3067\u304D\u305F\u5F8C\u306B\u5FAE\u8ABF\u6574\u3057\u305F\u3044\u3068\u304D\u306F\u3001\u5404\u30C8\u30E9\u30C3\u30AF\u306E\u8A2D\u5B9A\u3084\u300C\u5168\u4F53\u30C8\u30E9\u30C3\u30AF\u8A2D\u5B9A\u300D\u304B\u3089\u81EA\u7531\u306B\u5909\u66F4\u3067\u304D\u307E\u3059\u3002</p>
18620
18625
  <h4>\u66F2\u306E\u7D44\u307F\u7ACB\u3066\u65B9</h4>
18621
18626
  <p>\u5358\u7D14\u306B\u30E9\u30F3\u30C0\u30E0\u306A\u97F3\u3092\u4E26\u3079\u3066\u3044\u308B\u308F\u3051\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\u6B21\u306E\u9806\u756A\u3067\u7D44\u307F\u7ACB\u3066\u3066\u3044\u307E\u3059\u3002</p>
18622
18627
  <ol>
@@ -22216,7 +22221,7 @@ var mountDAW = (target, options = {}) => {
22216
22221
  refs.autoMasterInfoBtn.addEventListener("click", () => {
22217
22222
  showModal("\u304A\u307E\u304B\u305B\u30DE\u30B9\u30BF\u30EA\u30F3\u30B0\u89E3\u8AAC", AUTO_MASTER_INFO_HTML);
22218
22223
  });
22219
- refs.autoMasterBtn.addEventListener("click", () => {
22224
+ const applyAutoMastering = () => {
22220
22225
  if (observedPlayMs >= PEAK_SAMPLE_MIN_PLAY_MS && observedPeakMax > 0) {
22221
22226
  const targetPeak = 0.5;
22222
22227
  const scale = targetPeak / observedPeakMax;
@@ -22369,6 +22374,9 @@ var mountDAW = (target, options = {}) => {
22369
22374
  }
22370
22375
  }
22371
22376
  updateTrackPanel();
22377
+ };
22378
+ refs.autoMasterBtn.addEventListener("click", () => {
22379
+ applyAutoMastering();
22372
22380
  });
22373
22381
  refs.drumSelect.addEventListener("change", () => {
22374
22382
  currentDrumPattern = refs.drumSelect.value;
@@ -22386,13 +22394,6 @@ var mountDAW = (target, options = {}) => {
22386
22394
  refs.macroComposeInfo.addEventListener("click", () => {
22387
22395
  showModal("\u4F5C\u66F2\u306E\u89E3\u8AAC", COMPOSE_INFO_HTML);
22388
22396
  });
22389
- const bassTracksForCompose = () => {
22390
- if (!isAdvanced) {
22391
- const t = trackStates.find((x2) => x2.config.id === "bass");
22392
- return t ? [t] : [];
22393
- }
22394
- return ADVANCED_COMPOSE_LAYOUT.filter((l) => l.part === "bass").map((l) => trackStates[l.index]).filter((t) => !!t);
22395
- };
22396
22397
  const selectedComposeTemplate = () => {
22397
22398
  const val = refs.composeTemplate?.value;
22398
22399
  return val && val !== "custom" ? val : void 0;
@@ -22627,10 +22628,6 @@ var mountDAW = (target, options = {}) => {
22627
22628
  autoComposeInstrument = song.instrument;
22628
22629
  options.onInstrumentChange?.(song.instrument);
22629
22630
  }
22630
- for (const t of bassTracksForCompose()) {
22631
- t.trackCompression = AUTO_ROLE_MIX.bass.compression;
22632
- options.onTrackCompressionChange?.(t.config.id, t.trackCompression);
22633
- }
22634
22631
  if (withVocal) {
22635
22632
  const melodyTrack = isAdvanced ? trackStates[0] : trackStates.find((t) => t.config.id === "melody");
22636
22633
  if (melodyTrack) {
@@ -22645,6 +22642,7 @@ var mountDAW = (target, options = {}) => {
22645
22642
  fireLyricsChange(melodyTrack);
22646
22643
  }
22647
22644
  }
22645
+ applyAutoMastering();
22648
22646
  if (refs.composeKeyHint) {
22649
22647
  refs.composeKeyHint.textContent = `${song.keyLabel} \u3067\u4F5C\u6210`;
22650
22648
  refs.composeKeyHint.title = `${song.keyLabel}${song.moodLabel ? `\uFF08${song.moodLabel}\uFF09` : ""}`;
@@ -23816,6 +23814,49 @@ var mountDAW = (target, options = {}) => {
23816
23814
  };
23817
23815
  };
23818
23816
 
23817
+ // src/global-state.ts
23818
+ var GLOBAL_STORAGE_KEYS = {
23819
+ edo: "dtm-global:edo",
23820
+ loop: "dtm-global:loop",
23821
+ masterVolume: "dtm-global:master-volume",
23822
+ masterComp: "dtm-global:master-comp",
23823
+ reverbAmount: "dtm-global:reverb-amount",
23824
+ reverbDecay: "dtm-global:reverb-decay",
23825
+ reverbPreDelay: "dtm-global:reverb-predelay",
23826
+ delayAmount: "dtm-global:delay-amount",
23827
+ delayDivision: "dtm-global:delay-division",
23828
+ fadeIn: "dtm-global:fade-in",
23829
+ fadeOut: "dtm-global:fade-out"
23830
+ };
23831
+ var readGlobalSetting = (key) => {
23832
+ try {
23833
+ if (typeof localStorage === "undefined" || !localStorage) return null;
23834
+ return localStorage.getItem(GLOBAL_STORAGE_KEYS[key]);
23835
+ } catch (_) {
23836
+ return null;
23837
+ }
23838
+ };
23839
+ var writeGlobalSetting = (key, value) => {
23840
+ try {
23841
+ if (typeof localStorage === "undefined" || !localStorage) return;
23842
+ localStorage.setItem(GLOBAL_STORAGE_KEYS[key], value);
23843
+ } catch (_) {
23844
+ }
23845
+ };
23846
+ var readGlobalNumber = (key, min, max) => {
23847
+ const raw = readGlobalSetting(key);
23848
+ if (raw === null) return null;
23849
+ const n = Number.parseFloat(raw);
23850
+ if (Number.isNaN(n)) return null;
23851
+ return Math.max(min, Math.min(max, n));
23852
+ };
23853
+ var readGlobalBool = (key) => {
23854
+ const raw = readGlobalSetting(key);
23855
+ if (raw === "1" || raw === "true") return true;
23856
+ if (raw === "0" || raw === "false") return false;
23857
+ return null;
23858
+ };
23859
+
23819
23860
  // src/headless-singing-player.ts
23820
23861
  var STEPS_PER_BEAT4 = 48;
23821
23862
  var STEPS_PER_BAR3 = 192;
@@ -25129,17 +25170,13 @@ var createDtmStudio = async (options = {}) => {
25129
25170
  }
25130
25171
  const select = doc.createElement("select");
25131
25172
  select.className = "dtm-select dtm-grow";
25132
- const autoOpt = doc.createElement("option");
25133
- autoOpt.value = "auto";
25134
- autoOpt.textContent = "\u2728 \u81EA\u52D5\uFF08\u66F2\u8ABF\u9023\u52D5\uFF09";
25135
- select.appendChild(autoOpt);
25136
25173
  for (const [key, p] of Object.entries(INSTRUMENT_PRESETS)) {
25137
25174
  const o = doc.createElement("option");
25138
25175
  o.value = key;
25139
25176
  o.textContent = p.displayName;
25140
25177
  select.appendChild(o);
25141
25178
  }
25142
- select.value = opts.value === "auto" || opts.value && INSTRUMENT_PRESETS[opts.value] ? opts.value : defaultPreset;
25179
+ select.value = opts.value && INSTRUMENT_PRESETS[opts.value] ? opts.value : defaultPreset;
25143
25180
  wrapper.appendChild(select);
25144
25181
  let busy = false;
25145
25182
  const onChange = async () => {
@@ -25148,10 +25185,6 @@ var createDtmStudio = async (options = {}) => {
25148
25185
  busy = true;
25149
25186
  const key = select.value;
25150
25187
  opts.onChange?.(key);
25151
- if (key === "auto") {
25152
- busy = false;
25153
- return;
25154
- }
25155
25188
  const trackIds = opts.getTrackIds?.() ?? [...TRACK_ROLES];
25156
25189
  const isAdvanced = trackIds.includes("t0");
25157
25190
  const mode = isAdvanced ? "advanced" : "simple";
@@ -25169,7 +25202,7 @@ var createDtmStudio = async (options = {}) => {
25169
25202
  element: wrapper,
25170
25203
  select,
25171
25204
  setValue: (k) => {
25172
- if (k === "auto" || INSTRUMENT_PRESETS[k]) select.value = k;
25205
+ if (INSTRUMENT_PRESETS[k]) select.value = k;
25173
25206
  },
25174
25207
  getValue: () => select.value,
25175
25208
  destroy: () => {
@@ -25262,13 +25295,6 @@ var createDtmStudio = async (options = {}) => {
25262
25295
  let daw;
25263
25296
  let presetSelect = null;
25264
25297
  const handleInstrumentChange = (key) => {
25265
- if (key === "auto") {
25266
- if (presetSelect) {
25267
- presetSelect.setValue("auto");
25268
- }
25269
- onInstrumentChange?.("auto");
25270
- return;
25271
- }
25272
25298
  editorPreset = key;
25273
25299
  if (presetSelect) {
25274
25300
  presetSelect.setValue(key);
@@ -26049,6 +26075,7 @@ var createDtmStudio = async (options = {}) => {
26049
26075
  EDO31_NAMES,
26050
26076
  FADE_IN_MARK,
26051
26077
  FADE_OUT_MARK,
26078
+ GLOBAL_STORAGE_KEYS,
26052
26079
  GM_INSTRUMENT_NAMES,
26053
26080
  INSTRUMENT_PRESETS,
26054
26081
  KEY_COUNT,
@@ -26160,6 +26187,9 @@ var createDtmStudio = async (options = {}) => {
26160
26187
  playNote,
26161
26188
  playPlacements,
26162
26189
  playSingingMML,
26190
+ readGlobalBool,
26191
+ readGlobalNumber,
26192
+ readGlobalSetting,
26163
26193
  readMacroSections,
26164
26194
  readMacroSetting,
26165
26195
  resolveComposeKey,
@@ -26185,6 +26215,7 @@ var createDtmStudio = async (options = {}) => {
26185
26215
  unitsToMidiDetune,
26186
26216
  unitsToPitchV1,
26187
26217
  vocalVolumeToGain,
26218
+ writeGlobalSetting,
26188
26219
  writeMacroSections,
26189
26220
  writeMacroSetting
26190
26221
  });
package/dist/index.mjs CHANGED
@@ -18429,7 +18429,7 @@ var COMPOSE_INFO_HTML = `
18429
18429
  <tr><td>\u30A2\u30A6\u30C8\u30ED</td><td>\u6709\u308A</td><td>\u4F4E\u3081</td><td>\u8584\u3044</td><td>\u4E3B\u97F3\u3078\u7740\u5730</td></tr>
18430
18430
  </table>
18431
18431
  <p>\u30A4\u30F3\u30C8\u30ED\u3068\u9593\u594F\u306F\u30E1\u30ED\u30C7\u30A3\u3092\u66F8\u304D\u307E\u305B\u3093\uFF08\u4F34\u594F\u30FB\u30D9\u30FC\u30B9\u30FB\u30C9\u30E9\u30E0\u30FB\u30B5\u30D6\u30E1\u30ED\u3060\u3051\u304C\u9CF4\u308A\u307E\u3059\uFF09\u3002\u3053\u3053\u306B\u6B4C\u30E1\u30ED\u3092\u7F6E\u304F\u3068\u3001\u3069\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u3082\u540C\u3058\u9854\u306B\u306A\u3063\u3066\u300C\u305A\u3063\u3068\u6B4C\u3063\u3066\u3044\u308B\u66F2\u300D\u306B\u306A\u3063\u3066\u3057\u307E\u3046\u305F\u3081\u3067\u3059\u3002\u30BB\u30AF\u30B7\u30E7\u30F3\u306E\u982D\u3067\u306F\u30C9\u30E9\u30E0\u304C\u30AF\u30E9\u30C3\u30B7\u30E5\u3092\u53E9\u304D\u3001\u7D42\u308F\u308A\u306E1\u3064\u624B\u524D\u3067\u30D5\u30A3\u30EB\u304C\u5165\u308A\u307E\u3059\u3002</p>
18432
- <p>\u30CE\u30FC\u30C8\u3092\u914D\u7F6E\u3059\u308B\u3060\u3051\u3067\u3001\u697D\u5668\u30FB\u97F3\u91CF\u30FB\u30DF\u30C3\u30AF\u30B9\u306F\u5909\u3048\u307E\u305B\u3093\u3002\u97F3\u306E\u30D0\u30E9\u30F3\u30B9\u3092\u6574\u3048\u305F\u3044\u3068\u304D\u306F\u300C\u5168\u4F53\u30C8\u30E9\u30C3\u30AF\u8A2D\u5B9A\u300D\u306E<strong>\u304A\u307E\u304B\u305B\u30DE\u30B9\u30BF\u30EA\u30F3\u30B0</strong>\u3092\u7D9A\u3051\u3066\u62BC\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30B7\u30F3\u30D7\u30EB\u30E2\u30FC\u30C9\u306F\u30C8\u30E9\u30C3\u30AF\u305D\u306E\u3082\u306E\u304C\u5F79\u5272\uFF08\u30E1\u30ED\u30C7\u30A3\uFF0F\u30B5\u30D6\u30E1\u30ED\uFF0F\u30D9\u30FC\u30B9\uFF0F\u4F34\u594F\uFF09\u306A\u306E\u3067\u3001\u304A\u307E\u304B\u305B\u30DE\u30B9\u30BF\u30EA\u30F3\u30B0\u306F\u305D\u306E\u5F79\u5272\u3069\u304A\u308A\u306B\u697D\u5668\u3068\u97F3\u91CF\u3092\u5F53\u3066\u307E\u3059\u3002</p>
18432
+ <p>\u30CE\u30FC\u30C8\u306E\u914D\u7F6E\u306B\u52A0\u3048\u3066\u3001\u30C6\u30F3\u30DD\u30FB\u30C9\u30E9\u30E0\u30FB\u697D\u5668\u30FB<strong>\u304A\u307E\u304B\u305B\u30DE\u30B9\u30BF\u30EA\u30F3\u30B0</strong>\uFF08\u5404\u30C8\u30E9\u30C3\u30AF\u306E\u97F3\u91CF\u30D0\u30E9\u30F3\u30B9\u30FB\u5B9A\u4F4D\u30FBEQ\u30FB\u30B3\u30F3\u30D7\u30EC\u30C3\u30B5\u30FC\u30FB\u30EA\u30D0\u30FC\u30D6\u30FB\u30DE\u30B9\u30BF\u8A2D\u5B9A\uFF09\u3082\u81EA\u52D5\u3067\u4E00\u62EC\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002\u3067\u304D\u305F\u5F8C\u306B\u5FAE\u8ABF\u6574\u3057\u305F\u3044\u3068\u304D\u306F\u3001\u5404\u30C8\u30E9\u30C3\u30AF\u306E\u8A2D\u5B9A\u3084\u300C\u5168\u4F53\u30C8\u30E9\u30C3\u30AF\u8A2D\u5B9A\u300D\u304B\u3089\u81EA\u7531\u306B\u5909\u66F4\u3067\u304D\u307E\u3059\u3002</p>
18433
18433
  <h4>\u66F2\u306E\u7D44\u307F\u7ACB\u3066\u65B9</h4>
18434
18434
  <p>\u5358\u7D14\u306B\u30E9\u30F3\u30C0\u30E0\u306A\u97F3\u3092\u4E26\u3079\u3066\u3044\u308B\u308F\u3051\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\u6B21\u306E\u9806\u756A\u3067\u7D44\u307F\u7ACB\u3066\u3066\u3044\u307E\u3059\u3002</p>
18435
18435
  <ol>
@@ -22029,7 +22029,7 @@ var mountDAW = (target, options = {}) => {
22029
22029
  refs.autoMasterInfoBtn.addEventListener("click", () => {
22030
22030
  showModal("\u304A\u307E\u304B\u305B\u30DE\u30B9\u30BF\u30EA\u30F3\u30B0\u89E3\u8AAC", AUTO_MASTER_INFO_HTML);
22031
22031
  });
22032
- refs.autoMasterBtn.addEventListener("click", () => {
22032
+ const applyAutoMastering = () => {
22033
22033
  if (observedPlayMs >= PEAK_SAMPLE_MIN_PLAY_MS && observedPeakMax > 0) {
22034
22034
  const targetPeak = 0.5;
22035
22035
  const scale = targetPeak / observedPeakMax;
@@ -22182,6 +22182,9 @@ var mountDAW = (target, options = {}) => {
22182
22182
  }
22183
22183
  }
22184
22184
  updateTrackPanel();
22185
+ };
22186
+ refs.autoMasterBtn.addEventListener("click", () => {
22187
+ applyAutoMastering();
22185
22188
  });
22186
22189
  refs.drumSelect.addEventListener("change", () => {
22187
22190
  currentDrumPattern = refs.drumSelect.value;
@@ -22199,13 +22202,6 @@ var mountDAW = (target, options = {}) => {
22199
22202
  refs.macroComposeInfo.addEventListener("click", () => {
22200
22203
  showModal("\u4F5C\u66F2\u306E\u89E3\u8AAC", COMPOSE_INFO_HTML);
22201
22204
  });
22202
- const bassTracksForCompose = () => {
22203
- if (!isAdvanced) {
22204
- const t = trackStates.find((x2) => x2.config.id === "bass");
22205
- return t ? [t] : [];
22206
- }
22207
- return ADVANCED_COMPOSE_LAYOUT.filter((l) => l.part === "bass").map((l) => trackStates[l.index]).filter((t) => !!t);
22208
- };
22209
22205
  const selectedComposeTemplate = () => {
22210
22206
  const val = refs.composeTemplate?.value;
22211
22207
  return val && val !== "custom" ? val : void 0;
@@ -22440,10 +22436,6 @@ var mountDAW = (target, options = {}) => {
22440
22436
  autoComposeInstrument = song.instrument;
22441
22437
  options.onInstrumentChange?.(song.instrument);
22442
22438
  }
22443
- for (const t of bassTracksForCompose()) {
22444
- t.trackCompression = AUTO_ROLE_MIX.bass.compression;
22445
- options.onTrackCompressionChange?.(t.config.id, t.trackCompression);
22446
- }
22447
22439
  if (withVocal) {
22448
22440
  const melodyTrack = isAdvanced ? trackStates[0] : trackStates.find((t) => t.config.id === "melody");
22449
22441
  if (melodyTrack) {
@@ -22458,6 +22450,7 @@ var mountDAW = (target, options = {}) => {
22458
22450
  fireLyricsChange(melodyTrack);
22459
22451
  }
22460
22452
  }
22453
+ applyAutoMastering();
22461
22454
  if (refs.composeKeyHint) {
22462
22455
  refs.composeKeyHint.textContent = `${song.keyLabel} \u3067\u4F5C\u6210`;
22463
22456
  refs.composeKeyHint.title = `${song.keyLabel}${song.moodLabel ? `\uFF08${song.moodLabel}\uFF09` : ""}`;
@@ -23629,6 +23622,49 @@ var mountDAW = (target, options = {}) => {
23629
23622
  };
23630
23623
  };
23631
23624
 
23625
+ // src/global-state.ts
23626
+ var GLOBAL_STORAGE_KEYS = {
23627
+ edo: "dtm-global:edo",
23628
+ loop: "dtm-global:loop",
23629
+ masterVolume: "dtm-global:master-volume",
23630
+ masterComp: "dtm-global:master-comp",
23631
+ reverbAmount: "dtm-global:reverb-amount",
23632
+ reverbDecay: "dtm-global:reverb-decay",
23633
+ reverbPreDelay: "dtm-global:reverb-predelay",
23634
+ delayAmount: "dtm-global:delay-amount",
23635
+ delayDivision: "dtm-global:delay-division",
23636
+ fadeIn: "dtm-global:fade-in",
23637
+ fadeOut: "dtm-global:fade-out"
23638
+ };
23639
+ var readGlobalSetting = (key) => {
23640
+ try {
23641
+ if (typeof localStorage === "undefined" || !localStorage) return null;
23642
+ return localStorage.getItem(GLOBAL_STORAGE_KEYS[key]);
23643
+ } catch (_) {
23644
+ return null;
23645
+ }
23646
+ };
23647
+ var writeGlobalSetting = (key, value) => {
23648
+ try {
23649
+ if (typeof localStorage === "undefined" || !localStorage) return;
23650
+ localStorage.setItem(GLOBAL_STORAGE_KEYS[key], value);
23651
+ } catch (_) {
23652
+ }
23653
+ };
23654
+ var readGlobalNumber = (key, min, max) => {
23655
+ const raw = readGlobalSetting(key);
23656
+ if (raw === null) return null;
23657
+ const n = Number.parseFloat(raw);
23658
+ if (Number.isNaN(n)) return null;
23659
+ return Math.max(min, Math.min(max, n));
23660
+ };
23661
+ var readGlobalBool = (key) => {
23662
+ const raw = readGlobalSetting(key);
23663
+ if (raw === "1" || raw === "true") return true;
23664
+ if (raw === "0" || raw === "false") return false;
23665
+ return null;
23666
+ };
23667
+
23632
23668
  // src/headless-singing-player.ts
23633
23669
  var STEPS_PER_BEAT4 = 48;
23634
23670
  var STEPS_PER_BAR3 = 192;
@@ -24941,17 +24977,13 @@ var createDtmStudio = async (options = {}) => {
24941
24977
  }
24942
24978
  const select = doc.createElement("select");
24943
24979
  select.className = "dtm-select dtm-grow";
24944
- const autoOpt = doc.createElement("option");
24945
- autoOpt.value = "auto";
24946
- autoOpt.textContent = "\u2728 \u81EA\u52D5\uFF08\u66F2\u8ABF\u9023\u52D5\uFF09";
24947
- select.appendChild(autoOpt);
24948
24980
  for (const [key, p] of Object.entries(INSTRUMENT_PRESETS)) {
24949
24981
  const o = doc.createElement("option");
24950
24982
  o.value = key;
24951
24983
  o.textContent = p.displayName;
24952
24984
  select.appendChild(o);
24953
24985
  }
24954
- select.value = opts.value === "auto" || opts.value && INSTRUMENT_PRESETS[opts.value] ? opts.value : defaultPreset;
24986
+ select.value = opts.value && INSTRUMENT_PRESETS[opts.value] ? opts.value : defaultPreset;
24955
24987
  wrapper.appendChild(select);
24956
24988
  let busy = false;
24957
24989
  const onChange = async () => {
@@ -24960,10 +24992,6 @@ var createDtmStudio = async (options = {}) => {
24960
24992
  busy = true;
24961
24993
  const key = select.value;
24962
24994
  opts.onChange?.(key);
24963
- if (key === "auto") {
24964
- busy = false;
24965
- return;
24966
- }
24967
24995
  const trackIds = opts.getTrackIds?.() ?? [...TRACK_ROLES];
24968
24996
  const isAdvanced = trackIds.includes("t0");
24969
24997
  const mode = isAdvanced ? "advanced" : "simple";
@@ -24981,7 +25009,7 @@ var createDtmStudio = async (options = {}) => {
24981
25009
  element: wrapper,
24982
25010
  select,
24983
25011
  setValue: (k) => {
24984
- if (k === "auto" || INSTRUMENT_PRESETS[k]) select.value = k;
25012
+ if (INSTRUMENT_PRESETS[k]) select.value = k;
24985
25013
  },
24986
25014
  getValue: () => select.value,
24987
25015
  destroy: () => {
@@ -25074,13 +25102,6 @@ var createDtmStudio = async (options = {}) => {
25074
25102
  let daw;
25075
25103
  let presetSelect = null;
25076
25104
  const handleInstrumentChange = (key) => {
25077
- if (key === "auto") {
25078
- if (presetSelect) {
25079
- presetSelect.setValue("auto");
25080
- }
25081
- onInstrumentChange?.("auto");
25082
- return;
25083
- }
25084
25105
  editorPreset = key;
25085
25106
  if (presetSelect) {
25086
25107
  presetSelect.setValue(key);
@@ -25860,6 +25881,7 @@ export {
25860
25881
  EDO31_NAMES,
25861
25882
  FADE_IN_MARK,
25862
25883
  FADE_OUT_MARK,
25884
+ GLOBAL_STORAGE_KEYS,
25863
25885
  GM_INSTRUMENT_NAMES,
25864
25886
  INSTRUMENT_PRESETS,
25865
25887
  KEY_COUNT,
@@ -25971,6 +25993,9 @@ export {
25971
25993
  playNote,
25972
25994
  playPlacements,
25973
25995
  playSingingMML,
25996
+ readGlobalBool,
25997
+ readGlobalNumber,
25998
+ readGlobalSetting,
25974
25999
  readMacroSections,
25975
26000
  readMacroSetting,
25976
26001
  resolveComposeKey,
@@ -25996,6 +26021,7 @@ export {
25996
26021
  unitsToMidiDetune,
25997
26022
  unitsToPitchV1,
25998
26023
  vocalVolumeToGain,
26024
+ writeGlobalSetting,
25999
26025
  writeMacroSections,
26000
26026
  writeMacroSetting
26001
26027
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "author": "onjmin",
3
3
  "license": "MIT",
4
4
  "name": "@onjmin/dtm",
5
- "version": "2.1.5",
5
+ "version": "2.1.6",
6
6
  "description": "MMLを中間言語に用いた、モバイルファーストなDAW / ピアノロール打ち込みコンポーネント",
7
7
  "homepage": "https://onjmin.github.io/dtm",
8
8
  "repository": {