Originally created by: Mr_Bumpy
Under certain circumstances, when out of polyphony, FluidSynth seems to steal newly-created voices if more than one sample is triggered at the same time. This file contains a test SoundFont and audio examples, as well as more details on the bug.
From the included documentation:
I have discovered an apparent voice-allocation bug that reveals itself under the following circumstances:
- more than one sample is played with each keypress
- the preset's volume envelope has long release values
- the sustain pedal is not being held down
- enough notes are being played to exhaust Fluidsynth's available polyphony (which causes FluidSynth to choose which existing voices get the axe to make room for the new ones)
What seems to happen is that when FluidSynth runs out of voices and a new note is played, it has to choose an existing note to kill as determined by FluidSynth's voice-stealing logic. Unfortunately, if a note is played that requires more than one voice, FluidSynth seems to steal the first newly allocated voice to give it to the second.
Another way of looking at it is:
- FluidSynth is out of notes, and receives an event to trigger a new note.
- The new note requires two voices of polyphony.
- FluidSynth steals an older voice so that the sample 1 of the new note can play.
- FluidSynth steals another voice so that the sample 2 of the new note can play, except that it steals the voice that was just assigned to sample 1 instead, so sample 1 is cut short before it even gets started.
For the final MIDI example, I created a piano preset that uses two samples per key, one panned hard left, and the other hard right and features a long volume envelope release time. The example plays a fast glissando, which causes FluidSynth to run out of polyphony. When that happens, you only hear the left sample playing on new notes, because the right sample is never getting a chance to sound.
Reported by: *anonymous
Original Ticket: fluidsynth/tickets/27
该提问来源于开源项目:FluidSynth/fluidsynth