Giter VIP home page Giter VIP logo

wav2midi2wav's Introduction

Wav to MIDI to Wav

Extracts the melody notes from an audio file and exports them to MIDI and JAMS files.

The script extracts the melody from an audio file using the Melodia algorithm, and then segments the continuous pitch sequence into a series of quantized notes, and exports to MIDI using the provided BPM.

Usage

python main.py [--folder FOLDER_NAME] [--bpm BPM] [--smooth SMOOTH] [--minduration MINDURATION] [--jams]

For example:

python main.py --folder assets/COGNIMUSE/ --bpm 146 --smooth 0.25 --minduration 0.1 --jams

Notes

  • wav to mp3:
ffmpeg -i assets/test/10.wav assets/test/10.mp3
  • Find out bpm (146 in my case):
bpm-tag assets/test/10.mp3
  • wav to mid:
python audio_to_midi_melodia.py assets/test/10.wav assets/test/10.mid 146 --smooth 0.25 --minduration 0.1 --jams
timidity 10.mid -Ow -o 10_recovered.wav

Dependencies

  • Install dependencies:
pip install vamp jams numpy scipy
  • Librosa
git clone https://github.com/librosa/librosa
cd dependencies/librosa
python setup.py build
python setup.py install
cd dependencies/MIDIUtil-0.89
python setup.py install
  • Download Melodia plugin and copy all files to /usr/local/lib/vamp
  • Audio tools
pip install pydub
apt-get install ffmpeg bpm-tools
apt-get install timidity timidity-interfaces-extra

Credit

audio_to_midi_melodia

wav2midi2wav's People

Contributors

gcunhase avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.