Legato Scripting
Overlapping notes only trigger the script; it still has to choose a transition, trim its level and pay back the delay.
Related
Stack two notes and most samplers simply play both. A legato script is what turns the overlap into one moving line.
Where the line breaks
Play a fifth and let the second note sit on the tail of the first. Without a script the two attacks pile up and the join sounds thick. With one, the second attack is replaced by a transition sample and the phrase reads as a single bow stroke. Find the break first: bow change, string crossing, shift, tonguing or slide. Each has its own transition.
What the script waits for
The script watches note-on and note-off and keeps a list of held notes. A new note while an old one is still down triggers a transition; the release decides whether to fade or hand over to a release sample. Monophonic legato steals the voice, polyphonic legato finds a transition for every pair. Interval matters: a minor second and a major third rarely use the same sample. The overlap threshold is adjustable; too short and it misses, too long and both attacks remain.
| Parameter | Common practice | What goes wrong |
|---|---|---|
| Overlap threshold | A few to a few dozen milliseconds | Too short misses; too long leaves two attacks |
| Transition choice | Samples grouped by interval | A leap uses a step sample and turns muddy |
| Transition level | Trimmed close to the main note | Too loud adds a note; too quiet breaks the line |
| Release handling | Fade or a release sample | The tail is cut and the phrase sounds clipped |
| Delay compensation | Negative DAW delay or player pre-read | Playing feels loose and fast lines drag |
Strings and winds are not one job
A string legato is a bow change or a string crossing, and the transition carries bow noise. A wind legato is breath and key work, closer to a pitch connection than a new attack. Put a string script on a flute and the line turns sticky. Brass needs the breath before the note, and a long transition sands off its edge. Ask what the instrument actually does between two pitches.
When not to script it
On fast repeated notes the script treats every repeat as a transition and smears them; round robin should take over. Leaps beyond an octave often fall outside the recorded intervals, and a small gap beats a forced transition. Delay is the other cost: waiting for a transition can push playback a few milliseconds late, and that latency reaches the fingers in a live take. A script repairs the join, not the phrasing.
Listen in the library
All tracks from midicn-lib — inline badge is the license tier (C1 commercial / C2 non-commercial / C3 study only).
Along the same line
Sources
- Native Instruments Kontakt 手册,KSP 脚本与连奏乐器的相关章节(官方文档)。
- Curtis Roads, The Computer Music Tutorial, MIT Press,采样回放与包络处理。
- 弦乐换弓与管乐吐音的演奏惯例,对照配器教材整理。