Skip to main content

Instruments

Instruments are named voice definitions. You assign them to channels and reference them from patterns and sequences. Field names and legal type= values depend on the active chip.

In BeatBax Desktop, you can also edit instruments graphically with the Instrument Editor (Experimental). With Live edit on (default), valid field changes rewrite the same inst lines described here; turn it off to audition a panel draft, then Apply to the editor or Revert to discard panel edits.

Syntax​

inst <name> type=<type> [<field>=<value> ...]
ConceptNotes
nameIdentifier used in channel … => inst <name> and as a pattern token when note= is set
type=Chip-specific voice (e.g. Game Boy pulse1, NES triangle, SMS tone1)
FieldsChip-specific parameters (duty, env, wave=, macros, …)
channel 1 => inst lead seq melody

Shared ideas (all chips)​

FeatureWhere documented
Software macros (vol_env, pitch_env, arp_env, duty_env, …)Instrument macros
Default pitch / named drum tokens (note=, Game Boy uge_note=)Instrument note mapping
Reusable .ins librariesImports

Chip pages list which types accept which fields.

Chip-specific settings​

Instrument type= and hardware fields live in Sound Chip Plugins:

ChipGuide
Game BoyGame Boy
NESNES
SMS / Game GearSMS
Spectrum 128 / CPCSpectrum 128

Minimal example​

Two instruments

Interactive playback loads in the browser.

…
inst lead type=pulse1 duty=50 env=gb:13,down,1 # pulse 1 — melody
inst bass type=pulse2 duty=25 env=gb:10,down,1 # pulse 2 — bass
pat lead_p = E5 . G5 C6 . G5 E5 .
pat bass_p = C3:4 G2:4
…

Importing instrument libraries​

Pull shared definitions from a .ins file so songs stay short:

import "local:lib/drums.ins" # CLI / desktop
import "github:user/repo/main/melodic.ins" # CLI, desktop, browser
import "https://example.com/kit.ins" # CLI, desktop, browser

Merging is last-wins: a local inst with the same name overrides an imported one. Full syntax, platforms, and security rules: Imports.

The playable kit below is the result of a shared drum library (instruments inlined so the demo runs in the docs player):

Shared drum kit (inline)

Interactive playback loads in the browser.

…
# Shared kit (same idea as importing a .ins file)
inst kick type=noise gb:width=7 uge_note=C-6 length=16 pitch_env=[0,-2,-4,-6] vol_env=[15,12,8,4]
inst snare type=noise gb:width=7 env=gb:13,down,1 length=16 uge_note=C-7 note=C6 pitch_env=[0,7,0] vol_env=[13,10,6,2]
inst hat type=noise gb:width=15 env=gb:5,down,1 uge_note=C-8 note=C6
pat drums = kick . hat . snare . hat hat # instrument names as tokens
…

See also​