Audio engine: 44.1 kHz
Everything the CrossPad plays runs on one audio engine with one clock: the pads, pitched kits, songs, the metronome, the inputs and USB audio. The engine renders 16-bit stereo at 44.1 kHz, in short blocks, one after another.
The numbers
Section titled “The numbers”| Sample rate | 44100 Hz. Settings → Audio → Engine → Sample Rate also offers 48000 Hz; a change applies after a restart. |
| Block | 64 frames: 1.45 ms at 44.1 kHz. |
| Format | 16-bit stereo. |
| USB audio | The same rate as the engine, in both directions. |
| Recordings | 16-bit stereo WAV at the engine’s rate. |
The kits that come with the CrossPad are 16-bit WAV files at 44.1 kHz. That is the format to use for your own samples too: a file at the engine’s rate plays as it is.
Samples at other rates
Section titled “Samples at other rates”- Sampler kits. A WAV recorded at another rate (48 kHz, 22.05 kHz) plays at its own speed and pitch: the engine steps through it at the ratio of the two rates.
- Pitched kits. A zone at another rate is converted once, when the kit loads. See Pitched kits.
- Format. Samples are 16-bit PCM WAV, mono or stereo.
Timing rules for code on the audio thread
Section titled “Timing rules for code on the audio thread”The engine has 1.45 ms to render each block. The metronome and the sequencer count the beat in frames rendered, so
every block has to be on time. Code that runs inside a render (an audio node’s mix()):
- allocates no memory;
- takes no lock and waits for nothing;
- opens no file and touches no SD card;
- writes no log.
Do that work on another task and hand the result over, for example through a lock-free ring. The sampler engine works this way: see Sampler engine.