Input Components
These components form the bridge between external input devices — QWERTY keyboards and MIDI controllers — and the internal EventBus that drives the coil editor system. Both text-based and hardware-based input paths are supported, and both are designed to be layer-aware: the active grammar layer (melody, harmony, or rhythm) determines how raw input is interpreted before being published as Uniform Solfège tokens.
<ppt-solfege-text-input>
Tag: ppt-solfege-text-input · Class: SolfegeTextInputComponent
<ppt-solfege-text-input> is the primary text-based input gateway to the coil system. It renders a text field alongside a MIDI Connect button with a small connection-state indicator dot. Taken together, these two surfaces cover both keyboard-typed and MIDI-generated Uniform Solfège input.
How it works
Auto-binding to a Phrase Editor
The component monitors the active-phrase-editor-changed EventBus event. Whenever a<ppt-phrase-editor> elsewhere on the page gains focus, this input automatically binds to it: the indicator dot turns green, and the text field pre-populates with the editor's current content. All subsequent typed or MIDI-generated tokens are forwarded to that editor via the configured emit-id EventBus channel. This binding model means a single<ppt-solfege-text-input> can serve an entire coil without manual wiring — focus is the routing signal.
Typed Solfège input
Any valid Uniform Solfège phrase typed into the text field (e.g. do mi so,Re♭ Fi La) is parsed into an array of glyph tokens on submission (Enter key). The parser is tolerant of capitalisation and common shorthands. Tokens are then published on theemit-id channel for the bound phrase editor to consume.
Integrated MIDI input
The MIDI Connect button requests WebMIDI API access. Once a MIDI device is connected, incoming note events are intercepted and routed through a context-aware mapper determined by the currently focused layer:
- Melody layer →
PitchMapper— maps MIDI note numbers to Uniform Solfège pitch syllables relative to the active tonic. - Harmony layer →
HarmonyMapper— interprets simultaneous note clusters as harmonic voicings and maps them to compound glyph sequences. - Rhythm layer →
RhythmMapper— maps note durations and onset timing to rhythmic Uniform Solfège tokens (e.g.Du De Di).
Parsed tokens are published on the emit-id channel, identical to the typed-input path. The MIDI bridge built into <ppt-solfege-text-input> covers the same functionality as the standalone <ppt-midi-input-bridge> — the standalone component exists for contexts where you want MIDI routing without a visible text field.
Structural command chords
Beyond note-to-syllable mapping, the MIDI input layer recognises a set of two-notecommand chords that trigger structural operations on the coil. HoldingC3 + B4 simultaneously arms the command mode; an additional note determines the operation:
| Chord (C3 + B4 +) | EventBus event published | Effect |
|---|---|---|
E3 | coil-layer-delete | Delete the active layer |
G3 | coil-layer-add | Add a new layer |
F#3 | coil-nav-up | Navigate focus up one layer |
D#3 | coil-nav-down | Navigate focus down one layer |
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
emit-id | string | "glyph-input" | The EventBus channel name on which parsed glyph tokens are published. A paired <ppt-phrase-editor listen-id="…"> must use the same value to receive the tokens. |
Live demo
The input below is wired to the phrase editor via the glyph-input-demo channel. Type a Uniform Solfège phrase (e.g. do re mi) and press Enter to populate the editor. Use the MIDI Connect button to route a connected MIDI keyboard through the same channel.
View Source Code
<ppt-solfege-text-input emit-id="glyph-input-demo"></ppt-solfege-text-input>
<ppt-phrase-editor listen-id="glyph-input-demo"></ppt-phrase-editor>MIDI Solfège Input
Both input components described on this page support a common conceptual model: translating the physical gestures of a MIDI keyboard into the symbolic language of Uniform Solfège. This section explains that model in depth.
From MIDI note numbers to Solfège syllables
A standard MIDI keyboard transmits note-on and note-off messages encoded as integers from 0 to 127, where middle C (C4) is MIDI note 60. On its own, a MIDI note number is just a position — it carries no inherent tonal meaning. The mappers in PPT's input system translate that raw position into a Uniform Solfège syllable by computing the interval between the played note and a contextual reference point (typically the active tonic or the metric grid position).
For example, in a melody context with C as the tonic:
- MIDI 60 (C4) →
Do - MIDI 62 (D4) →
Re - MIDI 64 (E4) →
Mi - MIDI 65 (F4) →
Fa - MIDI 67 (G4) →
So
Notes outside the twelve chromatic positions (once microtonal Solfège is engaged) are mapped to diacritic-inflected syllables using the prime-family suffix system: Sub, HalfSub, HalfSup, Sup, and Axis.
Why the system is layer-aware
PPT's coil editor organises musical material into three grammar layers — melody, harmony, and rhythm — each governed by a different GrammarInterpreter. The same physical gesture on a MIDI keyboard carries fundamentally different information depending on which layer is active:
- Melody layer (
PitchMapper): A single note pressed and released maps to a single pitch syllable. The duration of the note-on event may optionally influence the rhythmic weight attached to the glyph, but the primary signal is pitch class and octave register. - Harmony layer (
HarmonyMapper): Multiple simultaneous notes are treated as a chord voicing. The mapper resolves the set of intervals present in the chord and maps them to a compound Uniform Solfège expression representing the harmonic context (e.g. a triad built onDo). - Rhythm layer (
RhythmMapper): Pitch is secondary; what matters is the timing of note-on events relative to the metric grid. Onset position and inter-onset interval are mapped to rhythmic Uniform Solfège tokens such asDu,De, andDi, encoding metric placement.
The active mapper is selected automatically when the focused layer changes, via thelayer-focus-changed EventBus event. No manual reconfiguration is required — the musician simply moves focus between layers and the MIDI input responds accordingly.
Structural command chords
Holding C3 + B4 simultaneously signals that the next note pressed is a structural command rather than a Solfège token. This two-key anchor chord was chosen because the interval (a major seventh across two octaves) is unlikely to appear in normal musical input. The modifier note determines which structural operation is dispatched to the coil editor via the EventBus, as detailed in the table in theppt-solfege-text-input section above.
<ppt-midi-input-bridge>
Tag: ppt-midi-input-bridge · Class: MidiInputBridgeComponent
<ppt-midi-input-bridge> is a headless, standalone MIDI bridge. It provides the same layer-aware MIDI-to-EventBus routing as the MIDI button in<ppt-solfege-text-input>, but without any visible UI. Use this component when you want pure MIDI input routing in a context where a text field would be redundant or unwanted — for instance, a performance-only view, or a custom layout that provides its own input affordances.
<ppt-solfege-text-input> already contains an integrated MIDI bridge — the MIDI Connect button in that component covers the full set of layer-aware mapping and structural command chord behaviours described here.<ppt-midi-input-bridge> exists exclusively for situations where you want that same capability without the text input surface. Do not use both components simultaneously against the same emit-id channel unless you intentionally want two separate MIDI input paths.Behaviour
Unlike the other input and editor components, MidiInputBridgeComponent doesnot extend BasePPTComponent. It connects directly to the WebMIDI API on construction and manages its own lifecycle independently of the component shadow DOM. It subscribes to:
layer-focus-changed— to swap the active mapper (PitchMapper, HarmonyMapper, or RhythmMapper) as the user moves between coil layers.active-phrase-editor-changed— to track which phrase editor should receive the parsed tokens.
All note-on events from the connected MIDI device are passed through the active mapper and published as Uniform Solfège glyph tokens on the emit-id channel. Structural command chords (C3 + B4 + modifier) are handled identically to the integrated bridge.
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
emit-id | string | — | The EventBus channel on which parsed glyph tokens and structural commands are published. Should match the listen-id of the target phrase editor. |
Usage example
Place <ppt-midi-input-bridge> anywhere in the document — it renders no visible output. The example below wires it alongside a <ppt-phrase-editor>in a layout that provides its own controls:
View Source Code
<!-- Headless MIDI bridge — no UI rendered -->
<ppt-midi-input-bridge emit-id="midi-only-channel"></ppt-midi-input-bridge>
<!-- Phrase editor bound to the same channel -->
<ppt-phrase-editor listen-id="midi-only-channel"></ppt-phrase-editor>EventBus Summary
Both components communicate exclusively through the global EventBus. The table below lists every event each component subscribes to or publishes. The {emit-id} placeholder represents the value of the component's emit-id attribute at runtime.
| Event | Direction | ppt-solfege-text-input | ppt-midi-input-bridge | Description |
|---|---|---|---|---|
active-phrase-editor-changed | Subscribes | ✔ | ✔ | Fires when a <ppt-phrase-editor> gains focus. Both components use this to track the current binding target and update their internal state. |
layer-focus-changed | Subscribes | ✔ | ✔ | Fires when the active coil layer changes. Triggers a mapper swap (PitchMapper → HarmonyMapper → RhythmMapper) in the MIDI routing logic. |
{emit-id} | Subscribes | ✔ | — | ppt-solfege-text-input listens on its own channel to pre-populate the text field when the bound editor's content changes externally. |
{emit-id} | Publishes | ✔ | ✔ | The primary output channel. Carries parsed Uniform Solfège glyph token arrays from both typed and MIDI input paths. |
coil-layer-delete | Publishes | ✔ | ✔ | Published when the C3 + B4 + E3 structural command chord is detected. Instructs the active coil to delete the focused layer. |
coil-layer-add | Publishes | ✔ | ✔ | Published when the C3 + B4 + G3 structural command chord is detected. Instructs the active coil to add a new layer. |
coil-nav-up | Publishes | ✔ | ✔ | Published when the C3 + B4 + F#3 structural command chord is detected. Moves layer focus up by one position. |
coil-nav-down | Publishes | ✔ | ✔ | Published when the C3 + B4 + D#3 structural command chord is detected. Moves layer focus down by one position. |