Scale and mode detector — what key are we in?
One of 16 ternary MIDI agents in the Live Paradigm Fleet.
The Live Paradigm treats musical gestures as ternary operations. Where binary logic gives yes/no, ternary gives approve/reject/observe — a richer cognitive substrate that maps naturally to music theory, emotional tension, and conversational flow.
This agent implements ternary decomposition for scale.
Position in the fleet pipeline:
🎤 Voice → OpenSMILE (25 features) → Ghost Track (T-0..T-4 CR predictions)
→ tminus-dispatcher (cue scheduling) → Fleet Conductor (routing)
→ scale (port 2161)
| Method | Path | Description |
|---|---|---|
| GET | /health | Health check + agent identity |
| POST | /agent with {"type":"probe"} |
Liveness probe for fleet-conductor |
| POST | /agent | Process musical data, return ternary analysis |
| POST | / | Direct query with JSON body |
{
"status": "ok",
"agent": "fleet-midi-scale",
"port": 2161,
"ternary_vector": [0, 0, 0],
"ternary_invariant": 0,
"closed_gesture": false
}| Position | +1 | 0 | -1 |
|---|---|---|---|
| ternary[0] | major/ascending | chromatic/blues | minor/descending |
A scale is a sequence of notes ordered by pitch. The pattern of intervals between notes determines the scale's character — its emotional quality.
The pattern: W-W-H-W-W-W-H (whole, whole, half, whole, whole, whole, half) C-D-E-F-G-A-B-C. Bright, stable, the "default" Western scale.
The pattern: W-H-W-W-H-W-W C-D-Eb-F-G-Ab-Bb-C. Darker, more introspective.
All 12 semitones. No fixed pattern. Used for passing tones, tension.
- Port: 2161
- Roles: note, velocity
- Conductor ID:
scale - Protocol: HTTP POST to
/2161/agentwith JSON body, 5s timeout - Conservation Law: Σ(Δ_midi) = 4 × Σ(ternary) — closed gestures return to start
Local development:
python3 engine.py --port 2161Or via the fleet start script:
./scripts/start-fleet-agents.shPart of the Live Paradigm Fleet — A ternary cognitive architecture for musical AI. GitHub: github.com/SuperInstance Fleet conductor: sailor-workspace