High-performance library for rendering MIDI files to WAV and Opus formats using SoundFonts
Project description
MidiRenderer
MidiRenderer is a high-performance Python library for rendering MIDI files to WAV and Opus formats using SoundFonts. Built with Rust for speed and efficiency.
Features
- Render MIDI to WAV and Opus
- Uses SoundFont (.sf2) files
- High-performance Rust backend
- Cross-platform support (Windows, macOS, Linux, including ARM64)
Installation
pip install midirenderer
Quick Start
import midirenderer
from pathlib import Path
# Render MIDI to WAV
wav_data = midirenderer.render_wave_from(
Path('soundfont.sf2').read_bytes(),
Path('music.mid').read_bytes()
)
with open('output.wav', 'wb') as f:
f.write(wav_data)
# Render MIDI to Opus
opus_data = midirenderer.render_opus_from(
Path('soundfont.sf2').read_bytes(),
Path('music.mid').read_bytes(),
stereo=True,
bitrate="128000" # 128 kbps
)
with open('output.opus', 'wb') as f:
f.write(opus_data)
API
render_wave_from(soundfont_bytes: bytes, midi_bytes: bytes) -> bytes
render_opus_from(soundfont_bytes: bytes, midi_bytes: bytes, stereo: bool = True, bitrate: str = "auto") -> bytes
Requirements
- Python 3.8+
- libopus (usually pre-installed on most systems)
License
MIT License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distributions
Close
Hashes for midirenderer-0.1.2-cp38-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49bc2e1cc5637ecec3689e5083dd7514de0fb841695f5a3de5aa2b0cda636cdb |
|
MD5 | d1e1f295696e951bab02ed33a15fd54d |
|
BLAKE2b-256 | ccdbadfa6c331e1584cebaed73b5db734ad9d6afb7b6ee7e618fee3b57bbf06b |
Close
Hashes for midirenderer-0.1.2-cp38-abi3-manylinux_2_34_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3db9bd43380dc66a4b8861f54b39918eff46716025d542f6c8f1e1e879c0b83 |
|
MD5 | 9f48c30fe39c808533694dab65f10cd1 |
|
BLAKE2b-256 | e8e81f7a9d69079d80330359fe4e61d6c709dfbe9aa7ecd1995c401152776ded |
Close
Hashes for midirenderer-0.1.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e82ab2a4fb14d73b405d2eb4b6dcd91e947fd6284fc92dda808224d6422fb038 |
|
MD5 | a36a673aebe475c0c62fbceaf507d952 |
|
BLAKE2b-256 | 4f251d273624650d394f646f956b33ebae20832cf0f1322765591af2c7920635 |
Close
Hashes for midirenderer-0.1.2-cp38-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5aed3daff30b61c0d514086f75dd4afaaef6134367e375f9af1ccf11f3f88e6 |
|
MD5 | 350b19d11a46efa10677fc17d3460b1e |
|
BLAKE2b-256 | 8dd05f511865cc7690b116f97d7748dd2646c22a6e5edba8bdbeac0492af1700 |
Close
Hashes for midirenderer-0.1.2-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5684bf2615e60909422c0d691761b2acac991c8002087ce96bd3c770e29c3c61 |
|
MD5 | bebf509dfe1083efe23f5d9cddb8e5a8 |
|
BLAKE2b-256 | d949bdbefcae9ce6249a86beeb023a4cc283ad13574238d430ad8ec9e6271060 |