Skip to content

Option Relationships

This document describes the relationships between SongConfig options in MIDI Sketch.

Relationship Types

Options have the following relationships:

  • Dependency: Child options are ignored unless parent option is enabled
  • Priority: Special values (like 0) override other settings
  • Conflict: Certain combinations cause validation errors
  • Implicit: Setting one option automatically configures internal parameters

Why This Matters

Understanding these relationships helps you avoid unexpected behavior. For example, setting arpeggioPattern=2 has no effect if arpeggioEnabled=false.


1. Dependency Relationships

1.1 Call System

ParentChildDescription
callEnabled=trueintroChantType of intro chant section
callEnabled=truemixPatternType of MIX section
callEnabled=truecallDensityCall density in chorus
callEnabled=truecallNotesEnabledOutput calls as MIDI notes

1.2 Arpeggio

ParentChildDescription
arpeggioEnabled=truearpeggioPatternUp/Down/UpDown/Random/Pinwheel/PedalRoot/Alberti/BrokenChord (0-7)
arpeggioEnabled=truearpeggioSpeedEighth/Sixteenth/Triplet
arpeggioEnabled=truearpeggioOctaveRange1-3 octaves
arpeggioEnabled=truearpeggioGateGate length (0-100)
arpeggioEnabled=truearpeggioSyncChordSync with chord changes

1.3 Humanization

ParentChildDescription
humanize=truehumanizeTimingTiming variation (0-100)
humanize=truehumanizeVelocityVelocity variation (0-100)

1.4 Chord Extensions

ParentChildDescription
chordExtSus=truechordExtSusProbSus probability (0-100)
chordExt7th=truechordExt7thProb7th probability (0-100)
chordExt9th=truechordExt9thProb9th probability (0-100)
chordExtTritoneSub=truechordExtTritoneSubProbTritone sub probability (0-100, AccompanimentConfig only)

1.5 Modulation

ParentChildDescription
modulationTiming != NonemodulationSemitonesModulation amount (1-4 semitones)
modulationSemitones > 0(internal) effective_vocal_highAuto-adjusted to fit post-modulation range

Notes:

  • When modulationTiming=None, modulationSemitones is not validated
  • Vocal range auto-adjustment: When modulation is enabled, effective_vocal_high = vocal_high - modulation_semitones ensures vocal stays in range post-modulation
  • Works in all CompositionStyles: Modulation is effective in BGM modes (BackgroundMotif, SynthDriven) as well

1.6 Vocal (skipVocal exclusion)

ConditionEffective OptionsUse Case
skipVocal=falseAll vocal-related optionsNormal song generation
skipVocal=trueAll vocal options are ignoredBGM-only generation (no vocal)

No Vocal Recovery

There is no API to add vocals after BGM-only generation. If you need vocals, use compositionStyle=MelodyLead or the Vocal-First workflow (see JavaScript API).

1.7 Syncopation

ParentChildDescription
enableSyncopation=truevocalGroove syncopation effectsWhen false, syncopation weight=0.0 even with Syncopated groove
enableSyncopation=falsesyncopation_prob=0.0Syncopation probability forced to zero
enableSyncopation=falseallow_bar_crossing=falseBar crossing forced off

Notes: Timing offsets (e.g., +30 ticks for OffBeat) are applied regardless of enableSyncopation. Only the syncopation-specific weighting is affected.

1.8 Explicit Flags

ParentChildDescription
moodExplicit=truemood (0-23)Mood field is used directly; when false, mood is derived from stylePresetId
formExplicit=trueformIdForm is used exactly as specified; when false, Blueprint/randomization may override
chordExtProbExplicit=trueChord extension probabilitiesMood-based chord extension probability auto-adjustment is suppressed
drumsEnabledExplicit=truedrumsEnabledExplicit drum control; required to disable drums on drums_required blueprints

1.9 Blueprint ID 9 (BehavioralLoop)

ParentChildDescription
blueprintId=9addictive_mode=trueInternal addictive mode activated
addictive_mode=trueHookIntensity=MaximumHook intensity forced to maximum (internal level 4)
addictive_mode=trueRiffPolicy=LockedPitchRiff policy forced to locked pitch

2. CompositionStyle Branching

The value of compositionStyle determines which tracks are generated and which options are effective:

2.1 MelodyLead (0) - Default

Generated tracks: Vocal → Aux → Motif (Blueprint-dependent) → Bass → Chord → Guitar → Arpeggio (if enabled) → Drums → SE

