Skip to content

Option Relationships

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

New to these settings?

The fields related here — key, mood, formId, the chordExt* family — are introduced one chapter at a time in the course. The capstone Mapping Concepts to Config collects them into a single lookup table.

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

callSetting gates the four call-related options A left-to-right chain. callSetting takes 0 for Auto, 1 for Enabled and 2 for Disabled; it resolves to calls being on or off, and under Auto the vocal style makes that decision. While calls are inactive the four dependent fields — introChant, mixPattern, callDensity and callNotesEnabled — are read but have no effect. parent callSetting 0=Auto · 1=On · 2=Off resolution 1 = Enabled → calls on 2 = Disabled → calls off 0 = Auto → vocal style decides ignored while calls are inactive introChant mixPattern callDensity callNotesEnabled Auto asks the vocal style, not the style preset
ParentChildDescription
call active (callSetting=1, or 0 resolved to on)introChantType of intro chant section
call activemixPatternType of MIX section
call activecallDensityCall density in chorus
call activecallNotesEnabledOutput calls as MIDI notes

callEnabled is Legacy

callSetting (0=Auto, 1=Enabled, 2=Disabled) replaced the boolean callEnabled in SongConfig. With 0 (Auto), the vocal style alone decides whether calls are generated — the style preset is not consulted. callEnabled is still accepted for backward compatibility (true→1, false→2) but should not be used in new code. AccompanimentConfig still uses a plain callEnabled boolean.

1.2 Arpeggio

arpeggioEnabled gates every other arpeggio field A single switch on the left feeds a panel of six dependent fields: arpeggioPattern, arpeggioSpeed, arpeggioOctaveRange, arpeggioGate, arpeggioSyncChord and arpeggioBaseVelocity, each shown with its accepted range. The arpeggio track is off by default, and none of the six fields is read until the switch is turned on. switch arpeggioEnabled default false effective only while it is on arpeggioPattern 0–7, or 255 for auto arpeggioSpeed 8th · 16th · triplet arpeggioOctaveRange 1 to 3 octaves arpeggioGate 0.0–1.0, −1 = style default arpeggioSyncChord follow chord changes arpeggioBaseVelocity 0–127, default 90 The arpeggio track is off by default — none of these fields is read until it is switched on
ParentChildDescription
arpeggioEnabled=truearpeggioPatternUp/Down/UpDown/Random/Pinwheel/PedalRoot/Alberti/BrokenChord (0-7), or 255 (default) for the mood's pattern
arpeggioEnabled=truearpeggioSpeedEighth/Sixteenth/Triplet (0-2), or 255 (default) for the mood's speed
arpeggioEnabled=truearpeggioOctaveRange1-3 octaves
arpeggioEnabled=truearpeggioGateGate length 0.0-1.0, or -1 (default) to use the mood's gate, which ranges 0.6-0.98
arpeggioEnabled=truearpeggioSyncChordSync with chord changes
arpeggioEnabled=truearpeggioBaseVelocityBase velocity for arpeggio notes (0-127, default 90)

1.3 Humanization

humanize gates the two humanization amounts The humanize switch, off by default, feeds two amount fields: humanizeTiming with a default of 0.4 and humanizeVelocity with a default of 0.3. A note on the right records that SongConfig and AccompanimentConfig both take these as floats in the 0.0 to 1.0 range. switch humanize default false humanizeTiming 0.0–1.0, default 0.4 humanizeVelocity 0.0–1.0, default 0.3 one scale SongConfig and AccompanimentConfig both take these as 0.0–1.0 floats.
ParentChildDescription
humanize=truehumanizeTimingTiming variation (0.0-1.0, default 0.4)
humanize=truehumanizeVelocityVelocity variation (0.0-1.0, default 0.3)

humanizeTiming only supplies the amount when humanize=true. Micro-timing itself is not gated on humanize: with humanize=false, any driveFeel other than 50 produces groove timing on its own, scaled by |driveFeel - 50| / 50. It reaches drums and bass only.

1.4 Chord Extensions

