import fluidsynth
fs = fluidsynth.synth()
fs.start(driver = 'dsound') # use DirectSound driver
sfid = fs.sfload(r'C:\Users135697円\Documents\FluidR3_GM.sf2') # replace path as needed
fs.program_select(0, sfid, 0, 0)
fs.noteon(0, 60, 30)
fs.noteon(0, 67, 30)
fs.noteon(0, 76, 30)
time.sleep(3.0)
fs.noteoff(0, 60)
fs.noteoff(0, 67)
fs.noteoff(0, 76)
time.sleep(1.0)
fs.delete()
This is my code, I'm using VSCode. For some reason, it says that fluidsynth doesn't have an attribute synth. I have installed both fluidsynth and pyfluidsynth already. Is there a reason why this isn't working?
I've tried uninstalling fluidsynth, and this is running in a .venv virtual environment.
lang-py
fluidsynth.synth()orfluidsynth.Synth()(note the capital S)?