2.2 BackgroundMotif (1) - BGM-Only Mode

Generated tracks:

arpeggioEnabledGenerated Tracks
falseAux + Motif + Bass + Chord + Guitar + Drums
trueAux + Motif + Bass + Chord + Guitar + Drums + Arpeggio

2.3 SynthDriven (2) - BGM-Only Mode

Generated tracks: Motif (Blueprint-dependent) + Bass + Chord + Guitar + Arpeggio (if enabled) + Drums

Choosing CompositionStyle

  • MelodyLead: For songs with vocals (pop, rock, ballad)
  • BackgroundMotif: For instrumental BGM with repeating melodic patterns (game music, ambient)
  • SynthDriven: For electronic/synth-driven instrumental tracks

3. Priority (Special Value Overrides)

OptionSpecial ValueBehavior
bpm0Use style preset's default BPM
seed0Auto-generate random seed
targetDurationSeconds0Use structure pattern from formId
vocalStyle0 (Auto)Random selection based on style
melodyTemplate0 (Auto)Default selection based on style
driveFeel50Neutral (0=laid-back, 100=aggressive)
moraRhythmMode2 (Auto)Auto-select from VocalStylePreset

driveFeel Details

ValueEffect
0Laid-back: timing delay, lower velocity
50Neutral: standard timing (default)
100Aggressive: timing push, higher velocity, syncopation boost (when enableSyncopation=true)

energyCurve Values

ValueNameEffect
0GradualBuildGradual energy buildup (default)
1FrontLoadedHigh energy at start, calms down later
2WavePatternWave-like energy progression
3SteadyStateMaintains constant energy level

Using Zero Values

Zero often means "auto" or "use default". This is useful when you want style-appropriate defaults without specifying exact values.

Flowchart


4. Melody Overrides

Melody overrides are applied after VocalStylePreset and MelodicComplexity processing. Sentinel values (0, 0xFF, or -128 depending on the parameter) mean "use preset default".

4.1 Melody Override Parameters

ParameterRangeDefaultDescription
melodyMaxLeap0=preset, 1-120Maximum interval leap (semitones)
melodySyncopationProb0-100, 0xFF=preset0xFFSyncopation probability (%)
melodyPhraseLength0=preset, 1-80Phrase length (bars)
melodyLongNoteRatio0-100, 0xFF=preset0xFFLong note ratio (%)
melodyChorusRegisterShift-12 to +12, -128=preset-128Chorus register shift (semitones)
melodyHookRepetition0=preset, 1=off, 2=on0Hook repetition pattern
melodyUseLeadingTone0=preset, 1=off, 2=on0Leading tone insertion at section boundaries

4.2 Tri-State Parameters

melodyHookRepetition and melodyUseLeadingTone use a tri-state design:

ValueMeaning
0Use preset/VocalStylePreset value (default)
1Explicitly OFF
2Explicitly ON

4.3 Preset-Only Parameters (No Override)

The following are controlled by VocalStylePreset only and have no SongConfig override:

  • chorus_long_tones: Long notes in chorus (active for Idol/Rock/Anime etc.)
  • allow_bar_crossing: Allow notes crossing bar lines (active for Vocaloid/Rock/Anime etc.)
  • allow_unison_repeat: Allow consecutive same-pitch notes (default true)

5. Motif Overrides

Motif overrides control the melodic motif generation parameters in BackgroundMotif mode and Blueprint-based motif sections.

5.1 Motif Override Parameters

ParameterRangeDefaultDescription
motifLength0=auto, 1/2/40Motif length (beats)
motifNoteCount0=auto, 3-80Number of notes in motif
motifMotion0xFF=preset, 0-40xFFPitch motion type
motifRegisterHigh0=auto, 1=low, 2=high0Register (0=mid range)
motifRhythmDensity0xFF=preset, 0-20xFFRhythm density

5.2 MotifMotion Values

ValueNameDescription
0StepwiseScale steps only (2nds)
1GentleLeapUp to 3rds
2WideLeapUp to 5ths
3NarrowStepNarrow scale degrees (jazzy)
4DisjunctIrregular leaps (experimental)
5OstinatoSame pitch class repetition (internal Blueprint only, not available via API)

Ostinato Motion

motifMotion=5 (Ostinato) is reserved for internal Blueprint definitions. The API exposes values 0-4 only. Values above 4 are clamped to 4 via min(val, 4).

5.3 MotifRhythmDensity Values

ValueNameDescription
0SparseLow density pattern
1MediumStandard density
2DrivingHigh density pattern

6. Validation Conflicts

6.1 Parameter Valid Ranges

ParameterValid RangeError Code
stylePresetId0-16INVALID_STYLE
key0-11INVALID_KEY
bpm0, 40-240INVALID_BPM
chordProgressionId0-21INVALID_CHORD
formId0-17INVALID_FORM
vocalAttitudeStyle-dependent (allowedAttitudes bitmask)INVALID_ATTITUDE
vocalLow, vocalHigh36-96, low ≤ highINVALID_VOCAL_RANGE
compositionStyle0-2INVALID_COMPOSITION_STYLE
vocalStyle0-13INVALID_VOCAL_STYLE
melodyTemplate0-7INVALID_MELODY_TEMPLATE
melodicComplexity0-2INVALID_MELODIC_COMPLEXITY
hookIntensity0-3INVALID_HOOK_INTENSITY
vocalGroove0-5INVALID_VOCAL_GROOVE
modulationTiming0-4INVALID_MODULATION_TIMING
modulationSemitones1-4 (when timing!=0)INVALID_MODULATION
arpeggioPattern0-7INVALID_ARPEGGIO_PATTERN
arpeggioSpeed0-2INVALID_ARPEGGIO_SPEED
callDensity0-3INVALID_CALL_DENSITY
introChant0-2INVALID_INTRO_CHANT
mixPattern0-2INVALID_MIX_PATTERN
motifRepeatScope0-1INVALID_MOTIF_REPEAT_SCOPE
arrangementGrowth0-1INVALID_ARRANGEMENT_GROWTH
blueprintId0-9, 255(255=auto random)

6.2 Parameters NOT Validated by validateSongConfig

The following parameters are not checked by validateSongConfig(). Invalid values are clamped or ignored internally by the config converter:

ParameterEffective RangeNotes
enableSyncopationbooleanNo validation needed
energyCurve0-3Used within enum range
driveFeel0-1000=laid-back, 50=neutral, 100=aggressive
moraRhythmMode0-20=Standard, 1=MoraTimed, 2=Auto
melodyMaxLeap0=preset, 1-12Passed through directly
melodySyncopationProb0-100, 0xFF=presetConverted to 0-1.0f
melodyPhraseLength0=preset, 1-8Passed through directly
melodyLongNoteRatio0-100, 0xFF=presetConverted to 0-1.0f
melodyChorusRegisterShift-128=preset, -12 to +12Passed through directly
melodyHookRepetition0-2Tri-state
melodyUseLeadingTone0-2Tri-state
motifLength0=auto, 1/2/4Processed by switch statement; invalid values ignored
motifNoteCount0=auto, 3-8Clamped to 3-8
motifMotion0xFF=preset, 0-4Clamped via min(val, 4); Ostinato(5) is internal only
motifRegisterHigh0=auto, 1=low, 2=highPassed through directly
motifRhythmDensity0xFF=preset, 0-2Clamped via min(val, 2)

6.3 Style x Attitude Combinations

Each style preset has allowedAttitudes bit flags. Specifying a non-allowed attitude causes an error:

typescript
// Example: Style allows only Clean and Expressive
allowedAttitudes = ATTITUDE_CLEAN | ATTITUDE_EXPRESSIVE  // 0b011 = 3

vocalAttitude = 2 (Raw) → INVALID_ATTITUDE error

Check allowed attitudes with: midisketch_style_preset_allowed_attitudes(styleId)

6.4 Modulation x Semitones Dependency

modulationTimingmodulationSemitonesResult
0 (None)any (ignored)OK
1-40INVALID_MODULATION
1-41-4OK
1-45+INVALID_MODULATION

6.5 Call x Duration x BPM Conflict

IF callEnabled == true AND targetDurationSeconds > 0
THEN targetDurationSeconds >= getMinimumSecondsForCall(introChant, mixPattern, bpm)

Minimum time calculation:

min_bars = 24 + introChant_bars + mixPattern_bars
min_seconds = min_bars * 240 / bpm
bpmBase minimum (call enabled)With introChant/mixPattern
40144 secondsEven longer
6096 secondsEven longer
12048 secondsEven longer
24024 secondsEven longer

Solution: Use targetDurationSeconds=0 (auto) to let the system determine appropriate length.

6.6 Dangerous Combinations

Avoid These Combinations

The following combinations will cause validation errors or unexpected behavior. Check your parameters before generation.

PatternCauseFix
modulationTiming!=0 + modulationSemitones=0Modulation enabled but amount invalidSet modulationSemitones=2
callEnabled=true + targetDurationSeconds=30 + bpm=40Duration too shortSet targetDurationSeconds=0
vocalLow=80 + vocalHigh=60Range invertedEnsure low <= high
vocalLow=30 or vocalHigh=100Out of rangeUse 36-96
bpm=300BPM out of rangeUse 40-240
blueprintId=1,5,6,7 + drumsEnabled=false without drumsEnabledExplicit=truedrums_required Blueprint forces drums onSet drumsEnabledExplicit: true to explicitly disable
enableSyncopation=false + high vocalGroove valuesSyncopation effects silently disabledSet enableSyncopation: true for syncopation effects
Blueprint mood_mask mismatchMood incompatible with selected BlueprintCheck compatibility with isMoodCompatible(blueprintId, mood)

7. Guitar Track

guitarEnabled controls guitar track generation.

PropertyValue
JS defaultfalse
C++ defaulttrue

Guitar Default Difference

The JS API defaults guitarEnabled to false, while the C++ engine defaults to true. If you want guitar tracks in your JS-generated output, explicitly set guitarEnabled: true.


8. Tritone Substitution

chordExtTritoneSub and chordExtTritoneSubProb enable V7 to bII7 tritone substitution.

PropertyDescription
chordExtTritoneSubEnable/disable tritone substitution
chordExtTritoneSubProbProbability of tritone substitution (0-100)

Availability

Tritone substitution is available in AccompanimentConfig only. It is not exposed in the JS SongConfig type (types.ts). To use it, pass it via generateAccompaniment() config or through the C++ JSON API directly.


9. Mood-Dependent Chord Extension Probabilities

When chordExtProbExplicit=false (default), mood automatically adjusts chord extension probabilities:

Mood7th Probability9th Probabilitysus Probability
CityPop0.400.25-
RnBNeoSoul0.500.35-
Ballad/Sentimental0.30-0.25
Nostalgic/Chill0.25--
Lofi0.400.30-

Setting chordExtProbExplicit=true suppresses this auto-adjustment, using your explicit probability values instead.


10. drumsEnabledExplicit Behavior

The drumsEnabledExplicit flag controls whether the engine respects your drumsEnabled setting for drums_required blueprints.

drumsEnabledExplicitdrumsEnabledBlueprint drums_requiredResult
false (default)falsetrue (ID 1,5,6,7)Drums forced ON
false (default)trueanyDrums enabled
truefalsetrue (ID 1,5,6,7)Drums disabled (explicit override respected)
truefalsefalseDrums disabled

Drums Required Blueprints

Without drumsEnabledExplicit=true, blueprints with drums_required=true (ID 1, 5, 6, 7) will force drums on regardless of your drumsEnabled setting.


11.1 Simple Pop (Default)

javascript
{
  stylePresetId: 0,
  compositionStyle: 0,  // MelodyLead
  drumsEnabled: true,
  arpeggioEnabled: false,
  callEnabled: false
}

11.2 Vocaloid Style

javascript
{
  stylePresetId: 14,  // Anime Opening
  compositionStyle: 0,
  vocalStyle: 2,      // Vocaloid - high density, wide leaps
  arpeggioEnabled: true,
  arpeggioSpeed: 1    // Sixteenth
}

11.3 Idol Song (with Calls)

javascript
{
  stylePresetId: 3,   // Idol Standard
  vocalStyle: 4,      // Idol
  callEnabled: true,
  introChant: 1,      // Gachikoi
  mixPattern: 2,      // Tiger
  callDensity: 2,     // Standard
  callNotesEnabled: true,
  targetDurationSeconds: 180  // 3+ minutes required
}

11.4 BGM Mode (Motif + Arpeggio)

javascript
{
  compositionStyle: 1,  // BackgroundMotif (BGM-only)
  // No need to set skipVocal (auto-disabled in BackgroundMotif)

  // Motif settings
  motifFixedProgression: true,
  motifMaxChordCount: 4,

  // Arpeggio (also available in BackgroundMotif)
  arpeggioEnabled: true,      // → Motif + Arpeggio both generated
  arpeggioPattern: 2,         // UpDown
  arpeggioSpeed: 1,           // Sixteenth
  arpeggioOctaveRange: 2,
  arpeggioGate: 80,

  // Modulation (works in BGM mode too)
  modulationTiming: 1,        // LastChorus
  modulationSemitones: 2      // +2 semitones
}
// Output: Motif + Bass + Chord + Drums + Arpeggio (modulates +2 at last chorus)

