Repository navigation
instruments modulation
Working manual · 0.0.1-alpha · source snapshot 16 November 2026
Current playback supports SINGLE and SLICE with forward, reverse, ping-pong and loop modes. See the filter reference for model-specific modulation destinations.
V26 appends RES/DRV/ENV/DEC/MRP/MIX/ACC/TRK/LVL destinations to the four existing destinations. These operate on the new DSP model filters; legacy LPF/HPF/BPF retain CUT only. See DSP mappings.
From INST, Select+Up opens the M node (INST EXT) above INST; Select+Down returns. Both pages share instrument selection. L1/R1 selects instrument, D-pad selects a slot/field, and A+D-pad edits: Left/Right by 01, Up/Down by 10 hexadecimal for numeric fields. The page displays hex throughout: ADSR times 00–FF centiseconds, sustain 00–64 percent, amount -64–+64 percent. Fractional rate denominators are hex too (1/10 = 1/16 beat). The underlying values and saved format are unchanged. Four 84-pixel panels on 96-pixel strides end at y=468, one 12-pixel row above the bottom. All parameter text uses the native large font; no help footer is drawn. Paired Core, Signal, Pulse and Tone main colours fill each panel's leftmost 12-pixel column. Parameter areas use Surface to separate the lanes. The visualiser and bipolar windows each have a 12-pixel Surface border, with another 12-pixel gap between their borders. Paired secondary colours fill their interiors, with main-colour contours and meters. Playback uses the same small marker style as Phrase. Existing INST controls remain.
Each slot selects OFF/ADSR/LFO and a destination. VOL/PAN/PIT/CUT are the original destinations; the DSP-model destinations are listed above. New slots start OFF. OFF bypasses modulation and uses Disabled for text/graphics, DisabledSurface for the lane and DisabledRaised for window interiors. Its parameter values are retained. Zero amount is neutral, including on migrated projects. Positive VOL ADSR crossfades unity gain to the envelope; negative VOL ADSR subtracts the envelope from unity. LFO VOL offsets unity. PAN offsets stereo balance, PIT spans twelve semitones per full slot output, and CUT offsets normalized cutoff. Multiple slots combine with bounded final gain, pitch, pan and cutoff. CUT follows the selected instrument filter. Legacy LPF/HPF/BPF expose cutoff modulation; the newer DSP models also expose the applicable destinations listed above. Static cutoff also affects audio. See Instrument filters for each model’s mappings.
ADSRs are per voice, start on note-on and release from their actual level on note-off. Nonzero ADSR slots retain release tails before the existing click ramp; sample EOF and note-cut still end a voice immediately. The preview shows configured attack/decay/release proportions and a nominal 250 ms sustain plateau. Sustain has no fixed runtime duration. An early release displays its captured start level.
LFOs offer SIN, TRI, SAW (rising), RAMP (falling), SQR and eight-step RND. Their one-cycle previews use the same waveform function as audio. Beat marks and the editable beats/cycle value set the time scale. RND uses the published seed and cycle number; its displayed steps are those used by the actual generator.
FREE has one continuous phase per instrument/slot while transport runs, including silent intervals. Note-on never resets it. RETRIG resets per voice; HOLD completes one cycle and keeps its endpoint; ONCE completes one cycle and returns to its start. SYNC uses the shared playback musical tick divided by 24 times beats/cycle. Rates range from 1/16 to 32 beats per cycle. Pause freezes the transport and hides markers; stop clears voices. A fresh Play uses the requested editing position.
The existing independent Song lanes have no single absolute Song cursor. The shared reference therefore assigns each Song position the duration of its longest Chain (at least one phrase for blank positions). Starts, explicit jumps and cues resolve that score offset plus the groove-aware local step tick. A fallback lane starting at an earlier Chain does not move the shared reference. Ordinary lane, Chain and Phrase loops advance the reference continuously; they do not restart SYNC. Explicit Loop resets it to the selected lane's region start (or the scope start outside Song). Timing uses the current step's existing sample duration and 24-tick beat; tempo affects elapsed samples, never the phase at a given score tick. Live score edits retain the reference until an explicit positional request.
core/audio/mod/Modulation.hpp owns saved settings and the shared visual state.
Inst_Synth now uses audio/mod/InstrumentModulator to adapt each slot to the
framework ENV (Envelope) and clocked LFO (LfoRuntime). The matrix remains
Attack/Decay/Sustain/Release for ADSR and Amount/Waveform/Trigger/Rate for LFO.
Destination and ADSR amount remain slot settings. No CTP/CTI or FX IDs change.
ENV uses a linear, unipolar envelope. Sample-rounded stages retain elapsed time
during live parameter edits, including shortening a stage into the next one.
Note-off captures the last emitted value; completion and phase telemetry feed
the existing release-tail check and visualiser. LFO supports all five existing
playback modes, with FREE coordinates supplied by the instrument host and SYNC
derived from the transport position. Framework shape 8 provides compatible seeded
eight-step random; saved INST waveform IDs remain unchanged. Signed amount is
applied once, before destination maths. ADSR configuration is cached per voice
and rebuilt only when its parameters change. Synth architectures can reuse these
processors directly; generic oscillator/LSDW legacy slots have since been removed
from playback (see oscillators (repository reference: oscillators.md)).
Inst_Synth applies modulation to actual sample voices. PlaybackEngine derives
musical ticks from its existing sample clock. Prepared score offsets and immutable
instrument definitions are built outside audio. Active voices adopt modulation
edits on the existing playback-update tick; a type/trigger edit restarts that
slot, while parameter edits retain its progress.
The backend selects the highest voice serial still active for the monitored
instrument, including release tails. The SDL boundary publishes four fixed-size
states through versioned lock-free 32-bit atomic words; readers retry at most three
times and retain their previous snapshot when busy. No renderer, filesystem,
allocation or new lock enters the callback. ModulationEditor owns logical
editing; ModulatorVisual draws every slot with integer-aligned SDL primitives
and existing semantic theme roles. The bipolar meter displays value × amount;
it is a source modulation value, before combined destination clamping.
Validation: instrument_modulation, modulator_visual, sdl_audio, audio,
synth, playback_modes, instrument and persistence tests. The visual test
writes build/modulator-visual.bmp; Contour --inst-ext --snapshot <path.bmp>
renders the page through the application. Handheld performance still requires
profiling on physical RG35XX H hardware.
| Documentation still to add |
|---|
| Annotated current-build screenshots and a recorded controller walkthrough for this topic. |
Repository sources used for this page:
docs/instrument-modulation.md
This is a documentation/source review, not a new runtime or hardware test. Physical response, screenshots and listening examples still need verification on a recorded build.