Each chord-extension flag gates its own probability Four independent pairs laid out in a two-by-two grid. chordExtSus feeds chordExtSusProb with a default of 0.2, chordExt7th feeds chordExt7thProb at 0.15, chordExt9th feeds chordExt9thProb at 0.25, and chordExtTritoneSub feeds chordExtTritoneSubProb at 0.5. The four pairs do not interact: a probability is read only while its own flag is true. enable flag → probability (SongConfig default) chordExtSus chordExtSusProb 0.2 chordExt7th chordExt7thProb 0.15 chordExt9th chordExt9thProb 0.25 chordExtTritoneSub chordExtTritoneSubProb 0.5 The flags are independent — each probability is read only while its own flag is true.
ParentChildDescription
chordExtSus=truechordExtSusProbSus probability (0.0-1.0, default 0.2)
chordExt7th=truechordExt7thProb7th probability (0.0-1.0, default 0.15)
chordExt9th=truechordExt9thProb9th probability (0.0-1.0, default 0.25)
chordExtTritoneSub=truechordExtTritoneSubProbTritone sub probability (0.0-1.0, default 0.5)

Scale differences between the two configs

SongConfig and AccompanimentConfig use the same 0.0-1.0 floats and the same defaults for every chord-extension probability and for humanizeTiming/humanizeVelocity. The one field whose scale differs is arpeggioGate, which AccompanimentConfig takes as an integer 0-100 (default 80, 255 = style default) while SongConfig takes it as 0.0-1.0 (or -1 for the style default).

1.5 Modulation

Modulation settings and the vocal ceiling they move A left-to-right chain of three boxes. Setting modulationTiming to anything other than None brings modulationSemitones into play, which accepts one to four semitones. That amount is then subtracted from the vocal ceiling internally, so the melody still fits after the key change; the range is never narrowed below an octave. modulationTiming anything but None modulationSemitones 1 to 4 semitones internal effective_vocal_high = vocal_high − n never narrowed below an octave The amount is only validated once a timing is chosen, and modulation stays effective in the BGM styles too.
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: the ceiling is first clamped by the Blueprint's max_pitch constraint, then reduced by the resolved modulation amount, then floored at vocalLow + 12 so the range never drops below an octave
  • Works in all CompositionStyles: Modulation is effective in BGM modes (BackgroundMotif, SynthDriven) as well

1.6 Vocal (skipVocal exclusion)

skipVocal switches the whole vocal option group on or off Two branches leave the skipVocal switch. With skipVocal false the seven vocal fields are live: the vocalLow and vocalHigh pair, vocalAttitude, vocalStyle, melodyTemplate, melodicComplexity, hookIntensity and vocalGroove. With skipVocal true every one of them is ignored, the result is BGM only, and no API can add vocals to it afterwards. switch skipVocal skipVocal = false — the vocal fields are live vocalLow / vocalHigh vocalAttitude vocalStyle melodyTemplate melodicComplexity hookIntensity vocalGroove skipVocal = true every field above is ignored — BGM only, and no API adds vocals afterwards
ConditionEffective OptionsUse Case
skipVocal=falseAll vocal-related optionsNormal song generation
skipVocal=trueVocal generation is skipped; if a vocal is already present it is kept and every other track adapts to itVocal-first workflow — this is what generateAccompaniment() sets internally. For BGM with no vocal at all, set compositionStyle=1 or 2 with compositionStyleExplicit=true.

skipVocal controls the Vocal track only. It does not skip Aux; Aux remains available unless compositionStyle=SynthDriven disables it.

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

enableSyncopation is a master switch over three settings Two branches leave enableSyncopation. When true, syncopation_prob and allow_bar_crossing keep their values and the groove's syncopation weighting applies. When false, syncopation_prob is forced to zero, allow_bar_crossing is forced off, and even a Syncopated groove has no effect. Groove timing offsets are applied either way. master switch enableSyncopation true — syncopation is live syncopation_prob allow_bar_crossing groove syncopation weight false — forced to zero syncopation_prob = 0.0 allow_bar_crossing = false a Syncopated groove is inert Groove timing offsets — OffBeat's +30 ticks, for example — still apply; only the syncopation weighting is gated.
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., +60 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)

Blueprint 9 turns on addictive mode and two forced settings A left-to-right chain. Choosing blueprintId 9, BehavioralLoop, sets the internal addictive_mode flag, which in turn forces HookIntensity to Maximum, internal level 4, and RiffPolicy to LockedPitch so the riff repeats verbatim. BehavioralLoop carries no selection weight, so a random blueprint pick never lands on it. blueprintId = 9 BehavioralLoop addictive_mode = true set internally HookIntensity = Maximum internal level 4 RiffPolicy = LockedPitch the riff repeats verbatim BehavioralLoop carries no selection weight — a random blueprint pick never lands on it.
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

MelodyLead — which options are live and which tracks are written compositionStyle 0, the default. All vocal fields are live, the arpeggio is live once it is switched on, and modulation is live. The motif fields do nothing unless the blueprint asks for a motif track. Nine tracks are written in order: vocal, aux, motif, bass, chord, guitar, arpeggio, drums and SE, with the motif and arpeggio slots conditional. compositionStyle = 0 MelodyLead — the default option families vocal fields — all live arpeggio — live when on modulation — live the motif fields do nothing unless the blueprint asks for a motif track generated tracks, in order teal = only when the blueprint or a flag asks for it 1 · vocal 2 · aux 3 · motif 4 · bass 5 · chord 6 · guitar 7 · arpeggio 8 · drums 9 · SE MelodyLead is the only composition style that writes a vocal track.

Generated tracks: Vocal → Aux → Motif (only when something asks for it, see §17.5) → Bass → Chord → Guitar → Arpeggio (if enabled) → Drums → SE

MelodyLead is the only style that gates the motif. The motif fields are read only when a motif track is actually generated.

2.2 BackgroundMotif (1) - BGM-Only Mode

BackgroundMotif — a BGM-only style built around the motif compositionStyle 1. No vocal track is written at all, the aux track is on and backs the motif, and modulation is live. The motif fields motifRepeatScope, motifFixedProgression and motifMaxChordCount become effective here. Tracks written: aux, motif, bass, chord, guitar and drums, plus an arpeggio only when arpeggioEnabled is true. compositionStyle = 1 BackgroundMotif — BGM only option families no vocal track at all aux — on, backs the motif modulation — live motif fields — now effective motifRepeatScope motifFixedProgression motifMaxChordCount generated tracks teal = only when arpeggioEnabled is true aux motif bass chord guitar drums arpeggio The motif carries the tune here, so the motif fields matter and the vocal fields do not.

Tracks enabled by this style:

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

BackgroundMotif enables the Motif generator; section masks and layer schedules determine which sections retain Motif notes.

2.3 SynthDriven (2) - BGM-Only Mode

SynthDriven — a BGM-only style built around the arpeggio compositionStyle 2. No vocal track and no aux track are written, and modulation is live. The motif is always written under this style, and the arpeggio is off by default and must be switched on by hand — once it is, it carries the lead. Tracks written: motif, bass, chord, guitar, arpeggio and drums. compositionStyle = 2 SynthDriven — BGM only option families no vocal track no aux track modulation — live motif — always written arpeggio — off by default arpeggio carries the lead generated tracks teal = conditional slots motif bass chord guitar arpeggio drums Only the arpeggio is conditional here — the motif is unconditional under SynthDriven.

Tracks enabled by this style: Motif + Bass + Chord + Guitar + Arpeggio (if enabled) + Drums. SynthDriven enables the Motif generator; section masks and layer schedules determine which sections retain Motif notes.

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
arpeggioPattern255 (Auto)Use the mood's default pattern
arpeggioSpeed255 (Auto)Use the mood's default speed
arpeggioGate-1Use the mood's default gate (0.6-0.98)
driveFeel50Neutral (0=laid-back, 100=aggressive)
moraRhythmMode2 (Auto)Auto-select from VocalStylePreset
syllabicSubRate0Use the style default; 1-100 overrides the style ratio (%)

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

Two fields where zero means "decide for me" Two independent decisions side by side. A bpm of 0 falls back to the style preset's default tempo; any other value is used as given, within 40 to 240. A targetDurationSeconds of 0 uses the structure pattern named by formId; a positive value makes the structure fit that length instead, with the bar count derived from seconds times BPM divided by 240. bpm is a tempo given? bpm = 0 stylePreset.tempo_default bpm > 0 used as given, 40–240 0 means auto, never 0 BPM targetDurationSeconds is a length requested? value = 0 formId structure pattern value > 0 structure fitted to it bars = ceil(seconds × bpm ÷ 240)

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 and SynthDriven modes and in Blueprint-based MelodyLead motif sections.

5.1 Motif Override Parameters

ParameterRangeDefaultDescription
motifLength0=auto, 1/2/40Motif length (bars)
motifNoteCount0=auto, 3-80Number of notes in motif
motifMotion0xFF=preset, 0-50xFFPitch motion type
motifRegisterHigh0=auto, 1=low, 2=high0Register (0=mid range)
motifRhythmDensity0xFF=preset, 0-20xFFRhythm density
motifMaxChordCount0=no limit, 2-84Cap the number of distinct chords the motif section cycles through

5.2 MotifMotion Values

ValueNameDescription
0StepwiseScale steps only (2nds)
1GentleLeapUp to 3rds
2WideLeapUp to 5ths
3NarrowStepNarrow scale degrees (jazzy)
4DisjunctIrregular leaps (experimental)
5OstinatoAll notes on the root pitch class, with root/5th variation

Ostinato Motion

motifMotion=5 (Ostinato) puts every note of the motif on the root pitch class, with root/5th variation. It is what the addictive-loop blueprints reach for, and it is reachable through the API too — the validator accepts 0-5 or 0xFF (preset); other values above 5 are rejected with INVALID_MOTIF_OVERRIDE and are not clamped. Expect a deliberately monotonous riff.

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-4INVALID_HOOK_INTENSITY
vocalGroove0-5INVALID_VOCAL_GROOVE
modulationTiming0-4INVALID_MODULATION_TIMING
modulationSemitones1-4 (when timing!=0)INVALID_MODULATION
arpeggioPattern0-7, 255INVALID_ARPEGGIO_PATTERN
arpeggioSpeed0-2, 255INVALID_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 Additional validated ranges

These are validated too, though they do not appear in the table above:

ParameterValid rangeError code
energyCurve0-3INVALID_ENERGY_CURVE
driveFeel0-100INVALID_DRIVE_FEEL
moraRhythmMode0-2INVALID_MORA_RHYTHM_MODE
syllabicSubRate0 (style default), 1-100 (%) overrideINVALID_MELODY_OVERRIDE
callSetting0-2INVALID_CALL_SETTING
humanizeTiming, humanizeVelocity0.0-1.0INVALID_PROBABILITY
chordExt*Prob0.0-1.0INVALID_PROBABILITY
arpeggioOctaveRange1-3INVALID_ARPEGGIO_RANGE
arpeggioGate0.0-1.0, or -1 for the style defaultINVALID_ARPEGGIO_RANGE
arpeggioBaseVelocity0-127INVALID_ARPEGGIO_RANGE
melodyMaxLeap0=preset, 1-12INVALID_MELODY_OVERRIDE
melodySyncopationProb0-100, 0xFF=presetINVALID_MELODY_OVERRIDE
melodyPhraseLength0=preset, 1-8INVALID_MELODY_OVERRIDE
melodyLongNoteRatio0-100, 0xFF=presetINVALID_MELODY_OVERRIDE
melodyChorusRegisterShift-12 to +12, -128=presetINVALID_MELODY_OVERRIDE
melodyHookRepetition, melodyUseLeadingTone0-2INVALID_MELODY_OVERRIDE
motifLength0, 1, 2 or 4 (bars)INVALID_MOTIF_OVERRIDE
motifNoteCount0=auto, 3-8INVALID_MOTIF_OVERRIDE
motifMotion0-5, 0xFF=presetINVALID_MOTIF_OVERRIDE
motifRegisterHigh0-2INVALID_MOTIF_OVERRIDE
motifRhythmDensity0-2, 0xFF=presetINVALID_MOTIF_OVERRIDE
motifMaxChordCount0=no limit, 2-8INVALID_MOTIF_OVERRIDE