11.5 BGM Mode (Arpeggio-Centered)

javascript
{
  compositionStyle: 2,  // SynthDriven (BGM-only)
  arpeggioEnabled: true,      // Must be explicitly enabled (NOT auto-enabled)
  arpeggioPattern: 0,         // Up
  arpeggioSpeed: 2,           // Triplet
  arpeggioOctaveRange: 3,

  // Modulation (works in BGM mode too)
  modulationTiming: 2,        // AfterBridge
  modulationSemitones: 3      // +3 semitones
}
// Output: Bass + Chord + Drums + Arpeggio (no Motif, modulates +3 after bridge)

11.6 Syncopated Feel

javascript
{
  enableSyncopation: true,
  vocalGroove: 3  // Syncopated
}
// vocalGroove=3 syncopation effects are active with enableSyncopation=true

11.7 Driving 16th

javascript
{
  enableSyncopation: true,
  vocalGroove: 4,   // Driving16th
  driveFeel: 80     // Aggressive drive
}
// 16th note emphasis + high driveFeel for aggressive syncopation

11.8 Melody Control

javascript
{
  melodyMaxLeap: 5,
  melodyPhraseLength: 4,
  melodyLongNoteRatio: 60,
  melodyHookRepetition: 2  // Explicitly ON
}
// Smaller leaps, 4-bar phrases, 60% long notes, hook repetition ON

11.9 R&B Style

javascript
{
  moodExplicit: true,
  mood: 20,           // RnBNeoSoul
  chordExt7th: true,
  chordExt9th: true
}
// Strong swing, extended chords, 85-100 BPM

11.10 Guitar + Lo-fi

javascript
{
  guitarEnabled: true,
  moodExplicit: true,
  mood: 23,            // Lofi
  compositionStyle: 1  // BackgroundMotif
}
// 80 BPM, strong swing, velocity cap 90, guitar track enabled

12. Implicit Internal Settings

Certain parameters automatically configure internal values when set.

12.1 VocalStylePreset → Melody Parameters

Setting vocalStyle automatically configures internal melody generation parameters:

ParameterDescription
max_leap_intervalMaximum leap width (semitones)
syncopation_probSyncopation probability
verse/chorus_density_modifierSection-specific density coefficient
hook_repetitionWhether to repeat hooks
chorus_long_tonesLong notes in chorus
tension_usageTension usage rate

VocalStylePreset List (0-13):

IDNameCharacteristics
0AutoRandom selection based on style
1StandardStandard pop
2VocaloidHigh density, wide leaps, syncopation (singable)
3UltraVocaloidUltra-fast, extreme leaps (machine-oriented)
4IdolCatchy, hook-focused
5BalladRelaxed, long notes
6RockPowerful, chorus emphasis
7CityPopStylish, uses tensions
8AnimeDramatic, strong hooks
9BrightKiraBright, sparkly
10CoolSynthCool, many 16th notes
11CuteAffectedCute, moderate syncopation
12PowerfulShoutPowerful, long notes + high density
13KPopK-Pop style, syncopation focus, hook-driven

12.2 MelodicComplexity → Multiple Parameters

melodicComplexityAuto Settings
Simple (0)note_density *= 0.7, max_leap_interval <= 5, hook_repetition=true, tension_usage *= 0.5, sixteenth_note_ratio *= 0.5, syncopation_prob *= 0.5
Standard (1)No changes (default)
Complex (2)note_density *= 1.3, max_leap_interval *= 1.5 (max 12), tension_usage *= 1.5, sixteenth_note_ratio *= 1.5 (max 0.5), syncopation_prob *= 1.5 (max 0.5)

12.3 VocalAttitude → Pitch Selection

vocalAttitudePitch CandidatesMusical Characteristics
Clean (0)Chord tones only (1, 3, 5)Safe, consonant, stable
Expressive (1)Chord tones + tensions (7th, 9th)Colorful, delayed resolution
Raw (2)All scale tonesEdgy, non-chord tone landing

12.4 CompositionStyle → Implicit Behavior

