Closed theosib closed 2 months ago
In pull request #63 I added a new test, test/test4.py
that shows pitch bend. It also fixes some bugs.
The main thing is that the pyfluidsynth pitch_bend
measures from 0, so you pass 0 to get no pitch bend, 8191 to get maximal upwards bend, and -8192 to get maximal downwards pitch bend. So in your code above I would change the constants from 8192
and 10000
to 0
and 1808
.
There was also a problem with out-of-range values. Prior to PR #63 if you gave out of range pitch bend values, fluidsynth would ignore them. The docstring suggested that 8192 was the maximum value, but actually 8191 is the maximum value. With PR #63 I fixed it to clamp the value to the legal range.
@theosib Could you try with updated values to see if you get the pitch bend?
Closing as inactive, feel free to re-open if you think there is still an issue.
I have fluid-synth installed from homebrew and pyfluidsynth installed from pip (plus I had to edit the pyfluidsynth code so it could find the fluid-synth library).
I have verified that fluid-synth itself supports pitch bending by using its command line tool and giving it commands.
But the pitch_bend API doesn't seem to work in python. Here's a code sample that demonstrates the problem. I should hear two different notes, but this plays the same one twice.