https://github.com/gaiger/chiptunemidi
A lightweight C99 chiptune engine with a Qt-based application for MIDI playback, timbre editing, and WAV export.
https://github.com/gaiger/chiptunemidi
c chiptune cpp midi qt
Last synced: about 1 month ago
JSON representation
A lightweight C99 chiptune engine with a Qt-based application for MIDI playback, timbre editing, and WAV export.
- Host: GitHub
- URL: https://github.com/gaiger/chiptunemidi
- Owner: Gaiger
- Created: 2025-08-19T14:53:45.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2025-08-27T04:34:29.000Z (about 2 months ago)
- Last Synced: 2025-08-27T04:43:11.777Z (about 2 months ago)
- Topics: c, chiptune, cpp, midi, qt
- Language: C
- Homepage:
- Size: 838 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ChiptuneMIDI
## Description
ChiptuneMIDI interprets MIDI files as retro chiptune (8-bit–style) sound.
It is built around a portable C99 chiptune engine,
with a Qt application as a reference front-end that showcases real-time playback, instrument controls, and audio export.
## Demo
- [梁靜茹 如果有一天 — ChiptuneMIDI cover](https://www.youtube.com/watch?v=3lz47rfHsxA)
*(Generated with ChiptuneMIDI engine — [original song](https://www.youtube.com/watch?v=K3o6SfwZq_w) by 梁靜茹)*## Features
### Engine (Core Library)
- Pure C99, no external dependencies
- Stereo/mono output at configurable sampling rates
- Retro waveforms (square with multiple duty cycles, triangle, saw, noise)
- Customizable ADSR envelopes with various curve types
- Supports common MIDI effects (e.g., vibrato, reverb, chords)
- Tempo control, pitch shift, and playback speed adjustable
- Exports audio samples (8-bit/16-bit) for any backend### Application (Qt GUI)
- Play MIDI files directly with retro 8-bit sound
- Visual note sequencer (score-like interface)
- Export audio output as `.wav`
- Core engine features (waveforms, ADSR, etc.) are configurable via the GUI.## Requirements / Dependencies
- C++11 compiler
- Qt 5.x (Core, Widgets, Charts, Multimedia; on Windows: WinExtras)
- Qt 6.x (Core, Widgets, Charts, Multimedia)
- CMake ≥ 3.20 (recommended), or QtCreator with qmake## Installation
You can build ChiptuneMIDI in two ways:
### Option A: CMake (Qt5 or Qt6)
1. Open `qt/CMakeLists.txt` with QtCreator or run CMake manually
2. Select a Qt kit (Qt5 or Qt6)
3. Build and run### Option B: qmake (Qt5 only)
1. Open `qt/qt5_qmake_project/ChiptuneMIDI.pro` in QtCreator
2. Build and run## Usage
- Start the application after building.
- Open a `.mid` file either by:
- Dragging the file into the window, or
- Clicking the **Open MIDI File** button and selecting from the file explorer.
- Playback starts automatically.
- To export audio, click the **Save as .wav File** button.**Note:** A sample MIDI file (`qt/暗黒舞踏会8bit ver..mid`) is included for quick testing.
## Project Structure
```
ChiptuneMIDI/
├─ (root) # Core engine (C99, no dependencies)
├─ qt/ # Qt GUI application
│ ├─ qt5_qmake_project/ # qmake project (Qt5 only)
│ ├─ QMidi/ # External MIDI library (imported, read-only)
│ └─ icons/ # Application icons
```## Configuration
No special configuration is required.
Open the project in QtCreator and build with either Qt5 or Qt6 — both are supported.## Roadmap
- [ ] Port the engine to microcontrollers to run as a standalone chiptune player.
- [ ] Open to future extensions and contributions (e.g., new front-ends, extra MIDI features)## Contributing
Contributions are welcome!
Please fork the repository and submit pull requests.
For major changes, open an issue first to discuss what you would like to add or modify.Make sure your code passes existing builds/tests and follows the coding style:
- Functions use `camelCase`
- Variables use `snake_case`
- Avoid abbreviations## License
This project is licensed under the MIT License — see the [LICENSE](https://rem.mit-license.org/) file for details.
## Acknowledgements
- Uses [QMidi](https://github.com/waddlesplash/QMidi) library for MIDI file parsing
- Inspired by Dragon Guardian's [*暗黒舞踏会 8bit ver.*](https://www.youtube.com/watch?v=RFkPC6qlFmo) — thanks to composer [勇者アーサー](https://x.com/dragonguardiana)