Skip to content

Chapter 7 — Mapping Concepts to Config

Every concept in this course is a dial on a single struct. This capstone chapter consolidates the whole course into lookup tables: concept on the left, SongConfig field on the right. By the end you will be able to translate any musical intent into a config object and reproduce the result byte-for-byte.

One idea, many configs

The central claim of the course is that a song idea is independent of the parameters that render it. Melody shape, chord progression, and key are orthogonal dials — change one and the others survive. The score below renders the same hook over a I–V move first in C, then transposed to D: the idea is identical, only key changed.

Putting it togetherOne idea, two keys: everything is config
The same hook over I-V, rendered in C and then in D (key: 0 vs key: 2). Every concept in this course maps to a SongConfig field: pick the key, the progression, the structure, the extension probabilities — and the same seed reproduces the same song.
keyseedchordProgressionIdMelody shape, chords, and key are independent dials — the song idea survives all of them.

Blueprint

A blueprint is a high-level recipe that bundles a generation strategy with sensible defaults — paradigm, drum policy, hook behaviour, and arrangement weights. Selecting blueprintId is the fastest way to get a coherent song; you then override individual fields. MidiSketch ships 10 blueprints (blueprintId 0–9), or 255 to pick one at random by weight.

Generation paradigm

A paradigm is the axis the engine builds a song around. Traditional generates the vocal first; RhythmSync builds from a rhythmic motif first; MelodyDriven centres everything on the melody. Each blueprint commits to one paradigm, which decides which track leads and which follow.

Seed

A seed is the integer that initialises the random generator. The same config plus the same seed reproduces the same song, bit-for-bit — the engine is deterministic. Use seed: 0 for a fresh random song each run, or any non-zero value to lock a result you want to keep.

Humanize

Humanize adds small, controlled deviations to timing and velocity so the output sounds played rather than quantized. humanizeTiming (default 0.4) nudges note onsets; humanizeVelocity (default 0.3) varies loudness. Both are 0.01.0; higher is looser, 0.0 is mechanically exact.

Mapping by chapter

The tables below mirror the course chapter by chapter. Treat them as the reference you return to after you have read the prose once.

Chapter 0 — Primer (pitch, time, tempo)

ConceptConfig fieldRange / notes
Tonic pitch classkey011 (0 = C, 7 = G)
Playback tempobpm40240; 0 = style default
Lowest melody notevocalLowMIDI number, default 60 (C4)
Highest melody notevocalHighMIDI number, default 79 (G5)

Chapter 1 — Scales & Keys

ConceptConfig fieldRange / notes
Key / tonickey011
Overall mood (selects scale colour)mood023; needs moodExplicit: true to apply exactly

Chapter 2 — Chords & Triads

ConceptConfig fieldRange / notes
Broken-chord texturearpeggioEnabled / arpeggioPatternbool; pattern 07 (Up … BrokenChord)
Style preset (bundles chord & melody defaults)stylePresetId016 (e.g. 3 = Idol Standard, 12 = Background Motif, 14 = Anime Opening)

Chapter 3 — Chord Progressions

ConceptConfig fieldRange / notes
Chord progression presetchordProgressionId021 (22 progressions)

Chapter 4 — Harmony & Color

ConceptConfig fieldRange / notes
Sus chordschordExtSus / chordExtSusProbflag + probability 0.01.0 (default 0.2)
7th chordschordExt7th / chordExt7thProbflag + probability 0.01.0 (default 0.15)
9th chordschordExt9th / chordExt9thProbflag + probability 0.01.0 (default 0.25)
Tritone substitutionchordExtTritoneSub / chordExtTritoneSubProbflag + probability 0.01.0 (default 0.5)

Chapter 5 — Melody, Motifs & Hooks

ConceptConfig fieldRange / notes
Hook intensityhookIntensity04 (4 = Maximum, set via BehavioralLoop)
Vocal delivery stylevocalStyle013 (0 = Auto, 13 = KPop)
Melody templatemelodyTemplate0 = Auto, 17
Call & responsecallSetting0 = Auto, 1 = Enabled, 2 = Disabled

Chapter 6 — Song Structure

ConceptConfig fieldRange / notes
Song form presetformId017
Honour the form exactlyformExplicittrue / false
Target length (auto-build)targetDurationSecondsseconds; 0 = use formId

Blueprints at a glance

Picking a blueprintId sets the paradigm, drum policy, and arrangement weights in one move. The weight column is the selection probability when blueprintId: 255 (random); 9 has weight 0, meaning it is reachable only by asking for it explicitly.

IDBlueprintParadigmDrums requiredWeight
0TraditionalTraditionalno42%
1RhythmLockRhythmSyncyes14%
2StoryPopMelodyDrivenno10%
3BalladMelodyDrivenno4%
4IdolStandardMelodyDrivenno10%
5IdolHyperRhythmSyncyes6%
6IdolKawaiiMelodyDrivenno5%
7IdolCoolPopRhythmSyncyes5%
8IdolEmoMelodyDrivenno4%
9BehavioralLoopTraditionalno0% (explicit only)

Drums-required blueprints (1, 5, 7) force a drum track; query this at runtime with getBlueprintDrumsRequired(id). BehavioralLoop (9) forces addictive mode, sets hookIntensity to Maximum, and locks the riff.

A minimal recipe

Putting the dials together, a complete, reproducible song is a few lines:

javascript
const config = createDefaultConfig(0)
config.key = 7                 // G major (ch1)
config.chordProgressionId = 0  // preset progression (ch3)
config.chordExt7th = true      // mellow color (ch4)
config.hookIntensity = 3       // strong hook (ch5)
config.seed = 42               // reproducible
sketch.generateFromConfig(config)

Call validateConfig(config) first to check every field is in range before generating — it returns an error code if any value is out of bounds, which saves you debugging a rejected generation.

Across all nine generated tracks (Vocal ch0, Chord ch1, Bass ch2, Motif ch3, Arpeggio ch4, Aux ch5, Guitar ch6, Drums ch9, SE ch15), the guitar track is on by default (guitarEnabled: true).

Common pitfall — several values need an explicit flag to take effect

A value you set is silently ignored unless its companion flag is on: mood needs moodExplicit, the chordExt*Prob values need chordExtProbExplicit, formId is only honoured exactly with formExplicit, and drum state needs drumsEnabledExplicit. If a setting "does nothing", check for its *Explicit flag first. Always run validateConfig(config) before generating — an out-of-range field rejects the whole generation rather than clamping.

MidiSketch mapping

ConceptConfig fieldRange / notes
Generation recipeblueprintId09, or 255 = random by weight
Reproducibilityseedinteger; 0 = random, non-zero = locked
Timing loosenesshumanizeTiming0.01.0 (default 0.4)
Velocity loosenesshumanizeVelocity0.01.0 (default 0.3)
Pre-flight checkvalidateConfig(config)returns an error code if a field is out of range

For the full field list and runtime behaviour, see Option relationships and the Presets reference.

Put it into practice with Getting Started and the JavaScript API, or look up any term in the Glossary.