Socket
Socket
Sign inDemoInstall

midirenderer

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

midirenderer

High-performance library for rendering MIDI files to WAV and Opus formats using SoundFonts


Maintainers
1

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

Keywords

FAQs


Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc