Repository Public
1<!--2ORIX Sonata3File: Documentation/manual/instrument-lab.md4Author: Simon-Pierre Boucher5Contact: contact@spboucher.ai6-->7# Instrument Lab89Instrument Lab builds an instrument definition and lets you hear and measure it. The lab does not10talk to a synthesis engine directly: whatever you set becomes Sonata source,1112```sonata13instrument CrystalHarp {14 model plucked_string15 damping 0.01516 excitation pluck17 excitation.position 0.3518 envelope adsr19 envelope.attack 5ms20}21```2223and that source is compiled like any other. What you hear and what the analysis shows is what24this code produces.2526## Working in the lab27281. Choose an engine in the list on the left (grouped by family). Its description, synthesis29 method, range and articulations come from the registry.302. Optionally choose a preset. A preset's values are applied inside the engine: the sliders keep31 showing the model's defaults until you move them, and a parameter you move overrides the preset.323. Move parameters. Each row shows the unit and the allowed range; a parameter you set is shown33 in bold and written to the source; the arrow returns it to the default.344. Listen with the on-screen keyboard or the computer keyboard (A W S E D F T G Y H U J K play35 C to C in the chosen octave). *Play Scale* plays one octave of the major scale.365. Compare: slots **A** and **B** hold two versions; switch and play.376. Read the analysis of the test note (one note held for one second, rendered offline without38 limiter): waveform, calibrated spectrum, harmonics with their deviation from exact multiples39 and the error between the measured fundamental and the requested pitch, and the measured40 envelope beside the theoretical ADSR when the instrument specifies one.4142*Insert into Composition* adds the definition to the document's source (undoable). *Save…*43writes a `.sonatainstrument` file, which is Sonata source; *Open…* reads one back by compiling it.4445## Patch instruments4647With `model patch` the instrument is a per-voice graph. The lab draws the graph the compiler48built: columns follow the signal flow, dashed pink connections are feedback through a `delay`.49Select a node to edit each input: a constant, a connection to another node, a per-note value50(`note.freq`, `note.velocity`, `note.gate`…) or the registry default. *Add Node* adds an51unconnected node; a node nothing reads can be removed. Every edit regenerates the `graph { }`52block and recompiles; the *Source* button shows the block for direct editing. A loop without a53delay is refused by the compiler and reported under the source.5455When a graph written with expressions (`osc1 + osc2 * 0.6`) is edited visually, the regenerated56source names every intermediate node explicitly (`n5`, `n6`…). The graph is the same; the57spelling is more explicit.5859## Limits6061- A few registry parameters have names the language cannot write (`drawbar.16`,62 `drawbar.5_1_3`…). They are shown as "set by presets only".63- Live audition loads a program containing only the lab instrument into the shared engine; the64 document's own program is loaded again when you leave the lab.65- The ideal-string calculator is a reference formula with dimensional validation, not the66 engine's model.67- Nobody has listened to these instruments as part of the build: the lab's figures are68 measurements, and the judgement of the sound is yours.69