← All modules

@maru shared this instrument so you can build on it and use it in your DAW.

AvailableInstrument

Sampler Reference

Play a sample library the way its author mapped it.

About

A multisample instrument that plays two bundled sample libraries the way their authors mapped them: key zones, velocity layers, round robins and choke groups, from one keyboard. It is the reference implementation the main Sampler is measured against, so it is useful both to play and to compare.

What is inside

  • Aurora Keys: a keys instrument with ten samples in two velocity layers, soft and bright, across MIDI notes 21 to 108. Every sample is synthesized from equations, so the whole instrument is original and redistributable.
  • Pocket Kit: a small drum kit played as an instrument, with one sample per key, alternating snare and hat hits so repeats do not sound mechanical, and an open hat that the closed hat cuts off.

Controls

  • Instrument switches between Aurora Keys and Pocket Kit.
  • Attack adds a fade-in on top of each sample's own start.
  • Release sets how long a note takes to fade after you let go.
  • Level sets the output.

The keyboard shows two octaves, or seven on a wider panel, with octave buttons to reach every mapped note. Zone map shows which keys each part of the instrument covers.

Getting started

Play Aurora Keys from a keyboard or MIDI, softly and then hard, to hear the two velocity layers. Switch to Pocket Kit and repeat a snare or hat key to hear the round robin.

How it works.

The .dspreset is parsed by a self-contained XML reader rather than DOMParser, so the same import runs in the browser and under `node --test` with no DOM. The parse is pure: text in, regions out. It never throws on instrument text, and anything it does not speak is counted in `ignored` with malformed values collected in `warnings`, so a lossy import is visible rather than silent.

Each authored `<group>` becomes its own sampler program, and the programs stack. This is the one deliberate divergence from a naive merge: Decent Sampler plays every matching sample simultaneously, while a program resolves one region per velocity cell, so merging the bundled instrument's soft and bright groups would rotate between them instead of letting velocity choose. The importer flags the ambiguous case, and building per group avoids it entirely.

Region payloads are generic, which is what makes the loader boring. The importer produces regions whose payload is a path reference; the playback layer maps that payload to a decoded AudioBuffer and keeps every other field (key range, velocity layer, tuning, gain, loop points) exactly as imported. Nothing re-derives the map from the audio.

Selection runs on key first, then velocity, then round robin. A region whose explicit key range contains the note wins outright; regions without one compete by nearest root and are repitched, bounded by a maximum stretch. If every region is velocity-ranged and none contains the strike, the note is silent by policy. Legible silence beats the wrong sound, the same rule the zone map uses for out-of-reach keys.

The keybed is drawn from the same parse the audio comes from. Colour washes are the instrument's `<keyboard>` ranges converted from hex ARGB, and the muted keys are the program's own playable range, so a key that looks unmapped is unmapped. Feeding the UI from the program rather than from a second hand-written table is what keeps the two from disagreeing.

The published package carries both Aurora Keys and Pocket Kit as content-addressed instrument documents plus all 17 immutable audio assets. A generic host selects the document from the instrument parameter, verifies and decodes only its declared assets, then prepares either the instant TypeScript preview or the optimized sampler bank; switching instruments tears down the old bank before installing the new one.

What would you make with Sampler Reference?

Describe what you want to make. Build it with the Studio agent.

Goes well with.

Prototype

A recording split into a playable grain cloud.

Prototype

A sixteen-pad drum machine whose whole kit morphs across three faces at once.

Prototype

Two oscillator banks with continuous frame morphing.

Prototype

A physical string model, rendered per note.

A free instrument for playing layered sample libraries.