Skip to content

kit.toml

A kit.toml controls how a kit’s samples are mapped and played. Every section is optional — with no kit.toml, resonon auto-detects WAV files in the directory.

Every path a kit.toml names must be relative, must live under samples/, and must not climb out of the kit with ... Loading a kit that breaks this is an error that names every offending path.

FieldTypeDefaultDescription
nameStringDirectory nameDisplay name for the kit.
authorString—Kit author.
modeString"oneshot"Playback mode: "oneshot" or "melodic".
default_sampleStringSole sampleInitial sample for SamplerMelodic; required when ambiguous.

Oneshot plays each sample at a fixed pitch — standard for drums. Melodic repitches samples relative to each sample’s root note — use it for tonal instruments.

Map sample names to notes in one place instead of repeating note in every entry. Values are note names ("C2", "F#3") or MIDI numbers (36, 42):

[defaults]
bd = "C2"
sd = "D2"
hh = "F#2"

Each key defines a sample:

FieldTypeDefaultDescription
filesArray of strings—WAV paths under samples/ in the kit directory. Multiple files enable round-robin.
noteString or numberAuto-assignedMIDI note that triggers this sample ("C2" or 36).
rootString or number—Root pitch for melodic mode ("C4" or 60).
choke_groupNumber—Samples sharing a group cut each other off.
velocityNumber1.0Default velocity (0.0–1.0).
loop_startNumber—Loop start, normalized (0.0–1.0).
loop_endNumber—Loop end, normalized (0.0–1.0).

A drum kit with a choke group (the open and closed hats cut each other):

[kit]
name = "Lo-Fi Drums"
[samples]
bd = { files = ["samples/kick.wav"] }
sd = { files = ["samples/snare.wav"], note = "D2" }
hh = { files = ["samples/hihat_closed.wav"], note = "F#2", choke_group = 1 }
hh_open = { files = ["samples/hihat_open.wav"], note = "A#2", choke_group = 1 }

Multiple files per sample give automatic round-robin variation:

[samples]
sd = { files = ["samples/snare_1.wav", "samples/snare_2.wav", "samples/snare_3.wav"], note = "D2" }

A melodic kit repitches relative to each root; use loop points for sustaining sounds:

[kit]
name = "Tape Piano"
mode = "melodic"
default_sample = "piano"
[samples]
piano = { files = ["samples/piano_c4.wav"], root = "C4" }
pad = { files = ["samples/pad_c3.wav"], root = "C3", loop_start = 0.1, loop_end = 0.95 }

SamplerMelodic(Kit("Tape Piano")) loads piano immediately. A melodic kit with exactly one sample may omit default_sample; a kit with several samples must declare it. Each selectable melodic sample names exactly one file—multiple files are round-robin material for the drum sampler. The selected file and its root must be valid when the device is constructed, so broken presets fail with an error instead of producing a silent instrument.

When a sample has no explicit note, resonon resolves it in order:

  1. Explicit note in the [samples] entry.
  2. A [defaults] mapping.
  3. The GM drum mapping below (by sample name).
  4. Sequential assignment from C2 (MIDI 36).
NameAliasesNote
bdkick, bassC2 (36)
sdsnareD2 (38)
rsrim, rimshotC#2 (37)
hhhihat, hat, chF#2 (42)
hh_openhihat_open, ohA#2 (46)
cpclapD#2 (39)
lttom, tom_lowA2 (45)
mttom_midB2 (47)
httom_high, tom_hiD3 (50)
crashcyC#3 (49)
ride—D#3 (51)
cbcowbellG#3 (56)
mamaracasA#4 (70)
clclaveD#5 (75)
lcconga_lowE4 (64)
mcconga_midD#4 (63)
hcconga_highD4 (62)

With no kit.toml, each .wav becomes a sample named after its filename, notes come from the table above (or sequentially from C2), and the mode defaults to oneshot — so a minimal kit is just a folder of WAV files.