Skip to main content

Simple and fast library to convert midi files to video

Project description

Midi2Vid - Simple and Fast Midi to Video Converter

Midi to video converter. This program renders the notes of a midi file to a video. The renderer is built on top of the pygame library and uses multiple processes to generate the frames of the video. It then uses ffmpeg to convert the frames to a video. It also uses the fluidsynth library to render the midi file to a wav file.

Example

Installation

Install from github using pip:

pip install midi2vid

Build with docker:

docker build -t midi2vid-base .
docker run --rm -v $(pwd):/app midi2vid-base -i midi2vid/data/example.mid -o your_output.mp4

Build from source:

git clone https://github.com/pianoviz/midi2vid.git
cd midi2vid
pip install -e .

Usage

midi2vid <input_midi_file> <output_video_file>

Example

There is an example midi file in the data directory. You can run the following command to generate a video from the example midi file:

midi2vid -i midi2vid/data/example.mid out.mp4 --fps 60 --width 1920 --height 1080

Configuration

Argument Description Default Value
Positional Arguments
input Input MIDI file path N/A
output Output video file path, optional N/A
Optional Arguments
-i, --input Input MIDI file path (overrides positional) N/A
-o, --output Output video file path (overrides positional) N/A
--max-note-length Maximum length of notes 80
--n-processors Number of processors to use 4
--screen-width Screen width in pixels 1920
--screen-height Screen height in pixels 1080
--fps Frames per second 30
--speed Note falling speed 300
--estimate-hands Enable hand estimation True
--debug Enable debug mode False
Colors
--white-note-color White note color as RGB 255,255,255
--black-note-color Black note color as RGB 49,49,49
--background-color Background color as RGB 43,43,43
--octave-lines-color Octave lines color as RGB 92,92,92
--note-color Note color as RGB 179,44,49
--dark-note-color Dark note color as RGB 113,34,36
--right-note-color Right hand note color as RGB 168,255,145
--left-note-color Left hand note color as RGB 176,202,229
--dark-right-note-color Dark right hand note color as RGB 118,208,68
--dark-left-note-color Dark left hand note color as RGB 124,142,151

Dependencies

  • pygame
  • ffmpeg
  • fluidsynth

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License. See the LICENSE file for details.

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

midi2vid-0.0.7.tar.gz (168.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

midi2vid-0.0.7-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file midi2vid-0.0.7.tar.gz.

File metadata

  • Download URL: midi2vid-0.0.7.tar.gz
  • Upload date:
  • Size: 168.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.15

File hashes

Hashes for midi2vid-0.0.7.tar.gz
Algorithm Hash digest
SHA256 5c66d33317dde1ca5afc54c0d4248266e2b73ba3fd2bb6d8e0c7776d9bab4216
MD5 69630bab402103562276552afc6e2c38
BLAKE2b-256 4a196526e9e075555c616df615c01108d0cbdb3de6e754c21fbb8ee386d42a3e

See more details on using hashes here.

File details

Details for the file midi2vid-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: midi2vid-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.15

File hashes

Hashes for midi2vid-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 a7ee0d6b4c29b73a6df63b4c5757f7040543f624d2b8b79517e72612b7e12cc2
MD5 194080071fec778ad55c524d1e5fc0c7
BLAKE2b-256 3abea485630bb781260bfc352acbdd1db5f3258c286c175d4edf0e3a86560aa2

See more details on using hashes here.

Supported by

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