A modern web-based chiptune tracker designed for creating music on retro sound chips. Currently supports the AY-3-8910 / YM2149F chip (used in ZX Spectrum and other 8-bit computers), with plans to support additional chips in the future.
- Canvas-based pattern editor with order list
- Field-based editing with selection, copy/cut/paste, and magic paste
- Virtual channels — map multiple pattern columns onto a single hardware channel
- Transpose, increment/decrement, and channel swap editing tools
- Auto envelope and envelope-as-note modes
- Customizable keybindings
- AY/YM instrument editor with tone, noise, envelope, and sample playback
- Timer effects (waveform, PWM, and related AY timer instruments)
- Tables (known as Ornaments in Vortex Tracker 2)
- Built-in instrument presets
- Instrument preview playground
- Play, pause, play from cursor, play pattern, and solo/mute controls
- Real-time channel oscilloscopes
- MIDI keyboard input for note entry
- Open and save Bitphase projects (
.btp) - Import Pro Tracker 3 (
.pt3) and Vortex Tracker 2 (.vt2) modules - Export WAV, PSG, TMR, and SNDH (not supporting timer effects yet)
- Multi-chip PSG and TMR export as ZIP
- Command-line
.btpto WAV export (pnpm btp-to-wav)
- Undo/redo with labeled history
- Lua user scripts for batch edits on selections
- Automatic project backup with recovery on reload
- Custom themes and appearance settings
- Node.js (v18 or higher; v20 recommended)
- pnpm (v10.11.0 or higher)
- Emscripten SDK — required for building the Ayumi WebAssembly module
- Git submodules — the Ayumi emulator lives in
external/ayumi
- Download and install Emscripten from emscripten.org
- Set the
EMSDKenvironment variable to point to your Emscripten installation - Ensure
emccis available in your PATH
-
Clone the repository
git clone --recurse-submodules https://github.com/paator/bitphase.git cd bitphaseIf you already cloned without submodules:
git submodule update --init --recursive
-
Install dependencies
pnpm install
-
Build WebAssembly modules
pnpm build:wasm
This compiles the Ayumi chip emulator to
public/ayumi.wasm. Run this once after cloning, or whenever the WASM source changes. -
Start the development server
pnpm dev
-
Open your browser
Navigate to
http://localhost:5173(or the port shown in the terminal)
pnpm dev— build WASM and start the development server with hot module replacementpnpm build— build WASM and create a production buildpnpm build:wasm— build only the WebAssembly modulespnpm preview— preview the production build locallypnpm check— run TypeScript and Svelte type checkingpnpm test— run tests in watch modepnpm test:run— run tests oncepnpm btp-to-wav— export a.btpproject to WAV from the command line
bitphase/
├── cli/ # Command-line tools (btp-to-wav, BTP loading)
├── docs/ # Format documentation (e.g. TMR spec)
├── external/
│ └── ayumi/ # AY-8910 emulator C source (git submodule)
├── public/ # Static assets and runtime audio code
│ ├── ayumi.wasm # Compiled chip emulator
│ ├── bitphase-audio-processor.js
│ ├── tracker-*.js # AudioWorklet tracker pipeline
│ ├── ay-*.js # AY chip audio runtime
│ ├── fonts/
│ └── worklet/
├── src/
│ ├── app.css # Global styles
│ ├── main.ts # App entry point
│ ├── App.svelte # Root component
│ ├── demo/ # Bundled demo songs (.btp)
│ ├── presets/ # Built-in instrument preset JSON files
│ └── lib/
│ ├── chips/ # Chip implementations and registry
│ │ ├── ay/ # AY-8910 (schema, adapter, renderer, processor)
│ │ └── base/ # Shared chip interfaces
│ ├── components/ # Svelte UI components
│ │ ├── AppLayout/
│ │ ├── Menu/
│ │ ├── Song/ # Pattern editor and song view
│ │ ├── Instruments/
│ │ ├── Modal/
│ │ ├── Settings/
│ │ ├── Tables/
│ │ ├── Theme/
│ │ ├── History/
│ │ ├── Details/
│ │ ├── Audio/
│ │ └── ... # Shared UI primitives (Button, Input, etc.)
│ ├── config/ # Menu, keybindings, settings, themes, export formats
│ ├── models/ # Domain models (project, song, history, virtual channels)
│ │ ├── pt3/ # PT3 tuning tables
│ │ └── song/ # Song model utilities
│ ├── presets/ # Preset loading utilities
│ ├── services/ # Business logic
│ │ ├── app/ # Menu actions and app context
│ │ ├── audio/ # Playback and AudioWorklet bridge
│ │ ├── backup/ # Autobackup
│ │ ├── file/ # Import/export (BTP, PT3, VT2, WAV, PSG, TMR, SNDH)
│ │ ├── history/ # Undo/redo diff tracking
│ │ ├── midi/ # MIDI input
│ │ ├── modal/
│ │ ├── pattern/ # Pattern editing, navigation, clipboard
│ │ │ └── editing/ # Field-based editing strategies
│ │ ├── project/ # Project management and migration
│ │ ├── theme/
│ │ └── user-scripts/ # Lua user scripts
│ ├── stores/ # Reactive state (Svelte 5 runes, .svelte.ts)
│ ├── types/
│ ├── ui-rendering/ # Canvas-based pattern editor and order list
│ └── utils/
└── tests/ # Tests mirroring src/ structure
├── fixtures/
├── lib/
├── public/ # Tests for public/ runtime scripts
└── psg/
- TMR format spec — Bitphase timer companion format for PSG export. In development!
