Skip to main content

Converts audio to midi.

Project description

Audio to midi converter

Follow this guide for installation and usage.

For information about how it works, read the whitepaper.

Quickstart guides

Installation from Github repo

git clone https://github.com/tiagoft/audio_to_midi.git

cd audio_to_midi

python -m build

pip install .\dist\audio_to_midi-0.0.1-py3-none-any.whl

Usage as a Python library

import sys
import librosa

from audio_to_midi.monophonic import wave_to_midi

print("Starting...")
file_in = sys.argv[1]
file_out = sys.argv[2]
y, sr = librosa.load(file_in, sr=None)
print("Audio file loaded!")
midi = wave_to_midi(y, sr=sr)
print("Conversion finished!")
with open (file_out, 'wb') as f:
    midi.writeFile(f)
print("Done. Exiting!")

Command-line interface (CLI)

After installing:

w2m input_file.wav output_file.mid

(supports most common formats like wav, aiff, mp3...)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sound_to_midi-0.0.3.tar.gz (16.8 kB view hashes)

Uploaded Source

Built Distribution

sound_to_midi-0.0.3-py3-none-any.whl (18.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page