pip install musing
Simple Melody
from musing import Musing
muse = Musing()
muse.add_notes(['C5','C5', 'G5', 'G5', 'A5', 'A5', 'G5','F5','F5','E5','E5','D5','D5','C5'])
muse.play()
With Rhythm
from musing import MusingRhythm,Clip
r = '-- - - -- ..|-- - - -- -- -- ----'
mr = MusingRhythm(r,unit_time=3)
m = ['E5','E5','D5','E5','E5','E5','G5','E5','D5','E5']
Clip(mr,m).play()
Read & Play MIDI File
from musing import Musing
muse = Musing()
notes = Musing.midi_to_note()
muse.add_notes(notes)
muse.play()
- O-matic
- cross-platform
- More easy for human being
- Some Chords & Progression
- 1 2 3 4 5 6 7
- C D E F G A B
If you want to play the midi file, you should install a midi player first.
VLC :
- Debian/Ubuntu
apt install vlc vlc-plugin-fluidsynth
Timidity:
-
CentOS
sudo rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
yum install epel* timidity++
-
Debian/Ubuntu
apt install timidity++
e.g. custorm player : use set the player path muse.play(player_path="/bin/timidity")