Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect DLS Support #1373

Open
spessasus opened this issue Aug 26, 2024 · 1 comment
Open

Incorrect DLS Support #1373

spessasus opened this issue Aug 26, 2024 · 1 comment

Comments

@spessasus
Copy link
Contributor

spessasus commented Aug 26, 2024

FluidSynth version

Execute fluidsynth --version and provide the output.

FluidSynth runtime version 2.3.6
Copyright (C) 2000-2024 Peter Hanappe and others.
Distributed under the LGPL license.
SoundFont(R) is a registered trademark of Creative Technology Ltd.

FluidSynth executable version 2.3.6
Sample type=double

Describe the bug

Provide a clear and concise description of the current situation, e.g. how the bug manifests.
The DLS support in fluidsynth is missing critical features. The MIDI attached uses bank selects and attached gm.dls has them (like Square or Sine Wave) but fluidsynth defaults to bank 0 (Square Wave).

Another very important thing are the drums. They use 0 tick length notes (quite common) but there's no sound, indicating that it doesn't support volEnvDecay in DLS!

I've attached an sf2 converted version of this soundfont, and playing apple.mid with it works fine.

Expected behavior

Provide a clear and concise description of what you expected to happen.
Playing apple.mid through gm.dls should sound exactly like playing it with GS Sound Set (16-bit).sf2.

Steps to reproduce

Please explain the steps required to duplicate the issue, esp. if you are able to provide a sample application. E.g. how to start fluidsynth, what shell commands to enter, what midi events to send, etc.

  1. Download the attached file
  2. fluidsynth gm.dls -o synth.device-id=16 -o synth.gain=0.5 apple.mid

dls_fluid_issue.zip

Additional context

If you are able to illustrate the bug with an example, please provide simple
source code below or as attached file. List any other information that is relevant to your issue, e.g. stack traces, related issues, build logs, suggestions on how to fix, links to related discussions at fluid-dev, etc.

Since fluidsynth seems to ignore articulators entirely, here's some helpful stuff I found out:

I've made my own DLS to SF2 converter (which I used to convert the file) and all parameters are stored using DLS articulators (think SF2 Modulators).
My converter checks if source, control (secondary source in SF2) and transform are all 0. That usually means a soundFont generator.

If not, there are a few special cases: for example source is VibLfo and destination is pitch, then it's VibLfoToPitch (and sometimes control is modulation wheel, so that's a modulator).
Or another case, source is keyNum and destination is VolEnvDecay, that's keyNumToVolEnvDecay.
Note that in this case, (keyNum to something) there's a special correction that I needed to apply.

Other than that, it tries to transform the remaining articulators into SF2 modulators.

I hope this helps!

// I can paste the entire DLS parser here if you want ;-)
@spessasus spessasus added the bug label Aug 26, 2024
@spessasus spessasus changed the title Straight up incorrect DLS Support Incorrect DLS Support Aug 26, 2024
@derselbst
Copy link
Member

Fluidsynth primary goal is to be a SF2 synth. DLS support was made possible via libinstpatch, because it was a "low-hanging fruit". It is far from perfect. I have no time to investigate this, though. If someone is willing to, I'd welcome a PR. Here's the relevant code in fluidsynth:

static IpatchSF2VoiceCache *convert_dls_to_sf2_instrument(fluid_instpatch_font_t *patchfont, IpatchDLS2Inst *item, const char **err)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants
@derselbst @spessasus and others