A C++ tool that renders MIDI files to audio using VST plugins.
Midiverse allows you to convert MIDI files to audio by processing them through VST plugins (or using a fallback sine wave generator). It provides both a command-line interface and Python wrapper for easy integration.
Quick start with Docker:
# Set up the environment
./docker_setup.sh
# Build the Docker image
docker compose build
# Run Midiverse (generates a test MIDI file and processes it)
docker compose run --rm midiverse python3 /app/input/generate_test_midi.py
docker compose run --rm midiverse /app/input/test_scale.mid /app/input/dummy.vst -o /app/output/result.wav- Process MIDI files through VST plugins
- Customize sample rate, bit depth, and channel count
- JUCE integration for VST3, VST2, AU support (optional)
- Fallback mode with simple sine wave generation
- Simple command-line interface
- C++17 compatible compiler
- CMake 3.10 or higher
- JUCE (for VST support, included with install script, optional)
Run the included installation script to download dependencies:
./install_deps.shmkdir -p build
cd build
cmake -DUSE_JUCE=ON ..
makeIf you just want to test with the fallback sine wave generator:
mkdir -p build
cd build
cmake ..
makeMidiverse can run in a Docker container, making it easy to use across different platforms without worrying about dependencies.
-
Build the Docker image:
docker compose build
-
Create input/output directories:
mkdir -p input output
-
Generate a test MIDI file:
# Copy the test file generator to input directory cp examples/generate_test_midi.py input/ # Run it in the container docker compose run --rm midiverse python3 /app/input/generate_test_midi.py # Create a dummy VST file for testing touch input/dummy.vst
-
Process a MIDI file:
docker compose run --rm midiverse /app/input/test_scale.mid /app/input/dummy.vst -o /app/output/result.wav
The rendered audio file will be available in your local output directory.
Use the CLI tool directly:
./build/midiverse_cli <midi_file> <vst_plugin> [options]Options:
-o, --output <file> Output file path (default: output.wav)
-r, --rate <rate> Sample rate in Hz (default: 44100)
-c, --channels <num> Number of channels (default: 2)
-b, --bit-depth <depth> Bit depth (default: 16)
-h, --help Show this help message
A Python wrapper is provided for easier use:
./midiverse.py <midi_file> <vst_plugin> [options]Options are the same as the CLI tool.
# Generate test MIDI files
python examples/generate_test_midi.py
# Process with dummy VST (generates sine wave)
./midiverse.py test_scale.mid ./dummy_vst.vst -o rendered_scale.wavBy default, Midiverse runs in a fallback mode that generates sine wave audio instead of using actual VST plugins. This is useful for testing or when you don't have VST plugins available.
When built with JUCE support (-DUSE_JUCE=ON), Midiverse can load and render audio through real VST plugins:
- VST3 plugins (.vst3)
- VST2 plugins (.dll, .vst, .so)
- Audio Units (.component) on macOS
To enable VST3 support, you must build with the JUCE option:
mkdir -p build && cd build && cmake -DUSE_JUCE=ON .. && makeThe JUCE integration provides:
- Plugin loading and format detection
- MIDI file parsing and event processing
- Accurate timing and audio processing
- Audio rendering at the specified sample rate and channel count
- VST3 plugins are recommended for best compatibility
- Plugin paths must be absolute paths
- The application needs read/write access to the plugin files
- Some plugins require initialization parameters; these are not yet supported
Midiverse consists of several components:
- MidiProcessor: Parses and processes MIDI files
- VstRenderer: Renders MIDI data through VST plugins (or fallback generator)
- AudioWriter: Writes audio data to WAV files
The application can run in two modes:
- Full mode with JUCE integration for VST support
- Minimal mode with a sine wave generator for testing
- "Failed to load VST plugin": Check that the plugin path is correct and the plugin format is supported
- "No suitable plugin format found": The file extension may not be recognized. Try a different plugin format.
- "Failed to parse MIDI data": The MIDI file may be corrupted or in an unsupported format.
This project is licensed under the MIT License - see the LICENSE file for details.