Created
October 14, 2019 16:20
-
-
Save illume/807b7e567dd4840b26450882ecbe5a01 to your computer and use it in GitHub Desktop.
How to play midi music with pygame.mixer.music.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# midimusic.py | |
# curl -O https://upload.wikimedia.org/wikipedia/commons/5/55/MIDI_sample.mid | |
import time, sys, pygame | |
pygame.mixer.init() | |
pygame.mixer.music.load('MIDI_sample.mid') | |
pygame.mixer.music.play() | |
while pygame.mixer.music.get_busy(): | |
print('Still playing :)') | |
time.sleep(5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment