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) -> bytesrender_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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file midirenderer-0.1.3-cp38-abi3-win_amd64.whl.
File metadata
- Download URL: midirenderer-0.1.3-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 342.7 kB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90518ebac0672417a45a88425244b2c40a357275897b0abcd2aaf0aa48d6efbd
|
|
| MD5 |
bb99bbe527f0c5aeb5477822a0beea86
|
|
| BLAKE2b-256 |
4158d1ca3a1437e2436b3dd88433db44560aed34a9c1ad8acda7d90b97026c80
|
File details
Details for the file midirenderer-0.1.3-cp38-abi3-manylinux_2_34_aarch64.whl.
File metadata
- Download URL: midirenderer-0.1.3-cp38-abi3-manylinux_2_34_aarch64.whl
- Upload date:
- Size: 521.6 kB
- Tags: CPython 3.8+, manylinux: glibc 2.34+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7d5575022ffd78fa1677c1df8fcb1e86c86e26d5f8ead34dc30549782cb140f
|
|
| MD5 |
fbcb058c2fef090a3cb6b513683bc3a4
|
|
| BLAKE2b-256 |
9fb466f0d1cb2de733b953f5b86ad7f6a80a7b6b2b5f56995ab42090bf971c68
|
File details
Details for the file midirenderer-0.1.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: midirenderer-0.1.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 485.5 kB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86eb9120ff3651b25889167fcbb3f17b6a8b82b963a79094a8c9998488f8cda3
|
|
| MD5 |
9c6176147444980c6cc4b27dd48914d2
|
|
| BLAKE2b-256 |
acf04e632faee3290090c7da75b210caa5e814ddfbddee65d7324d5b42b795be
|
File details
Details for the file midirenderer-0.1.3-cp38-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: midirenderer-0.1.3-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 403.3 kB
- Tags: CPython 3.8+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
671bd1b0c7ab3e543459ff666068638ee7db9817687e1de519738d97cf52e06d
|
|
| MD5 |
7874bcd31db404cebf0f1e3866ca579c
|
|
| BLAKE2b-256 |
ccf522d82ca83bb14381b08a636d831674bc9d37a5f56f54275e5f48870dd096
|
File details
Details for the file midirenderer-0.1.3-cp38-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: midirenderer-0.1.3-cp38-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 420.8 kB
- Tags: CPython 3.8+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2220ce6ef2c83fa84a4f70cbf93a3348ce41fa6bca0e95dbc2fbaea1188b3b1
|
|
| MD5 |
147715bc7067828234f841237fc3574d
|
|
| BLAKE2b-256 |
300b574983f4181ba1f83066d73f6d9cc1bfd6afbb64165365b11f97c2862288
|