# Sampler

Sampler window

MultitrackStudio includes a disk-streaming sampler. Samples can be played directly from disk, allowing patches to be larger than the available memory.

You can load a sample library using the Library box.
The Import... option allows you to import .sf2, .sfz, .gig, or .exs files, as well as MultitrackStudio's .zptc and .ptc files.
The Export... option exports the library to .zptc format. You can use this to move a library to another computer, for example.

The Patch box lets you select one of the patches provided by the library.
Edit patch... opens the Patch Editor.

The controls in the Controls section override the values stored in the patch (as set by the Patch Editor).

Tip: Simple patches containing just one sample can be created easily by dragging an audio file from Finder to a MIDI track's Instrument Slot. You can also drag a selected part from a track editor or clips from the Clip Shelf to an Instrument Slot. A Sampler will be loaded into the Instrument Slot, and a patch will be created for it. To use the patch in other songs, you need to export the library and import it again.

The Sampler responds to messages on all MIDI channels, so the Channel value usually doesn't matter. It does matter if you're recording using the MIDI Keyboard Mapper's split option or using multiple keyboards. In those cases, you want only messages received on this channel to be recognized.

If the track has multiple MIDI streams, the Sampler uses only the first stream.

The Output button, available if the patch uses multiple outputs, opens an 8-channel output mixer. This is typically used for drums. In the Pro edition, these output channels are available as sidechain sources in other tracks.

The ☰ menu offers some settings:

- Polyphony: The number of samples a Sampler is allowed to play simultaneously. You can reduce this setting to lower CPU or disk bandwidth usage.
- Memory Limit: The amount of memory that all Samplers combined are allowed to use. The operating system will resort to disk swapping if memory usage is too high, which can significantly reduce performance and should be avoided. This setting is intended to limit the Sampler's memory usage to make room for other audio programs (e.g., sampler-based instrument plugins). If available memory is too low, dropouts may occur when using a Sampler in record mode. You don't need to worry about this, playback will sound fine.

Note: The Sampler does not support all features of .sf2, .sfz, .gig, or .exs files. Differences include:

- The Sampler cannot play multiple samples for a single key press. For example, a "piano + strings" soundfont that plays both piano and string samples simultaneously will not sound as intended. In the worst case, some keys will play piano, others strings. You can delete extra samples using the Patch Editor.
- There are no filters, modulation, or effects. You could use MultitrackStudio effects to enhance a patch's sound.

### MIDI Implementation

The Sampler supports the following MIDI messages:

- Note On/Off
- Modulation (#1)
- Volume (#7)
- Pan (#10)
- Expression (#11)
- Sustain (#64)
- Legato (#68)
- Brightness (#74)
- Pitch Bend
- Poly Aftertouch
- MIDI 2.0 per-note pitch bend
- MIDI 2.0 per-note modulation
- MIDI 2.0 per-note volume
- MIDI 2.0 per-note pan
- MIDI 2.0 per-note expression

Tip: To use per-note modulation with an MPE keyboard, use the MIDI Keyboard Mapper. Set it up to map per-note aftertouch or per-note brightness to per-note modulation.

Under the hood
Imported sample libraries are converted to MultitrackStudio .ptc format patches. Each library gets its own folder, typically named after the original file (e.g., "MyPiano.sf2"). You can change the location of these folders in the Studio → Preferences window. The audio samples are stored as losslessly compressed .gjm/.gjs files, so converted libraries usually take up significantly less disk space than the originals. Libraries can be exported to .zptc format, which is a .zip file containing the .ptc file(s) and the associated samples.