Giter Site home page Giter Site logo

nschmidtg / image_to_midi Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 53.13 MB

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: MIT License

Python 100.00%
cv2 python machine-learning midi macos midi-controller music-composition music-generation pysimplegui windows

image_to_midi's Introduction

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"

image_to_midi's People

Contributors

nschmidtg avatar

Watchers

 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.