app
|
app |
init wires reactivity, autoscroll, import-params; surfaces solver init failures via log
|
app#init |
log mirrors msg into status + console; with err prefixes 'Error:' and stringifies via .message, JSON, or template fallback
|
app#log |
runSolver bails when not ready, drives compose hooks, status (Done / Partial / No-solution), catches errors, missing window.Tone tolerated
|
app#runSolver |
solveStep records raw-output tabs (with/without stats, with/without partLabel); resetResults clears state; loadPreset variants; updateGraph renders from form or hook payload, bails on missing data, resets invalid per-part chords to tonic
|
app#solveStep |
compose
|
compose |
returns null on empty input; emits MIDI + parts + solved cache + progression lines on the multi-label happy path; reports failed labels on partial fail; reuses Step2 + Step3 once for repeated labels via the label cache; falls back when step.solve returns null
|
compose |
modelChords
|
modelChords |
emits a structurally complete MZN with F4, H20 and cost_matrix; falls back to the graph tonic on opposite-mode tonic input
|
modelChords |
emits cost_matrix when creativity > 0; grows n_nodes when a preset adds chromatic nodes
|
modelChords |
modelNotes
|
modelNotes |
emits a well-formed CSP with include, var declarations and solve satisfy and no minimize
|
modelNotes |
supports scale, chord, atonal and minor pitch domains
|
modelNotes |
emits bare constraints without sentinels when rest_pct = 0; emits holds and rests budget with sentinel-guarded H12, H19, M1 and M9 when rest_pct > 0
|
modelNotes |
emits cross-voice inequality and parallel-fifth and parallel-octave constraints when H12 and M14 toggles are active
|
modelNotes |
emits H19 interval constraints across phi thresholds at <= 0.2, mid and >= 0.8; skips them at neutral 0.5
|
modelNotes |
emits xi seeding with max_interval, anti-osc and empty-cs branches; covers filterByDissonance variants
|
modelNotes |
CONTROLS
|
CONTROLS |
stepBy bumps params[name] by delta and clamps to [min, max]
|
CONTROLS#stepBy |
clampVoicePitchRange snaps the just-edited field to the other when the range inverts; no-op when range is valid
|
CONTROLS#clampVoicePitchRange |
isDuplicatePart + duplicateSourceIndex flag reused labels in 'parts'/'step1.parts' sections; 1-based source index, 0 when none, undefined-list-safe
|
CONTROLS#isDuplicatePart+duplicateSourceIndex |
setupChordTonesTristate cycles free to scale to chord on change; visual: chord = checked, scale = indeterminate, free = neither
|
CONTROLS#setupChordTonesTristate |
setupFeedbackTristates scans [data-tri-group] fieldsets, seeds triData[group][name] with 'neutral', toggles aria-invalid + tristate-* classes through the cycle
|
CONTROLS#setupFeedbackTristates |
downloadBlob
|
downloadBlob |
triggers an anchor download with stem return; accepts a direct Blob or decodes Base64 to audio/midi with a default UTC-timestamp filename
|
downloadBlob |
submitFeedback
|
submitFeedback |
downloads MIDI, builds a mailto URL from form data and parameters and closes the dialog; falls back to '-' for missing form fields
|
submitFeedback |
INSTRUMENTS
|
INSTRUMENTS |
holds 16 GM Level-1 families keyed by family name, each with 8 program names in canonical GM 1.0 ordering
|
INSTRUMENTS |
integration: midi-writer-js
|
- |
emits a real MIDI binary with the expected header from a realistic solution
|
generateMidi |
produces one MTrk per voice in the combined file when multiple voices are present
|
generateMidi |
integration: minizinc
|
- |
solves a trivial satisfy model and returns a solution
|
solveModel |
importParameters
|
importParameters |
parses JSON; rejects on invalid JSON or FileReader error
|
importParameters |
exportParameters
|
exportParameters |
serializes theta as JSON blob with parameters.json filename
|
exportParameters |
buildParameters
|
buildParameters |
extracts flat parameter defaults for scalars and checkboxes
|
buildParameters |
resolves nested defaults across same-step and cross-step counters; falls back when max is missing or counters are unresolvable
|
buildParameters |
PLOTTING
|
PLOTTING |
wireMidiToPlayer sets player.src + visualizer.src to combined data URL, binds visualizer once, and wires per-voice <midi-visualizer> elements via querySelectorAll
|
PLOTTING#wireMidiToPlayer |
buildResultTable shapes parts + labelCache + voiceConfig into the rendered result-table data; missing labels fall back to 'Part i', missing voice fields default
|
PLOTTING#buildResultTable |
applyVoiceStyles creates a #voice-colors style element on first call and sets per-voice rect.note rules; reuses the element on repeat
|
PLOTTING#applyVoiceStyles |
plotChordGraph renders SVG with diatonic nodes in gray when no path is given; adds gradient and a lit self-loop when a path is supplied
|
PLOTTING#plotChordGraph |
plotChordGraph works in minor mode and accepts costs as a plain Object at the post-orchestrator boundary
|
PLOTTING#plotChordGraph |
plotChordGraph handles chromatic edge cases by graying paths, drawing self-loop arcs only when present and placing single versus multi chromatics correctly
|
PLOTTING#plotChordGraph |
initSolvers
|
initSolvers |
calls init then returns the available solvers
|
initSolvers |
solveModel
|
solveModel |
returns the solution, statistics and status; logs info for non-OK status
|
solveModel |
wraps solver errors for falsy solve and rejections with or without detail
|
solveModel |
Step
|
Step |
derives index, id and name from the subclass name; schema throws Not implemented
|
Step#schema |
Solvable
|
Solvable |
exposes an abstract solve method that throws when not overridden
|
Solvable#solve |
Step1Parts
|
Step1Parts |
schema yields parts, tempo and part with sane defaults; renders BPM markup via tempo.format
|
Step1Parts#schema |
Step2Chords
|
Step2Chords |
schema appends the preset list from index.json; falls back to manual-only on fetch failure
|
Step2Chords#schema |
solve emits an NC-filled progression with chord-graph data and an empty concreteProgression in disabled mode without invoking the solver
|
Step2Chords#solve |
solve returns progression, cost and path on solver success; reports 'No chord progression found' when path is null
|
Step2Chords#solve |
Step3Notes
|
Step3Notes |
schema exposes top-level descriptors and format functions for pitch, seed, interval and rest; instrument groups carry running GM program numbers
|
Step3Notes#schema |
solve returns a 'No solution' message on null solver result; exposes solution + time-grid metadata for the composer cache on a real solution; derives bars from chords length when present
|
Step3Notes#solve |
system: pipeline workflow with default parameters
|
- |
app initializes and reaches ready state
|
- |
parameters round-trip through export and re-import
|
- |
Run button produces MIDI output
|
- |
MIDI player plays back from start to stop event
|
- |
MIDI download button triggers a file download
|
- |
system: performance benchmark
|
- |
B0: stability
|
- |
6 runs at default for warmup curve and steady-state variance
|
- |
B1: scaling voices
|
- |
| tests/system/performance.test.js |
- |
B2: scaling bars
|
- |
| tests/system/performance.test.js |
- |
B3: scaling constraint set
|
- |
| tests/system/performance.test.js |
- |
chordName
|
chordName |
returns label form without keyIndex; transposes to concrete chord with sharp/flat spelling and quality suffix; passes NC and unknowns through
|
chordName |
chordGraph
|
chordGraph |
provides major and minor defaults with nodes, tonic, cadence-normal-NC-loop cost ordering and edges aligned with costs.keys()
|
chordGraph |
adds chromatic nodes from a preset, applies preset costs, clamps self-loops and skips unknown edges
|
chordGraph |
timeGrid
|
timeGrid |
derives tau as LCM of voice durations (1 for unknowns), T = iota * zeta * tau, and per-voice onset sets
|
timeGrid |
generateMidi
|
generateMidi |
emits per-voice tracks with header meta and one NoteEvent per sub-beat for a 2-voice 2-sub-beat input
|
generateMidi |
extends preceding note via ties as a single T384 event and emits Cm key signature in minor mode; accumulates rests and orphan-ties as wait T256
|
generateMidi |
returns null on empty parts input such as when all step-3 parts are UNSAT
|
generateMidi |
emits TimeSig and KeySig at every multi-part boundary; scans ties across boundaries so held notes extend and meta events flush after
|
generateMidi |