From e08fa22eb091a093afbbcc6bd04bed669471e58f Mon Sep 17 00:00:00 2001 From: MelekTaus Date: Tue, 6 Oct 2026 11:34:57 +0200 Subject: [PATCH] Describe the Play field of a Sample #331 Co-Authored-By: Claude Opus 5.5 --- Instruments.md | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/Instruments.md b/Instruments.md index 5cfa5f3..cda222f 100644 --- a/Instruments.md +++ b/Instruments.md @@ -19,12 +19,28 @@ A at 440 Hz, 127 the highest. A note is named with its octave after it and no da | Node | What it does | | --- | --- | | **Notes** | Where the notes come in. `any` triggers what it is connected to for every note from **From** to **To**. `note` is the number of the note played, `frequency` its pitch in Hz (`440 * 2^((note - 69) / 12)`), `velocity` how hard it is struck, 0 to 1. With **Single notes** there is one trigger output for every note in the range as well, and each can have a **name** of its own (*Name of C2* in the inspector): the output shows it, and a piano roll will. | -| **Sample** | Plays a sound asset when its `trigger` is on. With **Follow note** (on by default) it plays higher or lower by the distance from **Root**, the note it sounds as it is (C4 by default), and **keeps its length** — it is played by the same worklet as a Pitch (#317). Off, every note plays it as it is, as for a drum. **Mode**: *Gate* ends it with the note, faded out in 10 ms; *One-shot* plays it through whatever the note does. **Loop** repeats it, between **Loop start** and **Loop end** in seconds where they are set (0 is the end of the sound). The volume of the sound asset counts. | +| **Sample** | Plays a sound asset when its `trigger` is on. With **Follow note** (on by default) it plays higher or lower by the distance from **Root**, the note it sounds as it is (C4 by default), and **keeps its length** — it is played by the same worklet as a Pitch (#317). Off, every note plays it as it is, as for a drum. **Play** says how it is played while the note is held and once it is let go (table below). **Loop start** and **Loop end** are in seconds, 0 at the end being the end of the sound. The volume of the sound asset counts. | | **Parameters** | The instrument's own parameters, each a number output with a default — like the parameters of a sound FX's Input. One per instrument. | | **Sound FX** | Sends the sound through a sound FX asset, as if it were the sound at the FX's Input. Every parameter of that FX is an input here; one left open is the FX's default. The node is titled after the FX, and a double click opens it. | | **Output** | What is heard. Unlike every other sound input it takes **any number** of sounds and plays them together: the layers of the instrument. One per instrument. | | Gain, Pitch, 5-Band-EQ, Mix, Delay | The effects of a [sound FX](Sounds#sound-fx), the same nodes. | +**Play** of a Sample: + +| Play | While the note is held | When it is let go | +| --- | --- | --- | +| *Gate* (default) | Plays the sound once | Fades out in 10 ms | +| *One-shot* | Plays the sound once | Plays on to the end of the sound | +| *Loop* | Repeats from *Loop start* to *Loop end* | Fades out in 10 ms | +| *Loop, then release* | Repeats from *Loop start* to *Loop end* | Finishes the round it is in, then plays what comes after *Loop end*, to the end of the sound | + +*Loop, then release* is the sampler's sustain loop: a string, an organ or a pad held as long as the +key, and then its natural decay. It needs something after *Loop end*. With *Loop end* at 0 the loop +runs to the end of the sound, so the note ends with the round it is in. Nothing plays until it is +stopped any more: a drone in a game is a *Loop* played by `Play note` with `duration` 0, which holds +it until a `Stop sound`. A Sample saved with the former **Mode** and **Loop** is loaded as one of +these: *Gate* or *One-shot* without Loop stays what it was, either with Loop becomes *Loop*. + **Triggers.** The outputs of a Notes node that say "this note" are of their own kind, a **trigger**, drawn in lime. A trigger goes only into the `trigger` input of a source — nothing of a behavior can get in, and it fits nothing else. A `trigger` input takes any number of edges, and @@ -51,8 +67,11 @@ voice 0. `velocity` is there for anything else as well, a filter that opens with a harder stroke. - A note is **one voice**, its layers side by side, each way reading its own file. It ends when all its ways have ended, or rings on first where it has an echo (see [Sounds](Sounds#delay-and-the-tail-of-a-voice)). -- **The end of a note** (the key let go, the duration of `Play note` over): every *Gate* Sample - fades out in 10 ms, *One-shot* ones play on. A looped one-shot plays until it is stopped. +- **The end of a note** (the key let go, the duration of `Play note` over): every *Gate* and *Loop* + Sample fades out in 10 ms, *One-shot* ones play on, and *Loop, then release* ones leave their + loop. A buffer source stops looping and plays on by itself. The pitch worklet is told to leave: + it lets the round finish that its newest frame has read into, so nothing already read changes + under the frames still sounding, and plays on from there. - **Pitch.** A Sample that follows the note is shifted by the phase vocoder of #317, so a note far from the root sounds rough, as there. A note at its root is the sound itself, played without the worklet. @@ -81,7 +100,9 @@ is, not what it says, so QWERTZ and QWERTY play alike: The header says which notes the keys play (*Keys C3 to E5*), and a line under the keys marks them while the keys have the focus. A held key does not repeat; letting it go, or the keys losing the -focus, ends the note. **Stop** ends everything the tab started. Every parameter of the +focus, ends the note. A key let go stays **half lit** while its note is still heard: a one-shot +playing out, a loop left, an echo. Striking it again plays a new note beside it, as a sampler does, +so a drum can be hit quickly. **Stop**, or `Esc` on the keys, ends everything the tab started. Every parameter of the instrument has a number field in the header, starting at its default: what the keys play with, heard at once on what is playing. Those values are the tab's own and never written into the asset.