Variable
| Static Public Summary | ||
| public |
Chord tones per mode (mu): pitch classes (mod 12) for each Roman-numeral. |
|
| public |
Bundle of form-control helpers wired into the Alpine "app" data object via spread. |
|
| public |
EDGES: { CADENCE: [number, {major: string, minor: string}], NORMAL: [number, {major: string, minor: string}], NC: number, LOOP: number, MISSING: number, } Default chord-graph configuration: structural costs (LOOP, NC, MISSING) and edge tables [cost, {major, minor}]. |
|
| public |
INSTRUMENTS: Object<string, string[]> Voice instruments = General MIDI Level-1 program list grouped into the 16 standard families. |
|
| public |
Bundle of compose-result rendering helpers wired into the Alpine "app" data object via spread. |
|
Static Public
public CHORDS: {major: Object<string, number[]>, minor: Object<string, number[]>} source
import {CHORDS} from 'constraint-composer/src/model/theory.js'Chord tones per mode (mu): pitch classes (mod 12) for each Roman-numeral. Insertion order = diatonic ordering. "NC" allows all classes. V and NC are duplicated across major/minor (small DRY trade-off).
public CONTROLS: Object source
import {CONTROLS} from 'constraint-composer/src/view/controls.js'Bundle of form-control helpers wired into the Alpine "app" data object via spread.
Properties:
| Name | Type | Attribute | Description |
| stepBy | function(params: Object, desc: {name: string, min: number, max: number}, delta: number): void | Stepper +/- click handler: bump params[desc.name] by delta clamped to [desc.min, desc.max]. |
|
| isDuplicatePart | function(parts: Object[], index: number, counter: string): boolean | True when a parts-section row at index reuses an earlier label. |
|
| duplicateSourceIndex | function(parts: Object[], index: number): number | 1-based index of the first earlier rho with the same label, or 0 when none. |
|
| clampVoicePitchRange | function(voice: {min_pitch: number, max_pitch: number}, fieldName: string): void | Voice-config input handler: snap the just-edited pitch field to the other when the range inverts. |
|
| setupChordTonesTristate | function(el: HTMLInputElement, getValue: Function, setValue: Function): void | Single checkbox cycling free/scale/chord (getValue: () => 'free'|'scale'|'chord'; setValue: (v) => void); chord = checked, scale = indeterminate, free = neither. |
|
| setupFeedbackTristates | function(formEl: HTMLElement, triData: Object<string, Object<string, string>>): void | Form-scan over fieldset[data-tri-group] input[data-tri]: cycle neutral/negative/positive; mutates triData in place. |
Test:
public EDGES: { CADENCE: [number, {major: string, minor: string}], NORMAL: [number, {major: string, minor: string}], NC: number, LOOP: number, MISSING: number, } source
import {EDGES} from 'constraint-composer/src/model/theory.js'Default chord-graph configuration: structural costs (LOOP, NC, MISSING) and edge tables [cost, {major, minor}]. CADENCE (after NORMAL) overwrites shared edges. MISSING is the sentinel cost for non-edges in the MZN cost matrix: higher than any valid cost so the solver never traverses non-edge cells.
public INSTRUMENTS: Object<string, string[]> source
import {INSTRUMENTS} from 'constraint-composer/src/model/instruments.js'Voice instruments = General MIDI Level-1 program list grouped into the 16 standard families. 8 programs each, 128 total. Keys are family names; values are program-name arrays in canonical GM 1.0 program order, so the global program number is the position when families are concatenated (familyIndex * 8 + indexInFamily).
Example:
Object.keys(INSTRUMENTS)[0]; // "Piano" (family at index 0)
INSTRUMENTS.Piano[0]; // "Acoustic Grand Piano" (GM program 0)
Object.keys(INSTRUMENTS)[9]; // "Pipe" (family at index 9)
INSTRUMENTS.Pipe[1]; // "Flute" (GM program 73 = 9*8+1)
public PLOTTING: Object source
import {PLOTTING} from 'constraint-composer/src/view/plotting.js'Bundle of compose-result rendering helpers wired into the Alpine "app" data object via spread.
Properties:
| Name | Type | Attribute | Description |
| wireMidiToPlayer | function(midi: {combinedB64: string, voicesB64: string[]}): void | Wire combined + per-voice MIDI URLs into player and visualizers; caller awaits $nextTick. |
|
| buildResultTable | function(result: Object, voiceConfig: {voices: number, voice: Object[]}): Object | Shape compose result + voice config into the Alpine-rendered result table. |
|
| applyVoiceStyles | function(voiceLabels: {color: string}[]): void | Stylesheet that colors midi-visualizer notes by voice index (sigma). |
|
| plotChordGraph | function(graph: Object, path: ?Object, keyIndex: number, mode: 'major' | 'minor'): string | Plots the chord graph as an SVG string; diatonic gray + 30% opacity, path edges gradient + full opacity. |