Out-of-range values are rejected, not clamped. enableSyncopation is the only boolean here and needs no range check.

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 callSetting != 2 (Disabled) AND targetDurationSeconds > 0
THEN targetDurationSeconds >= getMinimumSecondsForCall(introChant, mixPattern, bpm)

The check does not resolve Auto — callSetting=0 triggers the duration floor even for vocal styles that would not have produced calls.

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
callSetting=1 + 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,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
Default (SongConfig, JS and C++)true
Default (AccompanimentConfig)true

Guitar is On by Default

The guitar track is generated by default. Set guitarEnabled: false to disable it. Whether a blueprint keeps the guitar below the vocal register is controlled by the blueprint's guitar_below_vocal constraint.


8. Tritone Substitution

chordExtTritoneSub and chordExtTritoneSubProb enable V7 to bII7 tritone substitution.

PropertyDescription
chordExtTritoneSubEnable/disable tritone substitution (default false)
chordExtTritoneSubProbProbability of tritone substitution (0.0-1.0, default 0.5 in both SongConfig and AccompanimentConfig)

Availability

Tritone substitution is available in both the JS SongConfig (for full-song generation) and AccompanimentConfig (for accompaniment regeneration), as well as the C++ chord_extension struct. See Harmony for the musical background.


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,7)Drums forced ON
false (default)trueanyDrums enabled
truefalsetrue (ID 1,5,7)Drums disabled (explicit override respected)
truefalsefalseDrums disabled

Drums Required Blueprints

Without drumsEnabledExplicit=true, blueprints with drums_required=true (ID 1, 5, 7) will force drums on regardless of your drumsEnabled setting. Use getBlueprintDrumsRequired(id) to query this at runtime.


11.1 Simple Pop (Default)

javascript
{
  stylePresetId: 0,
  compositionStyle: 0,  // MelodyLead
  drumsEnabled: true,
  arpeggioEnabled: false,
  callSetting: 2        // Disabled
}

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
  callSetting: 1,     // Enabled
  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)
  compositionStyleExplicit: true,
  // No need to set skipVocal (auto-disabled in BackgroundMotif)

  // Motif settings
  motifMaxChordCount: 4,

  // Arpeggio (also available in BackgroundMotif)
  arpeggioEnabled: true,      // → Motif + Arpeggio both generated
  arpeggioPattern: 2,         // UpDown
  arpeggioSpeed: 1,           // Sixteenth
  arpeggioOctaveRange: 2,
  arpeggioGate: 0.8,        // SongConfig gate (0.0-1.0)

  // Modulation (works in BGM mode too)
  modulationTiming: 1,        // LastChorus
  modulationSemitones: 2      // +2 semitones
}
// Output: Aux + Motif + Bass + Chord + Drums + Arpeggio (modulates +2 at last chorus)
// Motif note population follows section masks and layer schedules.

11.5 BGM Mode (Arpeggio-Centered)

javascript
{
  compositionStyle: 2,  // SynthDriven (BGM-only)
  compositionStyleExplicit: true,
  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: Motif + Bass + Chord + Drums + Arpeggio (no Vocal/Aux, modulates +3 after bridge)
// Motif note population follows section masks and layer schedules.

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
  compositionStyleExplicit: true
}
// 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 generation enabled, modulation works; section masks and layer schedules determine populated notes
SynthDriven (2)Vocal/Aux completely disabled, Motif generation enabled, Arpeggio requires manual arpeggioEnabled=true, modulation works; section masks and layer schedules determine populated notes

12.5 Auto-Call Activation

When callSetting=0 (Auto), 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)
  compositionStyleExplicit: true,
  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)On-beat notes pushed late by 60 ticks (an eighth of a beat)
