0
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.

asked Oct 30, 2024 at 16:42
6
  • 2
    Is it fluidsynth.synth() or fluidsynth.Synth() (note the capital S)? Commented Oct 30, 2024 at 16:50
  • I’ve been doing lowercase Commented Oct 30, 2024 at 21:27
  • And what happens if you change it to upper case? Commented Oct 30, 2024 at 21:46
  • Nothing happens when I change between the two. Commented Nov 2, 2024 at 0:18
  • What is the error message when you make it .Synth() with a capital S rather than .synth()? Commented Nov 2, 2024 at 6:56

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.