compositionStyleImplicit Behavior
BackgroundMotif (1)Vocal disabled (not generated), Aux enabled (supports motif), Motif track generated, modulation works
SynthDriven (2)Vocal/Aux completely disabled, Motif Blueprint-dependent, Arpeggio requires manual arpeggioEnabled=true, modulation works

12.5 Auto-Call Activation

When callEnabled=Auto(false), certain vocal styles automatically enable calls:

vocalStyleNameAuto-Call
4IdolYes
9BrightKiraYes
11CuteAffectedYes

Other vocal styles do not trigger auto-call activation.

javascript
// Example: SynthDriven requires explicit arpeggio enabling
{
  compositionStyle: 2,  // SynthDriven (BGM-only)
  arpeggioEnabled: true,   // Must be explicitly set for arpeggio
  modulationTiming: 1,     // Works in BGM mode
  modulationSemitones: 2
  // Note: No Vocal/Aux tracks generated in this mode
}

12.6 VocalGrooveFeel → Timing Adjustment

vocalGrooveEffect
Straight (0)No change
OffBeat (1)Delay on-beat notes (+30 ticks)
Swing (2)Delay 8th note 2nd beat
Syncopated (3)Anticipate beats 2, 4 (-30 ticks)
Driving16th (4)Emphasize 16th notes
Bouncy8th (5)Bounce feel on 8th notes

Syncopation dependency: When enableSyncopation=false, syncopation weight is 0.0 for all groove feels, and syncopation_prob=0.0 / allow_bar_crossing=false are forced. Timing offsets (+30 ticks etc.) apply regardless of enableSyncopation.

12.7 hookIntensity → Phrase Generation Changes

hookIntensityDuration MultiplierVelocity AdditionTarget Sections
Off (0)--None
Light (1)x1.3+5Chorus, B
Normal (2)x1.5+10Chorus, B
Strong (3)x2.0+15All sections

Maximum (4) is Internal Only

hookIntensity=4 (Maximum) is reserved for BehavioralLoop mode and is set internally when blueprintId=9 or addictiveMode=true. Passing hookIntensity=4 through the WASM/JS API will cause an INVALID_HOOK_INTENSITY validation error.


13. Parameter Application Order

Parameters are applied in this specific order. Later stages override earlier ones:

1. StylePreset          → Base parameters (melody_params, mood, bpm default)
2. VocalStylePreset     → max_leap, syncopation, density preset adjustments
3. MelodicComplexity    → Density multiplier, leap multiplier, hook_repetition
4. SongConfig Overrides → Melody/motif override parameters (user values take priority)
5. Master Switch        → enableSyncopation=false forces syncopation_prob=0.0

Structure Building Priority

Structure is determined by the first matching rule:

1. targetDurationSeconds > 0  → Time-based auto-build
2. formExplicit = true        → Use formId exactly (ignore Blueprint section_flow)
3. Blueprint section_flow     → Blueprint-defined section structure
4. Default                    → Build from StructurePattern

14. Option Dependency Tree

SongConfig
├── Basic Settings
│   ├── stylePresetId     ─────┐
│   ├── key                    │ Style determines defaults
│   ├── bpm (0=default)        │ for other options
│   └── seed (0=random)        │
│                              ▼
├── Structure ◄────────────────┤
│   ├── formId                 │
│   ├── formExplicit ──────────┴─▶ true=use formId exactly
│   └── targetDurationSeconds ───▶ Exclusive with formId (auto if >0)

├── Mood
│   ├── moodExplicit ─────────────▶ true=use mood field
│   └── mood (0-23) ─────────────▶ Ignored if moodExplicit=false

├── Vocal (only when skipVocal=false)
│   ├── vocalAttitude  ◄────────── Restricted by style
│   ├── vocalStyle     ◄────────── 0=Auto, 1-13=explicit preset
│   ├── vocalLow/High
│   ├── melodicComplexity
│   ├── hookIntensity
│   ├── vocalGroove    ◄────────── Syncopation effects require enableSyncopation=true
│   └── Melody Overrides
│       ├── melodyMaxLeap
│       ├── melodySyncopationProb
│       ├── melodyPhraseLength
│       ├── melodyLongNoteRatio
│       ├── melodyChorusRegisterShift
│       ├── melodyHookRepetition
│       └── melodyUseLeadingTone

├── Arpeggio (only when arpeggioEnabled=true)
│   ├── arpeggioPattern
│   ├── arpeggioSpeed
│   ├── arpeggioOctaveRange
│   ├── arpeggioGate
│   └── arpeggioSyncChord

