@onjmin/dtm
    Preparing search index...

    Type Alias DtmStudio

    type DtmStudio = {
        audioContext: AudioContext;
        defaultPreset: string;
        dispose: () => void;
        loadPreset: (presetKey: string, trackIds?: string[]) => Promise<void>;
        mountEditor: (
            target: HTMLElement,
            options?: MountEditorOptions,
        ) => DawInstance;
        mountModeSwitch: (
            target: HTMLElement,
            options: ModeSwitchOptions,
        ) => ModeSwitchInstance;
        mountPlayer: (
            target: HTMLElement,
            mml: string,
            options?: MountPlayerOptions,
        ) => MmlPlayerInstance;
        mountPresetSelect: (
            target: HTMLElement,
            options: PresetSelectOptions,
        ) => PresetSelectInstance;
        singingVoices: SingingVoices;
    }
    Index

    Properties

    audioContext: AudioContext

    内部で使用している AudioContext。

    defaultPreset: string

    既定の楽器プリセットキー(options.defaultPreset ?? "retro_game")。

    dispose: () => void

    AudioContext を閉じ、生成物を破棄する。

    loadPreset: (presetKey: string, trackIds?: string[]) => Promise<void>

    楽器プリセットを(指定トラックぶん)ロードする。

    mountEditor: (target: HTMLElement, options?: MountEditorOptions) => DawInstance

    編集UI(mountDAW)を音・歌声込みでマウントする。

    mountModeSwitch: (
        target: HTMLElement,
        options: ModeSwitchOptions,
    ) => ModeSwitchInstance

    モード切替UI(SIMPLE/ADVANCED)を target に差し込み、編集UIのマウントごと面倒を見る。 切替時に「最新MML取り込み→destroy→新トラック構成で再マウント→MML復元」まで内部で行う。 getDaw() で現在の DawInstance を取得できる(mountPresetSelect の getDaw に渡せる)。

    mountPlayer: (
        target: HTMLElement,
        mml: string,
        options?: MountPlayerOptions,
    ) => MmlPlayerInstance

    再生専用UI(mountMmlPlayer)を音・歌声込みでマウントする。

    mountPresetSelect: (
        target: HTMLElement,
        options: PresetSelectOptions,
    ) => PresetSelectInstance

    楽器プリセット選択UI(INSTRUMENT)を target に差し込む。 変更時に内部で setInstrument+loadPreset(再生中なら一旦停止→再開)まで配線する。 編集UIの外側に独自配置したいライブラリ利用者向け(mountEditor の presetUI と同等)。

    singingVoices: SingingVoices

    歌声合成ヘルパ(klatt + koe音源)。