Swing (2)The off-eighth of each beat delayed by 60 ticks
Syncopated (3)Notes near beats 2 and 4 anticipated by 60 ticks
Driving16th (4)16th-note onsets rushed by 30 ticks
Bouncy8th (5)Off-eighth delayed by 40 ticks, on-eighth shortened

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 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 for Behavioral Loop

hookIntensity=4 (Maximum) is intended for BehavioralLoop mode and is set automatically when blueprintId=9 or addictiveMode=true. It passes validation if set explicitly, but it forces maximum repetition with simple patterns, so for normal songs use 0-3.


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 call is active: callSetting=1, or 0 resolved to on)
│   ├── 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 ───────────▶ default=true (set false to disable)

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

├── Motif Overrides (BackgroundMotif / SynthDriven / 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
    │   └── 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
Post-processinghumanizeYesApply humanization
humanizeTimingYesTiming variation
humanizeVelocityYesVelocity variation
SE/CallseEnabledYesSE track generation
callEnabledYesCall feature (boolean in AccompanimentConfig)
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
keepMotifYesRhythmSync only: keep the existing Motif as the rhythmic axis (default false = regenerate both)

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)

    └── callSetting ──────→ (if 0=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%
6IdolKawaiiMelodyDrivenLocked-5%
7IdolCoolPopRhythmSyncLockedYes5%
8IdolEmoMelodyDrivenLocked-4%
9BehavioralLoopRhythmSyncLockedPitch-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

PolicyValueDescriptionEffect on motifRepeatScope
Free0Each section variesUses motifRepeatScope setting
LockedContour1Pitch contour fixed, rhythm and expression varyIgnores motifRepeatScope
LockedPitch2Pitch fully fixed, velocity variesIgnores motifRepeatScope
LockedAll3Every aspect fixedIgnores motifRepeatScope
Evolving4The cached riff is mutated once per section, so it drifts while keeping its identityIgnores motifRepeatScope

Locked is an alias for LockedContour (1). motifRepeatScope is read only inside the Free branch — every other policy ignores it.

17.4 Blueprint Override Rules

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

What an active blueprint overrides, and what stops it A blueprint other than 0 opens three independent override lanes. If the blueprint carries a section_flow, it overrides formId, otherwise formId is kept. If its riff_policy is Free, motifRepeatScope is used; under any other policy it is ignored. If drums_required is true, drumsEnabled is forced on, otherwise it is kept. Two explicit flags override the overrides: formExplicit keeps your form, and drumsEnabledExplicit with drumsEnabled false keeps the drums off. blueprintId ≠ 0 a blueprint is active form section_flow present → formId overridden absent → formId kept motif repeat riff_policy Free → motifRepeatScope used any other policy → ignored drums drums_required true → drumsEnabled forced on false → drumsEnabled kept the explicit flags win formExplicit = true keeps your form; drumsEnabledExplicit = true with drumsEnabled = false keeps the drums off.
Blueprint SettingOverride TargetCondition
section_flowformIdWhen section_flow exists and formExplicit=false; formExplicit=true takes priority
riff_policymotifRepeatScopeFree=use setting; every other policy ignores it
drums_sync_vocalInternal syncBlueprint definition takes priority
drums_requireddrumsEnabledWhen true, forces drumsEnabled=true (unless drumsEnabledExplicit=true + drumsEnabled=false)
TrackMask::MotifMotif generationPer-section control for MelodyLead; BGM styles enable Motif generation, then masks/layering shape populated notes

17.5 Motif Generation Flow

CompositionStyle is BackgroundMotif or SynthDriven?  → Motif generator enabled
└─ MelodyLead: generator enabled when any of these holds
   ├─ paradigm is RhythmSync                        (motif is the coordinate axis)
   ├─ addictiveMode / blueprintId 9                 (the loop *is* the riff)
   ├─ riffPolicy is LockedContour / LockedPitch / LockedAll
   │                                                (a locked riff is still a riff)
   └─ a Blueprint section_flow marks TrackMask::Motif on any section
   otherwise: no motif

Eligibility only enables the generator. Blueprint track masks and layer schedules can leave individual sections without Motif notes.

Drums Required

Blueprints with requiresDrums=true (ID: 1, 5, 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
}