midi2Tiles
Demo
About
This tool create synthesia-like piano tiles effect from midi files.
Although Synthesia provides nice animation, it is not for free. Hence, I use matplotlib to create the piano tiles animation.
The output video can futher be imported in video editting software such as After Effects as an overlay of your video.
Install
pip install midi2Tiles
Usage
# some video settings
VIDEO_DPI = 1000
VIDEO_FPS = 60
VIDEO_WIDTH = 1080
VIDEO_HEIGHT = 720
# the proportion of keyboard display
KB_RATIO = 0.1
# speed of the falling tiles (pixels per sec)
# notice that this value also affect the height of each tile
TILE_VELOCITY = 500
from midi2Tiles import pianoTileCreator
ptc = pianoTileCreator.PianoTileCreator(video_width=VIDEO_WIDTH,
video_height=VIDEO_HEIGHT,
video_dpi=VIDEO_DPI,
video_fps=VIDEO_FPS,
KB_ratio=KB_RATIO,
tile_velocity=TILE_VELOCITY,
key_color="green",
showKeyVelocity=True)
ptc.loadMidiFile("<input midi file>",verbose=True)
ptc.render("<output video file>",verbose=True)
Parameters
video_width (int): the width of the output video (px)video_height (int): the height of the output video (px)video_dpi (int): the dpi of the output video (px)video_fps (int): the fps of the output video (px)KB_ratio (float): the proportion of the piano keyboard display. This value should be in [0,1)tile_velocity (int): the velocity of the falling tileskey_color (string): the color of the tilesshowKeyVelocity (bool): if True, the velocity of midi notes will affect the opacity of the tiles
Author
Ian Shih Email: yjshih23@gmail.com
Acknoledgement
The ratio of the piano design is referenced from https://github.com/gin66/piano_keyboard
Metadata
Release files for midi2Tiles 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| midi2Tiles-1.0.2.tar.gz | 301.6 kB | Without provenance | Details for midi2Tiles-1.0.2.tar.gz |
Release files / midi2Tiles-1.0.2.tar.gz
| Download URL | midi2Tiles-1.0.2.tar.gz |
|---|---|
| Size | 301.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d3e0862a6ef172314b037c9bcd860e5bce9d965182a000a66f197dcb3ab4edd3
|
|
BLAKE2b-256 checksum How to use checksums |
9062b2c82765b2d2f33a16439d57d88bc3d8c19656184fde688b21007e890eb9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.2
|
Security for midi2Tiles 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.