Skip to main content

Module render

Module render 

Source
Expand description

Rendering a preset and its notes to audio through a synth.

A Renderer plays a RenderJob: the plug-in state of a preset, the notes and the Recipe. It returns the audio and a RenderRecord that names everything the audio depends on, so a later comparison can cite it. Calibration, compare, refine, the bench and the dataset all render through this trait and add no recipe field of their own.

Renders of one preset are not bit-identical: a synth starts its unison voices at random phases. Compare two renders within the repeat-render spread, never sample by sample.

fake::FakeRenderer is a seeded additive synth, so the render code runs in CI with no plug-in. plugin::PluginRenderer renders through a real plug-in in the sound-to-patch-host process, with the state that state::preset_state builds.

Modules§

check
The load check: a render counts only when the plug-in kept the preset.
fake
A fake renderer for tests: a seeded additive synth with no plug-in.
file
The render command: a preset and a MIDI file to a WAV file and a render record, through the load check.
plugin
The renderer that plays a job through a real plug-in.
recipe
The render recipe: the one fixed performance that every render plays.
session
The render session: the one worker pool that calibration, refine, the bench and the dataset render through. None of them owns a pool.
spread
The repeat-render spread: the noise floor that every later comparison cites.
state
The plug-in state of a preset, and the check of a state the plug-in saved back.
timing
Render and load timing, the table refine sets its budget from.
vita
The open Vital engine as a Renderer, for single notes in tests and CI with no Vital licence.
wire
The protocol between the library’s render::plugin::PluginRenderer and the plug-in host process, sound-to-patch-host.

Structs§

ClipEnd
Where a clip ends.
Control
A controller change and its time.
HostIdentity
What renders: the synth and its build, the host and the architecture of the process that loads the plug-in.
NoteEvent
A note-on or note-off at a sample frame of the clip.
PresetState
The plug-in state of a preset: the bytes a synth loads as its state, and the synth they belong to. Each synth’s render state adapter builds it.
Recipe
The render recipe. Recipe::current is the only constructor, so a recipe always matches its version.
RenderJob
One render: the preset state, the notes, the tempo and the recipe.
RenderNote
One note to play: a MIDI key, its start and end in the clip and its velocity.
RenderRecord
Everything a render depends on, so a consumer can cite it and analyze the audio with the same notes.
Rendered
The audio of a render and its record.
TailWatch
Finds the end of a clip while it renders, one frame at a time.

Enums§

ControlKind
A MIDI controller change at a time of the clip. A plug-in in a VST3 host gets controllers only through its MIDI mapping; a controller it does not map is dropped without an error.
EventKind
Whether a note event starts or ends a note.
Material
What kind of sound a recipe clip plays. A pluck plays as a lead.
Oversampling
The oversampling of Vital, its only quality setting. The preset stores it as the index of the factor.
PlayError
A note or a controller change that cannot be played.
PreRoll
One step of the pre-roll, which plays after the state load and before the clip and is thrown away.
ProcessMode
How the host tells the plug-in it processes.
RenderError
A render that failed.

Constants§

MAX_CONTROLLER
The largest value of a MIDI controller: 7 bits.
MAX_KEY
The highest MIDI key.
MAX_NOTE_END
The latest time a note may end: 10 minutes. A clip holds every sample in memory, and a longer part than a stem takes splits into several renders.
MAX_PITCH_BEND
The largest pitch bend value: 14 bits.
PITCH_BEND_CENTRE
The pitch bend value of no bend, the centre of the 14-bit range.
RECIPE_VERSION
The version of Recipe::current.

Traits§

Renderer
Plays a RenderJob through one synth and returns the audio.

Functions§

frame_of
The frame of a time: the time times the rate, rounded to the nearest sample.
note_events
Turns notes into events sorted by frame, a note-off before a note-on on the same frame.
notes_of_list
The render notes of a note list, such as the one the MIDI reader gives. A note without a velocity takes default.