Instrument Lab
Instrument Lab builds an instrument definition and lets you hear and measure it. The lab does not talk to a synthesis engine directly: whatever you set becomes Sonata source,
instrument CrystalHarp {
model plucked_string
damping 0.015
excitation pluck
excitation.position 0.35
envelope adsr
envelope.attack 5ms
}and that source is compiled like any other. What you hear and what the analysis shows is what this code produces.
Working in the lab
- Choose an engine in the list on the left (grouped by family). Its description, synthesis method, range and articulations come from the registry.
- Optionally choose a preset. A preset's values are applied inside the engine: the sliders keep showing the model's defaults until you move them, and a parameter you move overrides the preset.
- Move parameters. Each row shows the unit and the allowed range; a parameter you set is shown in bold and written to the source; the arrow returns it to the default.
- Listen with the on-screen keyboard or the computer keyboard (A W S E D F T G Y H U J K play C to C in the chosen octave). Play Scale plays one octave of the major scale.
- Compare: slots A and B hold two versions; switch and play.
- Read the analysis of the test note (one note held for one second, rendered offline without limiter): waveform, calibrated spectrum, harmonics with their deviation from exact multiples and the error between the measured fundamental and the requested pitch, and the measured envelope beside the theoretical ADSR when the instrument specifies one.
Insert into Composition adds the definition to the document's source (undoable). Save…
writes a .sonatainstrument file, which is Sonata source; Open… reads one back by compiling it.
Patch instruments
With model patch the instrument is a per-voice graph. The lab draws the graph the compiler
built: columns follow the signal flow, dashed pink connections are feedback through a delay.
Select a node to edit each input: a constant, a connection to another node, a per-note value
(note.freq, note.velocity, note.gate…) or the registry default. Add Node adds an
unconnected node; a node nothing reads can be removed. Every edit regenerates the graph { }
block and recompiles; the Source button shows the block for direct editing. A loop without a
delay is refused by the compiler and reported under the source.
When a graph written with expressions (osc1 + osc2 * 0.6) is edited visually, the regenerated
source names every intermediate node explicitly (n5, n6…). The graph is the same; the
spelling is more explicit.
Limits
- A few registry parameters have names the language cannot write (
drawbar.16,drawbar.5_1_3…). They are shown as "set by presets only". - Live audition loads a program containing only the lab instrument into the shared engine; the document's own program is loaded again when you leave the lab.
- The ideal-string calculator is a reference formula with dimensional validation, not the engine's model.
- Nobody has listened to these instruments as part of the build: the lab's figures are measurements, and the judgement of the sound is yours.