Gtk application to visualize MIDI file as piano tutorial videos.
A project for the course Multimedium Computing Environment (National Taiwan University, 2018 Spring).
$ sudo apt install python3-venv python3-pip gstreamer1.0-plugins-bad ffmpeg libffi-dev
$ make start
The Makefile script downloads a soundfont (249 MB) and creates virtualenv environment.
- Install Python 3.4
- Noted that PyGObject for Windows do not support Python 3.5 or above
- Install PyGObject for Windows
- Choose these items in GNOME libraries:
- Base packages
- Gst-plugins
- Gst-plugins-extra
- Gst-plugins-more
- Gstreamer
- GTK+
- JSON-glib
- Choose none in non-GNOME libraries
- Choose none in development packages
- Choose these items in GNOME libraries:
- Open the
cmd.exe
to prepare for installing dependencies> python -m pip install --upgrade pip > pip install requests pycparser
- Download wheel packages from Unofficial Windows Binaries for Python Extension Packages
cffi‑1.11.5‑cp34‑cp34m‑win_amd64.whl
moviepy‑0.2.3.4‑py2.py3‑none‑any.whl
- Open the
cmd.exe
again to install dependencies> pip install cffi‑1.11.5‑cp34‑cp34m‑win_amd64.whl > pip install moviepy‑0.2.3.4‑py2.py3‑none‑any.whl > pip install gizeh mido intervaltree
- Open
C:\Python34\Lib\site-packages\cairocffi\__init__.py
- Change line 41 and save
- cairo = dlopen(ffi, 'cairo', 'cairo-2') + cairo = dlopen(ffi, 'cairo', 'cairo-2', 'cairo-gobject-2')
- Change line 41 and save
- Download soundfont from musical-artifacts.com, save it to
soundfont/touhou.sf2
- Execute
python3 src/main.py
- Gtk framework
- Dependent packages
- gizeh: a Python library for vector graphics
- moviepy: a Python library for video editing
- mido: a library for working with MIDI messages and ports
- intervaltree: a mutable, self-balancing interval tree
- Resources
midi/charming-domination.mid
from Chris33711midi/at-the-end-of-the-spring.mid
from Chris33711soundfont/Touhou.sf2
from Musical Artifacts