Skip to content

Python program to generate MIDI notes and CC. The UI was implemented using PySimpleGUI and the MIDI messages are sent via MidiUtil python package. The Notes and their velocity are sampled from a probability distribution of the grey distribution of any inputed image. The CC are assigned to the X-position of any person detected by a webcam using cv2.

License

Notifications You must be signed in to change notification settings

nschmidtg/image_to_midi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image to Midi

Python package to convert image to Midi. It takes as an input an image and interpretes it as a probability distribution (gray scale based), considering the X axis a series of the selected notes and the Y axis the velocity. Separation controls the sampling frequency from a Normaldistribution from the learned probability distribution and the Duration controls the note duration from another Normal propability distribution.

TODO

SCREENSHOT

Install

Tested on Python 3.7

pip install -r requirements.txt
python image_to_midi.py

To it with your DAW:

  • Create a virtual MIDI channel:
    • for MacOS: Create new MIDI Bus Channel using the MIDI Studio: cmnd + space - type Audio MIDI Setup - Click on Window - Show MIDI Studio Midi Studio config
    • For Windows download LoopMIDI install it and create a new MIDI Channel
  • In your DAW select the BUS with Track and Remote options activated Ableton

Compile UI

MacOS

pyinstaller image_to_midi.py --onefile --noconfirm --windowed --hidden-import=mido,cv2.cv2 --paths=classes --add-data="model/MobileNetSSD_deploy.prototxt:model" --add-data="model/MobileNetSSD_deploy.caffemodel:model" --add-data="images/video.mp4:images"

windows

For Windows you will need the Visual Studio Developer Tools C++ 14 make sure you have python 3.7 and pyinstaller on the PATH environment variables.

pyinstaller image_to_midi.py --onefile --noconfirm --windowed --hidden-import=mido,cv2.cv2 --paths=classes --add-data="model/MobileNetSSD_deploy.prototxt;model" --add-data="model/MobileNetSSD_deploy.caffemodel;model" --add-data="images/video.mp4;images"

About

Python program to generate MIDI notes and CC. The UI was implemented using PySimpleGUI and the MIDI messages are sent via MidiUtil python package. The Notes and their velocity are sampled from a probability distribution of the grey distribution of any inputed image. The CC are assigned to the X-position of any person detected by a webcam using cv2.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages