chiptrack icon indicating copy to clipboard operation
chiptrack copied to clipboard

A programmable cross-platform sequencer for the Game Boy Advance sound chip

Chiptrack

A programmable cross-platform sequencer for the Game Boy Advance sound chip.

image

Try the Web Player

Install using Cargo

# On Linux you might need WAMR and CPAL local dependencies, for example on Ubuntu:
# sudo apt install build-essential cmake pkg-config libasound2-dev libxft-dev

cargo install --git https://github.com/jturcotte/chiptrack

Features

  • Runs natively on the Game Boy Advance
  • Instruments are programmable
  • Songs can be distributed and played from GitHub gists
  • Basic MIDI support in the desktop version

Runs natively on the Game Boy Advance

image

The built-in sound chip is used for sound production in this case. The desktop and Web versions will produce the sound in software by emulating sound register commands.

Slint models are used as cross-platform abstraction, read from a custom renderer to take advantage of the GBA's hardware acceleration.

Instruments are programmable

pub fn press(freq: u32, note: u8, param0: i8, param1: i8) callconv(.C) void {
    _ = note; _ = param0; _ = param1;
    gba.EnvDutyLen
        .withDuty(gba.dut_1_8)
        .withEnvStart(10)
        .writeTo(gba.square1);
    gba.CtrlFreq.init()
        .withTrigger(1)
        .withSquareFreq(freq)
        .writeTo(gba.square1);
}

Each song carries a little WebAssembly program that converts sequenced notes to Game Boy Advance sound commands. This gives almost complete control over the sound chip to each song.

Default instruments are provided for empty projects and can be customized.

Songs can be distributed and played from GitHub gists

## Pattern 16

| S1 | T2 | W2 | N1 | N2 | N3 |
|----|----|----|----|----|----|
|A-4 |A-2 |B-3 | -  |C-2.| -  |
| -  | -  | -  | -  | -  | -  |
|A-4 | -  |C#4 |C-2.| -  | -  |
| -  | -  | -  | -  | -  | -  |
|A-4 |A-2 |E-4 |C-2.| -  | -  |
...

Songs are saved as Markdown and are human-readable and can be discovered by searching by using GitHub's search: https://gist.github.com/search?q=%23chiptrack

Basic MIDI support in the desktop version

An external MIDI keyboard can be used to play or record notes.

Key / Button Mapping

Function Desktop Game Boy Advance
Move cursor ||| |||
Switch panel (Patterns, Steps, Instruments) Shift + (|) R + (|)
Select previous/next song pattern B + (/) B + (/)
Select previous/next pattern non-empty instruments Z + (/) B + (/)
Cycle the selected pattern/note/param value X + (|) A + (|)
Copy X A
Cut Z + X B + A
Paste (on empty slot) X A
Play song Enter Start
Reset sound channels Esc Select
Save Ctrl + S L + Start
Export song to GBA save file Ctrl + G N/A
Toggle recording mode . N/A
Black notes W|E|T|YU N/A
White notes A|S|D|F|G|H|J|K N/A
Erase step (or hold during playback) Backspace N/A

Song Patterns Panel

Function Desktop Game Boy Advance
Cycle pattern X + (|) A + (|)
Duplicate pattern Shift + (Z, X) R + (B, A)
Copy X A
Cut (only on the last non-empty slot ) Z + X B + A
Paste (only on the placeholder slot) X A
Insert an empty pattern instead of pasting X, X A, A

Pattern Steps Panel

Function Desktop Game Boy Advance
Cycle note/param X + (|) A + (|)
Cycle note/param (large amount) X + (|) A + (|)
Copy X A
Cut Z + X B + A
Paste (on empty slot) X A

Notes: B + A means that B must be held first*

Based on the awesome work of

License

The source code is available under the terms of the MIT license (See LICENSE-MIT for details).

However, because of the use of GPL dependencies, Chiptrack compiled binaries are licensed under the terms of the GPLv3 (See LICENSE-GPL).

"Game Boy Advance" is registered trademark of Nintendo