MIDI, clocks and composition

Schedule notes, map expression and compose effect chains through the Processor contract.

The same Processor architecture supports MIDI utilities, timed playback and multi-effect products. A note mapper or sequencer is a reusable module with ports, state and parameters; its host connects it into a chain.

Inputs, outputs and clock ownership

Declare audio and MIDI ports in the Audio SDK. The host delivers events and prepared resources; the Processor advances time and emits events through the shared contract. processor supplies ProcessorDefinition, ProcessSpec and ProcessorBlock; processor-events supplies the event vocabulary. An event-only Processor can declare zero audio inputs and outputs while still processing blocks. See Define a Processor module.

Use control/musical-clock for musical units and frame boundaries, rather than rounding each note interval independently. Preserve note-off and panic behavior on stop, loop, transpose or resource replacement. mpe-ingress translates member/master expression with note identity; the destination must support those events to preserve independent expression on overlapping notes of the same pitch.

Effect ordering and live transitions

processors/serial-effect-stack schedules one to six slots with stable identities and bounded transitions. The consuming Processor owns each effect’s prepared state and controls. The scheduler fades to dry, commits a topology change, waits for the revision-matched clear acknowledgement, then fades back. Its global staged-clear budget is 256 scalar stores per input frame.

processors/multi-effect-chain supplies the reusable MultiFX composition; its focused subpaths expose the same chain’s controls, mappings and effect groups. They are pieces of that composition, rather than alternate leaf algorithms. Use the leaf categories when building a smaller custom effect.

Playback and reference processors

clip-player plays prepared stereo clips with source-rate conversion and transport. stem-player keeps four prepared stereo stems aligned. Neither is a file downloader or decoder. MIDI timeline/pattern readers similarly consume prepared event data. Resource installation and device access stay with the host.

The reference-smoothed-gain and serial-effect-stack-reference entries are qualification examples, useful for understanding deterministic execution and scheduling. They are not complete musician-facing products. The root dsp and processors barrels provide discovery; import focused processing paths in a module.

Toolkit reference

Import paths below are suffixes of maruaudio/dsp/. Use the exported types and setters in your installed version for complete signatures and defaults.

Processors

Import suffixPurposeSelected API
processors/midi-timelineBounded sample-clock MIDI timeline playback shared by prepared MIDI sources, including note release and loop transport.createState, process
processors/midi-note-mapPrepared four-voice MIDI note maps with held-source snapshots and shared-output reference counting.createState, process
processors/reference-smoothed-gainQualification-only mono f32 smoothed-gain processor with deterministic reset.createReferenceSmoothedGainState, processReferenceSmoothedGain
processors/serial-effect-stackBounded serial effect scheduling with stable slot identities, opaque type tags and queued live transitions.createSerialEffectStackState, serialEffectStackProcessesWet
processors/serial-effect-stack-referenceQualification-only restricted three-stage consumer of the serial effect scheduler.createSerialEffectStackReferenceState, serialEffectStackReferenceTick
processors/mpe-ingressMIDI 1.0 MPE zone/member expression translated into identified notes and note-expression events.createMpeIngressState, processMpeIngress
processors/multi-effect-chainPrepared reusable MultiFX chain engine.Re-exports the focused helpers below.
processors/multi-effect-chain/constantsStable constants and algorithm vocabulary for the MultiFX chain.MULTI_EFFECT_CHAIN_PROCESSOR_SLOT_COUNT, MULTI_EFFECT_CHAIN_PROCESSOR_ORDER_COUNT
processors/multi-effect-chain/controlsParameter updates and control application for the MultiFX chain.MULTI_EFFECT_CHAIN_BITCRUSHER_BITS_MIN, MULTI_EFFECT_CHAIN_BITCRUSHER_BITS_MAX
processors/multi-effect-chain/control-mappingNumeric control/macro mapping for the MultiFX chain.exponentialControl
processors/multi-effect-chain/driveDrive/distortion stages used by the MultiFX chain.createDriveState, driveTick
processors/multi-effect-chain/dynamicsDynamics stages used by the MultiFX chain.createDynamicsState, dynamicsTick
processors/multi-effect-chain/equalizerEQ stages used by the MultiFX chain.createEqualizerState, equalizerTick
processors/multi-effect-chain/filtersFilter stages used by the MultiFX chain.createFilterState, filterTick
processors/multi-effect-chain/modulationModulation stages used by the MultiFX chain.createPhaserControlsState, advanceStereoPhaserControls
processors/multi-effect-chain/reverbsReverb stages used by the MultiFX chain.createReverbWidthState, processReverbTailEq
processors/multi-effect-chain/slotsSlot state and dispatch for the MultiFX chain.createSlotPlaceholders, processSlotState
processors/multi-effect-chain/stereo-spectralStereo and spectral stages used by the MultiFX chain.createStereoFrequencyShift, tickStereoFrequencyShift
processors/strum-notesSelect a contiguous ascending chord-tone window for strummed note positions; caller-provided output length sets the position count.selectChordStrumNotes
processors/stem-playerAligned four-stem prepared stereo clip playback and mixing.createState, process
processors/clip-playerOne prepared planar stereo clip at any 8-384 kHz source rate: sample-clock transport with run/loop/normalised seek, 4-point Hermite resampling to the host rate and a 5 ms declicked master gain.createState, process
processors/division-clockFirmware-derived divided musical clock with free-running or external MIDI-clock timing and 48-frame quantization.createDivisionClock, divisionClockFreeMultiplier
processors/pattern-arpeggiatorFirmware-derived two-engine arpeggiator with held/latched notes, orders, rests, random octaves and sustain gestures.createPatternArp, resetPatternArp
processors/midi-patternBounded held-note step patterns with fractional-frame timing, seeded selection, velocity and MIDI event input/output.createMidiPatternState, configureMidiPatternProcessor

Control and clocks

Import suffixPurposeSelected API
control/param-macrosPrepared macro-to-parameter table with linear, exponential, logarithmic and S-curve mapping. The owning Processor dispatches targets.paramMacroCurve, paramMacroValue
control/musical-clockBeat/time/pulse-to-frame conversion and tempo/transport anchoring; fractional grid boundaries avoid accumulated rounding drift.createMusicalClock, musicalSecondsPerBeat

Return to DSP fundamentals for I/O, lifecycle, units and the category map.