Skip to content

Play a pitched instrument

Goal: A pitched kit on the SD card, so one recorded sample plays as sixteen notes across the pads.

You need: Start here done, an SD card in the board, one or more 16-bit PCM WAV recordings (mono or stereo, up to 24), and the crosspad-hil venv from 1. Set up the toolchain active (step 1 uses it; one-line installer: crosspad-hil already works).

Run every command from the project root (~/CrossPad, Windows C:\CrossPad\firmware). The commands talk to the board over USB, like the first flash: if the board asks USB serial mode?, press Allow.

  1. Try the test kit first

    This writes a two-zone sine test kit to the SD card over USB, which proves the card, the transfer and the pitched engine before you add your own recordings. Restart the board afterwards, so the check can find the kit.

    Terminal window
    python3 tools/make_pitched_kit.py --zones 2

    You should see: one Push: … and one Stored as … line per file, then:

    pushed /sdcard/crosspad/kits/HIL_PITCHED; reboot the board so the kit scan picks it up

    If not: OTA flash cannot find the board (the same USB search). If it says Device error: FS_ERR mkdir_… (any number but 17), the board cannot write to the SD card: file transfer says FS_ERR mkdir or FS_ERR open.

  2. Write your kit.json

    Set "engine": "pitched" and list up to 24 zones, each a WAV file and its root note (a MIDI number, or "auto" to let the board detect it). Name each file bare; the board looks beside kit.json and in SAMPLES/.

    {
    "name": "Piano",
    "engine": "pitched",
    "instrument": {
    "zones": [
    { "sample": "a3.wav", "root": "auto" },
    { "sample": "a4.wav", "root": 69 }
    ]
    }
    }

    Check that the file is valid JSON before you copy it:

    Terminal window
    python3 -m json.tool kit.json

    You should see: your kit printed back.

    If not: an error such as Expecting ',' delimiter: line … points at the typo; fix it and run the check again. See also pitched kit is missing from the kit list.

  3. Copy the kit to the SD card

    Give the kit its own folder in /sdcard/crosspad/kits (on a blank card, first create /sdcard/crosspad and then /sdcard/crosspad/kits with the same mkdir command). A remote path ending in / keeps the local file name.

    Terminal window
    python3 tools/fs_transfer.py mkdir /sdcard/crosspad/kits/PIANO
    python3 tools/fs_transfer.py mkdir /sdcard/crosspad/kits/PIANO/SAMPLES
    python3 tools/fs_transfer.py push kit.json /sdcard/crosspad/kits/PIANO/kit.json
    python3 tools/fs_transfer.py push a3.wav /sdcard/crosspad/kits/PIANO/SAMPLES/
    python3 tools/fs_transfer.py push a4.wav /sdcard/crosspad/kits/PIANO/SAMPLES/

    You should see: Created and the folder name from each mkdir, and for each push lines such as:

    Push: kit.json -> /sdcard/crosspad/kits/PIANO/kit.json (… bytes, crc …)
    …
    Stored as /sdcard/crosspad/kits/PIANO/kit.json (FS_OK …)

    If not: Device error: FS_ERR mkdir_17 only means the folder already exists; go on with the next command. Any other FS_ERR mkdir_…, or FS_ERR open_…, means the board cannot write to the SD card: file transfer says FS_ERR mkdir or FS_ERR open. If the board is not found: OTA flash cannot find the board.

  4. Restart the board and pick the kit

    The board reads the kit list once at boot, so restart it, then choose the kit in the Sampler’s kit browser. Tune zones, root, loop and envelope with Edit → Save.

    You should see: your kit’s name (“Piano”) in the kit browser. After you load it, each pad plays its own note.

    If not: pitched kit is missing from the kit list

List the kit’s folder on the card:

Terminal window
python3 tools/fs_transfer.py ls /sdcard/crosspad/kits/PIANO

You should see: a - line for kit.json and a d line for SAMPLES. Then, by ear: after you load the kit, each pad plays a different note, and the Sampler’s oscilloscope draws a different, steady wave per pad.