Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
High-performance library for rendering MIDI files to WAV and Opus formats using SoundFonts
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.
pip install midirenderer
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)
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
MIT License
FAQs
High-performance library for rendering MIDI files to WAV and Opus formats using SoundFonts
We found that midirenderer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.