Skip to content

DLS Conversion Problem

spessasus edited this page Nov 16, 2024 · 4 revisions

The DLS Conversion problem

SpessaSynth supports DLS conversion, but it's limited. For example:

  • only CC7 CC10 CC11 CC92 and CC93 can be modulated in DLS.
  • sample offsets can't be modulated.
  • vibLfoToPitch is split up into a separate source and destination in DLS, meaning no support for secondary source with this generator as destination

And most importantly: only one instrument layer.

This means that the program has to combine all zones from all instruments in a preset into a single zone list. And since soundfont can have up to 2^16 generators, complex soundfonts cannot be converted back from DLS into SF2. SpessaSynth tries to put as many generators as it can into the global zone to decrease the count, but it doesn't always work. Note that it can read these large DLS files without issue, converting them back into SF2 is the problem.

Also there's simply lack of documentation or software to test with. The only ones I'm aware of are:

  • fluidsynth & Swami (both use libinstpatch)
  • SynthFont Viena
  • SonivoxEAS
  • Awave Studio

libinstpatch (fluidsynth & Swami) rejects SpessaSynth's files with Invalid RIFF chunk id. why? I have no idea! SynthFont Viena crashes. SonivoxEAS works fine with small soundfonts. Awave Studio works fine.

So effectively the only way I was testing my soundfonts, was just running sf2 -> DLS -> sf2 in SpessaSynth to see if it works, and it seems to.

I hope that this solution is good enough for such an obscure functionality.