weixin_39987138 2020-11-20 21:15
浏览 0

Wrong loops when reading certain soundfonts

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

  • 写回答

13条回答 默认 最新

  • weixin_39987138 2020-11-20 21:15
    关注

    The function fixup_sample in fluid_defsfont.c converts the loopstart/end to offsets and two other functions receive the raw loop information from the soundfont, load_shdr and fluid_sample_import_sfont. It may be of interest to remove the comments from fluid_sample_import_sfont, possibly add a few printf statements to show the values of loopstart/end, and report all logging that is relevant to the loop points of the instruments.

    Original comment by: *anonymous

    评论

报告相同问题?