├── Call System (only when callEnabled=true)
│   ├── introChant
│   ├── mixPattern  ─────────────▶ Conflicts with targetDurationSeconds
│   ├── callDensity
│   └── callNotesEnabled

├── Chord Extensions (prob effective only when enabled=true)
│   ├── chordExtSus  → chordExtSusProb
│   ├── chordExt7th  → chordExt7thProb
│   ├── chordExt9th  → chordExt9thProb
│   └── chordExtProbExplicit ────▶ true=suppress mood-based auto-adjustment

├── Modulation (only when modulationTiming!=None)
│   └── modulationSemitones

├── Humanize (only when humanize=true)
│   ├── humanizeTiming
│   └── humanizeVelocity

├── Track Toggles
│   ├── drumsEnabled
│   ├── drumsEnabledExplicit ────▶ true=respect drumsEnabled for drums_required blueprints
│   └── guitarEnabled ───────────▶ JS default=false, C++ default=true

├── Master Switches
│   ├── enableSyncopation ───────▶ false=syncopation weight 0.0
│   ├── energyCurve ─────────────▶ 0-3 energy progression
│   └── driveFeel ───────────────▶ 0-100 timing/velocity feel

├── Motif Overrides (BackgroundMotif / Blueprint motif sections)
│   ├── motifLength
│   ├── motifNoteCount
│   ├── motifMotion
│   ├── motifRegisterHigh
│   └── motifRhythmDensity

└── CompositionStyle-dependent
    ├── compositionStyle=0 (MelodyLead): Vocal/Aux enabled, standard
    ├── compositionStyle=1 (BackgroundMotif): BGM-only (Vocal disabled, Aux enabled)
    │   ├── motifRepeatScope
    │   ├── motifFixedProgression
    │   └── motifMaxChordCount
    └── compositionStyle=2 (SynthDriven): BGM-only (Vocal/Aux disabled, arpeggio requires manual enabling)

15. Workflow-Specific Options

15.1 generateVocal(config) - Used Parameters

CategoryParameterUsedDescription
BasicstylePresetIdYesStyle determination
keyYesKey (internal C major, transpose at output)
bpmYesTempo (0=style default)
seedYesRandom seed
chordProgressionIdYesChord progression (melody reference)
formIdYesStructure pattern
VocalvocalLowYesRange lower bound
vocalHighYesRange upper bound
vocalAttitudeYesExpression style
vocalStyleYesVocal style preset
melodicComplexityYesMelody complexity
hookIntensityYesHook strength
vocalGrooveYesGroove feel
IgnoreddrumsEnabledNoVocal only
arpeggioEnabledNoVocal only
humanizeNoApplied when accompaniment added

15.2 generateAccompaniment(config?) - Used Parameters

CategoryParameterUsedDescription
TracksdrumsEnabledYesGenerate drums
arpeggioEnabledYesGenerate arpeggio
guitarEnabledYesGenerate guitar
arpeggio.*YesArpeggio settings
chordExt*YesChord extension settings
chordExtTritoneSubYesTritone substitution (AccompanimentConfig only)
Post-processinghumanizeYesApply humanization
humanizeTimingYesTiming variation
humanizeVelocityYesVelocity variation
SE/CallseEnabledYesSE track generation
callEnabledYesCall feature
callDensityYesCall density

15.3 regenerateVocal(configOrSeed) - Used Parameters

Seed only (regenerateVocal(12345)):

  • Only seed is changed; other parameters use previous generateVocal settings

VocalConfig (regenerateVocal({...})):

ParameterUsedDescription
seedYesNew random seed
vocalLowYesChange range lower bound
vocalHighYesChange range upper bound
vocalAttitudeYesChange expression style
vocalStyleYesChange vocal style preset
melodicComplexityYesChange complexity
hookIntensityYesChange hook strength
vocalGrooveYesChange groove

Note: Chord progression and structure are NOT changed (continues from generateVocal settings).


16. Parameter Application Flow

