A programmable cross-platform sequencer for the Game Boy Advance sound chip.
# 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
- 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
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.
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.
## 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?l=WebAssembly&q=%23chiptrack
An external MIDI keyboard can be used to play or record notes.
Function | Desktop | Game Boy Advance |
---|---|---|
Move cursor | ←|↑|→|↓ | ←|↑|→|↓ |
Switch panel (Patterns, Steps, Instruments) | Shift + (←|→) | (L|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 |
Play pattern | Ctrl + Enter | Select + Start |
Reset sound channels | Esc | Select |
Save | Ctrl + S | N/A |
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 |
Function | Desktop | Game Boy Advance |
---|---|---|
Cycle pattern | X + (←|→) | A + (←|→) |
Duplicate pattern | Shift + (Z, X) | (L|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 |
Function | Desktop | Game Boy Advance |
---|---|---|
Cycle note/param | X + (←|→) | A + (←|→) |
Cycle note/param (large amount) | X + (↓|↑) | A + (↓|↑) |
Enter selection mode | Shift + Z | (L|R) + B |
Select all rows (in selection) | Shift + Z | (L|R) + B |
Copy (in selection) | Z | B |
Cut (in or not in selection) | Z + X | B + A |
Cancel selection | Shift | L|R |
Paste selection clipboard | Shift + X | (L|R) + A |
Paste edit clipboard (on empty slot) | X | A |
Notes:
- B + A means that B must be held first*
- The selection clipboard is set when copy/cutting in selection mode
- The edit clipboard is set after a note/param cycle (also if unchanged)
- Cutting when not in selection mode sets both the selection and edit clipboards
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