Created
August 14, 2017 13:20
-
-
Save matael/61a7cdbc4752fbfd439c45ffea8cc324 to your computer and use it in GitHub Desktop.
Test fluidsynth
This file contains 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
import time | |
import fluidsynth | |
fs = fluidsynth.Synth() | |
fs.start(driver='alsa', midi_driver='alsa_seq') | |
sfid = fs.sfload(b"/usr/share/soundfonts/FluidR3_GM.sf2") | |
fs.program_select(0, sfid, 0, 0) | |
fs.noteon(0, 60, 30) | |
fs.noteon(0, 67, 30) | |
fs.noteon(0, 76, 30) | |
time.sleep(1.0) | |
fs.noteoff(0, 60) | |
fs.noteoff(0, 67) | |
fs.noteoff(0, 76) | |
time.sleep(1.0) | |
fs.delete() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment