@onjmin/dtm
    Preparing search index...

    Type Alias ComposeOptions

    type ComposeOptions = {
        baseKey?: string;
        drawCount?: number;
        edo?: number;
        form?: string;
        random?: () => number;
        recent?: number[][];
        scale?: string;
        sections?: SectionKind[];
        stepsPerBar: number;
        template?: string;
    }
    Index

    Properties

    baseKey?: string

    ベースとなる調・雰囲気の指定("any" | "major" | "minor" | "mood_" | "key_")。 省略時は "any"(全24調からランダム抽選)。

    drawCount?: number

    引く候補の数。既定 DRAW_COUNT。

    edo?: number

    曲の音律。省略時は12平均律。

    form?: string

    展開の仕方("auto" | "motif" | "ostinato")。省略時は "auto" で曲ごとに引く。 "ostinato" は同じ型を曲全体で回すリフ主体の作り。MelodyForm

    random?: () => number

    乱数源。テストから決定的な値を注入するために差し替えられる。

    recent?: number[][]

    直近に作った曲の特徴ベクトル(ComposeStats.fingerprint)。指標に最適化すると 全曲が同じ統計値へ寄るので、それらから離れている候補に加点する(WEIGHTS.novelty)。

    scale?: string

    音階の指定("auto" | "any" | 音階ID)。"auto" はベース調の長短に合わせて 陽音階(長調)/民謡音階(短調)を使う。COMPOSE_SCALES

    sections?: SectionKind[]

    作るセクション。省略時は DEFAULT_SECTIONS。並び順は指定によらず SECTION_ORDER に従う。

    stepsPerBar: number

    1小節のステップ数。DAW の renderConfig.stepsPerBar をそのまま渡す。

    template?: string

    曲構成テンプレート名("1chorus" | "jpop_standard" | "jpop_drop" | "vocaloid" | "verse_chorus" | "game_loop")。 指定時は sections より優先され、2コーラスやCメロ、落ちサビなどの王道構成を展開する。