Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fluidsynth: error: Unknown integer parameter 'synth.sample-rate' #236

Open
drscotthawley opened this issue Nov 3, 2023 · 5 comments
Open

Comments

@drscotthawley
Copy link

Hi Colin. I wonder if you might have any suggestions for the following.

I'm noticing an error on my Mac with new versions of pyfluidsynth, pretty-midi and fluidsynth, when I try to run the following code

import pretty_midi 
_SAMPLING_RATE = 16000
sample_file = 'maestro-v2.0.0/2013/ORIG-MIDI_03_7_6_13_Group__MID--AUDIO_09_R1_2013_wav--2.midi'
pm = pretty_midi.PrettyMIDI(sample_file) 
waveform = pm.fluidsynth(fs=_SAMPLING_RATE)   # <--- this line is where the error occurs

That code still works fine on Colab (e.g. in the Tensorflow RNN MIDI demo), but running on my Mac, I get:

fluidsynth: error: Unknown integer parameter 'synth.sample-rate'

On the Mac, I'm getting the error message with both pyfluidsynth versions 1.3.1 and 1.3.2.

Any idea how one might fix this? Thanks.

$ fluidsynth --version
FluidSynth runtime version 2.3.4

Screenshot from my notebook.
Screenshot 2023-11-03 at 6 12 50 PM

@drscotthawley
Copy link
Author

drscotthawley commented Nov 3, 2023

Aha! As per this Closed pyfluidsynth Issue from earlier this year, setting the sample rate to be a float instead of an int makes the error go away.

i.e.

_SAMPLING_RATE = 16000.0

is the fix. Unclear to me why this only shows up on the Mac and not Colab. 🤔

Feel free to close this Issue.

@craffel
Copy link
Owner

craffel commented Nov 6, 2023

Should we change this:

DEFAULT_SAMPLE_RATE = 44100
to a float then?

@drscotthawley
Copy link
Author

What if you just multiplied the sample rate by 1.0 when calling fluidsynth itself? e.g. on line 60

synthesizer = fluidsynth.Synth(samplerate=fs*1.0)

?
(To me, this strategy is just a workaround for an issue that "really" should be fixed on fluidsynth's end. )

@craffel
Copy link
Owner

craffel commented Nov 9, 2023

Better to call float on it, but yes.

@yawjalik
Copy link
Contributor

Hello there, this issue seems to be fixed on pyfluidsynth 1.3.3 now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants