FluidLite icon indicating copy to clipboard operation
FluidLite copied to clipboard

Glitchy drums with SF3 files

Open mmontag opened this issue 7 years ago • 14 comments

When loading SF3 compressed SoundFonts with FluidLite (such as https://github.com/musescore/MuseScore/raw/2.1/share/sound/FluidR3Mono_GM.sf3) and playing any MIDI file with drums, I am getting very glitchy drum sounds.

Anyone else able to reproduce this or is something wrong with my build?

mmontag avatar Sep 23 '18 01:09 mmontag

@divideconcept have you tested FluidLite with SF3 soundfonts?

mmontag avatar Oct 01 '18 18:10 mmontag

I think the problem is with SF3 format itself. Because if I remember correctly, the latest Fluidsynth has supported SF3 as well, and also has similar problem like FluidLite.

Because of this, I never use sf3 anymore, because apart from problem above, sf3 has higher latency especially in low spec device as it needs Vorbis to be decoded first before producing sound.

If I want small filesize, but good sound I prefer to use mo3 format which basically a module music format like Impulse Tracker, but using Vorbis or Mp3 encoded samples. Unfortunatelly it still not implemented in libxmp yet. But you may want to use libopenmpt if you want to support mo3.

RyanBram avatar Jun 18 '19 18:06 RyanBram

Same here, I totally abandoned it. Decompressing SF3 was taking longer than downloading the SF2 in my application... https://mmontag.github.io/chip-player-js

mmontag avatar Jun 18 '19 21:06 mmontag

Possibly related to #17. I fixed it in my fork.

katyo avatar Feb 06 '20 08:02 katyo

Your fork looks nice! What is the likelihood of merging your changes back here?

mmontag avatar Feb 06 '20 23:02 mmontag

@mmontag Besides bug fixes I made some useful improvements so I would like to make PRs but this project looks inactive under last three years.

katyo avatar Feb 07 '20 09:02 katyo

Hi guys, indeed not much activity from me in this repository but I'd be happy to merge any PR !

divideconcept avatar Feb 07 '20 09:02 divideconcept

@divideconcept Sounds good!

katyo avatar Feb 07 '20 21:02 katyo

@mmontag Can you test it now?

katyo avatar Jun 14 '20 16:06 katyo

Maybe unrelated as I use SF2 but the drums break for me when there is a CC command on the drum channel doesn't happen with latest fluidsynth

Ghabry avatar Aug 25 '20 10:08 Ghabry

Maybe unrelated as I use SF2 but the drums break for me when there is a CC command on the drum channel doesn't happen with latest fluidsynth

Can you give me your font and short midi sample. I would like to debug it.

katyo avatar Aug 25 '20 12:08 katyo

We discovered this while integrating FluidLite in EasyRPG Player (because I hate glib). It is a runtime for RPG Maker 2000 games and these games use tons of Midis.

The bug was mentioned here https://github.com/EasyRPG/Player/pull/2250#issuecomment-678877500

Soundfont doesn't seem to matter, but we use this one: https://stash.reaper.fm/v/23360/Scc1t2.sf2 (basicly GM.DLS from Windows converted to SF2 because users are used to this one when playing RPG Maker games)

(CC @elsemieni : For the short midi sample: Can you help providing one? And give more information?)

Here is one file: opening2.zip

The Runtime Package with more Music is here: https://www.rpgmakerweb.com/run-time-package (2000 and 2003, you can extract them with 7zip or unar. The mids are in the Music folder)

Related upstream fluidsynth commit (we think): https://github.com/FluidSynth/fluidsynth/commit/59bbdf14545614defa87d8074f7d94e1911877cd

But is hard to backport. I was told Fluidsynth 1.1.11 also plays the drums correctly, maybe easier to fix with there code.

Ghabry avatar Aug 25 '20 12:08 Ghabry

I found it. For GM devices (the default one fluidsynth uses) the Bank select command is ignored on the DRUM channel: https://github.com/FluidSynth/fluidsynth/blob/v1.1.11/src/synth/fluid_chan.c#L232

So this shouldn't be too hard to backport :+1:

Ghabry avatar Aug 25 '20 16:08 Ghabry

I found another bug related to drums. Now Opening2.mid sounds beautiful (like in upstream FluidSynth) for me.

I will provide a patch soon :+1:

Ghabry avatar Aug 26 '20 11:08 Ghabry