SongConfig

    ├── stylePresetId ──→ mood, compositionStyle, bpm(default), melody_params
    │                           │
    │                           ▼ (can be overridden by explicit setting)
    ├── compositionStyle ──────────────→ Final compositionStyle
    ├── bpm ───────────────────────────→ Final BPM

    ├── vocalStyle ─────────→ melody_params override ─────→ │
    │       │                                               │
    │       └── (Auto) ────→ Random selection               │
    │                                                       ▼
    ├── melodicComplexity ─→ melody_params multiplier ────→ │
    │                                                       ▼
    ├── Melody Overrides ──→ Individual param override ───→ Final melody_params

    ├── hookIntensity ─────→ Chorus/B section note adjustment

    ├── vocalGroove ───────→ All note timing adjustment

    ├── enableSyncopation ─→ Master syncopation switch (false=weight 0.0)

    └── callEnabled ──────→ (if false=Auto) determined by vocalStyle → call_enabled

Application order: StylePresetVocalStylePresetMelodicComplexitySongConfig Overrides (melody/motif)Master Switch (enableSyncopation)


17. Production Blueprint Overrides

Production Blueprints control how the music is generated, independent of style/mood settings.

17.1 Blueprint List

IDNameParadigmRiffPolicyRequires DrumsWeight
0TraditionalTraditionalFree-42%
1RhythmLockRhythmSyncLockedYes14%
2StoryPopMelodyDrivenEvolving-10%
3BalladMelodyDrivenFree-4%
4IdolStandardMelodyDrivenEvolving-10%
5IdolHyperRhythmSyncLockedYes6%
6IdolKawaiiMelodyDrivenLockedYes5%
7IdolCoolPopRhythmSyncLockedYes5%
8IdolEmoMelodyDrivenLocked-4%
9BehavioralLoopTraditionalLockedPitch-0%*
255(Random)----

* BehavioralLoop has 0% weight and is never randomly selected; it must be explicitly chosen. When selected, it forces addictive_mode=true, HookIntensity=Maximum, and RiffPolicy=LockedPitch.

17.2 Paradigm Types

ParadigmDescriptionGeneration Order
TraditionalClassic pop generationVocal → Aux → Motif → Bass → Chord → Guitar → Arpeggio → Drums → SE
RhythmSyncRhythm-synchronized generationMotif → Vocal → Aux → Bass → Chord → Guitar → Arpeggio → Drums → SE
MelodyDrivenMelody-centered arrangementVocal → Aux → Motif → Bass → Chord → Guitar → Arpeggio → Drums → SE

17.3 RiffPolicy Types

PolicyDescriptionEffect on motifRepeatScope
FreeEach section variesUses motifRepeatScope setting
LockedPitch contour fixed, expression variesIgnores motifRepeatScope
Evolving30% chance to change every 2 sectionsIgnores motifRepeatScope

17.4 Blueprint Override Rules

When a Blueprint is selected (not Traditional/ID 0), several settings are automatically overridden:

Blueprint SettingOverride TargetCondition
section_flowformIdWhen section_flow exists and formExplicit=false; formExplicit=true takes priority
riff_policymotifRepeatScopeFree=use setting, Locked/Evolving=ignore
drums_sync_vocalInternal syncBlueprint definition takes priority
drums_requireddrumsEnabledWhen true, forces drumsEnabled=true (unless drumsEnabledExplicit=true + drumsEnabled=false)
TrackMask::MotifMotif generationPer-section control

17.5 Motif Generation Flow

CompositionStyle == BackgroundMotif? → Yes: Motif generated
└─ No → MelodyLead?
        ├─ RhythmSync paradigm? → Yes: Motif generated (rhythm axis)
        └─ section_flow exists & TrackMask::Motif? → Yes: Motif generated
           └─ No: No motif

Drums Required

Blueprints with requiresDrums=true (ID: 1, 5, 6, 7) automatically enable drums. Set drumsEnabledExplicit: true along with drumsEnabled: false to explicitly override this behavior.

17.6 Example: Blueprint Override Behavior

javascript
// Using RhythmLock blueprint
{
  blueprintId: 1,        // RhythmLock
  formId: 5,             // ← Ignored! Blueprint section_flow used
  motifRepeatScope: 1,   // ← Ignored! Locked policy forces same pattern
  drumsEnabled: false,   // ← Ignored! drums_required=true forces enabled
}
javascript
// Using Traditional blueprint
{
  blueprintId: 0,        // Traditional
  formId: 5,             // ← Used as specified
  motifRepeatScope: 1,   // ← Used as specified
  drumsEnabled: false,   // ← Used as specified
}
javascript
// Explicitly disabling drums on a drums_required blueprint
{
  blueprintId: 1,              // RhythmLock (drums_required)
  drumsEnabled: false,         // Want drums off
  drumsEnabledExplicit: true,  // Explicit flag → override respected
}

Released under the MIT License.