When certain soundfonts/instruments are played there is a distinct beating that is probably caused by the loops being wrong. I've heard this with many different videogame related soundfonts, to take one as an example here's a for Final Fantasy VI soundfont . Many instruments have problems here, for example program 000-024 (Guitar) and 000-078 (Ocarina1) . It doesn't seem to be a problem with the soundfont since it plays correctly in other software.
To try and investigate I loaded the soundfont in Swami and Polyphone, two different soundfont editors. Swami's playback is wrong too (I know it uses fluidsynth, but I'm not sure if it shares the sf2 loading code with it). Polyphone plays it correctly.
Interestingly the sample loop points for these instruments had different data in both softwares. For example in swami the sample for 'Guitar' (s_guitar) loops from 8 to 5960 and Polyphone reports it as 5456 to 5967. Polyphone gets it right and it seems that for the offending samples Swami always had them starting at a fixed 8 and finishing with an offset of -7 the working value.
Anyway, I'm not aware if swami shares code with fluidsynth, but it probably shares this bug in interpreting the soundfont data. I browsed through both projects code and I recognize I'm not knowledgeable enough to try and fix this myself, but I hope this report has enough details for someone to do it.
I assure you this happens with many other soundfonts and can provide more examples if needed. Also I tested with the latest fluidsynth code from git to be sure and it does have the same problem.
Thanks!
Reported by: lfzawacki
Original Ticket: fluidsynth/tickets/151
该提问来源于开源项目:FluidSynth/fluidsynth