5.1 KiB
SFZ support
Zampler can import SFZ instruments into a sampler. This page says what an imported sampler plays, and what it doesn't.
What an imported sampler plays
An imported sampler plays what the SFZ says about its samples, on top of their keys, velocities, round robins and choke groups:
- Envelopes shape how a sample fades in and out. A sample with an envelope fades out when its note ends, over the SFZ's release time, so a long note holds it and a short one lets it go. The same goes for a key you play live. A sample with
loop_mode=one_shot, and one with no envelope, plays to its end whatever the note's length. - Loops repeat part of a sample for as long as the note lasts, as in a sustained pad or organ. A sample with no
loop_modeloops if its file holds loop points. Aloop_sustainloop plays as a continuous one. - Release samples play when a note ends, such as the noise of a piano key coming up. They play for as long as the SFZ says, and are quieter the longer the note was held, if the SFZ asks for that.
- First and legato samples play depending on whether another note is sounding: the first note of a phrase, or a note played over another, as in a legato line.
- Root notes from the sample files. An SFZ that says
pitch_keycenter=sampletakes each sample's root note from the sample file, as WAV and AIFF files can hold one. The sample is tuned down by any cents its file says its pitch is above that note, which can differ from other players. A sample whose file has none, or that isn't found, gets note 0, as the SFZ format says. Zampler reads the note when it scans a disk, so click Rescan on a disk in Disks after updating Zampler to bring in the notes of files it had already indexed. - Controls that an instrument names, such as a drum kit's microphone mixes and its hi-hat openness, decide which samples play and how loud they are, while you play. Each has a knob in the panel above the samples in the sampler's view, and your keyboard's own knobs, wheel and pedal move them too. The samples that don't play at the moment are dimmed in the list and on the grid. A control follows the project: it opens where you left it.
- Key switches are keys, usually below the playing range, that choose how the instrument plays, such as a violin's bowing. Press one on a keyboard or in that panel, or play it as a note in your code.
- Pitch bend, aftertouch and the sustain pedal. Pitch bend moves the notes that are playing, by the range the instrument gives each sample. On the screen it stays where you leave it, double-clicking puts it back in the middle, and a device's wheel takes over when it moves. The pedal holds the notes you play with a keyboard while it is down, but not notes from your code, which have their own lengths. Samples may also play only on some MIDI channels.
- Voice limits stop the oldest sounds when too many play at once. An SFZ's
polyphonylimits the sounds of a choke group,note_polyphonythose of one key, andoff_modeandoff_timesay how a stopped sound fades: quickly, over a set time, or over its release. - Velocity curves and crossfades set how loud a sample plays at each velocity, and blend neighbouring samples across a range of keys or velocities.
Your code is in charge: attack, decay, sustain, release, clip and loop in a pattern replace the SFZ's own.
Supported read-only SFZ features
Some of what a sampler plays has no controls yet. An import sets these on each sample and the engine plays them, but you can't see or change them in Zampler, and you can't set them on a sampler you build by hand:
- Envelopes, loops and their points, velocity curves and crossfades.
- Release, first and legato samples. The Note switch only moves a sample between playing when a note starts and when it ends.
- What a control does to a sample's volume, pan and tuning, which samples a control or key switch lets play, and adding or removing controls.
- A sample's own voice limits, and how a stopped sound fades.
- Stereo width and the range of pitch bend.
Controls for these will be explored in the future (#176 covers showing and editing imported settings, and #178 collects further ideas, such as instrument controls, envelopes and loop markers).
What isn't supported
Zampler plays what an SFZ says about its samples, not every sound design feature. These aren't supported, and mostly aren't planned, because Strudel and Zampler's own effects cover them:
- Filters, and pitch and filter envelopes.
- LFOs and the SFZ v2 modulation system.
- Generated sounds, and samples embedded in the SFZ.
<effect>headers.- Tempo and timer conditions.
A few features are played only in part: a region that a controller starts (on_loccN) is left out, a held note follows only pitch bend while it plays, and polyphony limits a choke group. A sampler can't be exported as an SFZ. What an import skips, and which regions it leaves out, is listed with the import.
Next: Effects