Skip to content

SoundFont 2: skip "marker" presets that reference no samples#175

Merged
git-moss merged 1 commit into
git-moss:mainfrom
douglas-carmichael:sf2-skip-empty-presets
Jul 8, 2026
Merged

SoundFont 2: skip "marker" presets that reference no samples#175
git-moss merged 1 commit into
git-moss:mainfrom
douglas-carmichael:sf2-skip-empty-presets

Conversation

@douglas-carmichael

Copy link
Copy Markdown
Contributor

Problem

Commercial SoundFonts frequently include one or two presets that carry no playable content and exist only to stamp the file with the vendor or copyright. For example, an E-mu Orbit.SF2 has presets named "E-mu Systems 2007" and "DigitalSoundFactory", each with a preset zone that points at an instrument which has no instrument zones (zero samples).

Sf2Detector created an IMultisampleSource for every preset unconditionally, so these produced empty instruments in the destination format — an empty Waldorf QPAT, an empty Renoise XRNI, etc. The user noticed empty .qpat files named after those two "presets".

Fix

After building the multi-sample for a preset, skip it if it has no non-empty groups (no samples), and log which preset was skipped. This mirrors the existing guard in EnsoniqEpsAsrDetector (if (multisampleSource.getNonEmptyGroups(...).isEmpty()) continue;), so it follows an established pattern, and it fixes the problem once at the source for every destination format rather than per-creator.

if (multisampleSource.getNonEmptyGroups (false).isEmpty ())
{
    this.notifier.log ("IDS_NOTIFY_SF2_SKIP_EMPTY_PRESET", presetName);
    continue;
}

getNonEmptyGroups(false) is used (rather than true) so a preset is skipped only when it has literally no sample zones — never merely because its zones are release-triggers.

Verification

Analyzed Orbit.SF2 before/after:

  • Before: 236 presets detected (incl. the two empty marker presets).
  • After: 234 detected; the log shows
    Skipping SoundFont preset 'E-mu Systems 2007' because it contains no samples. and the same for DigitalSoundFactory.
  • All 234 real presets are unaffected.

A new IDS_NOTIFY_SF2_SKIP_EMPTY_PRESET string is added; CHANGELOG updated.

(Note: main HEAD currently has an unrelated XMLUtils.escapeAttribute compile error in OmnisphereCreator against the vendored uitools jar; it is independent of this change — the modified Sf2Detector compiles clean.)

Commercial SoundFonts frequently include one or two presets that carry no
playable content and exist only to stamp the file with the vendor or
copyright - e.g. an E-mu Orbit.SF2 has presets named "E-mu Systems 2007"
and "DigitalSoundFactory", each with a preset zone pointing at an
instrument that has no instrument zones (zero samples).

The detector created an IMultisampleSource for every preset regardless,
so these produced empty instruments in the destination format (e.g. an
empty Waldorf QPAT, or an empty Renoise XRNI). Skip any preset whose
multi-sample has no non-empty groups, mirroring the existing guard in the
Ensoniq EPS/ASR detector, and log which preset was skipped.

Verified on Orbit.SF2: 236 presets -> 234 written, the two marker presets
skipped with a log line, all real presets unaffected.
douglas-carmichael added a commit to douglas-carmichael/ConvertWithMoss that referenced this pull request Jul 7, 2026
…ng rename (PR git-moss#176)

- SoundFont 2: skip presets that reference no samples (the commercial-bank
  'marker' presets like 'E-mu Systems 2007'), so they no longer become empty
  instruments. Mirrors the Ensoniq detector guard; new IDS_NOTIFY_SF2_SKIP_EMPTY_PRESET.
- UI: rename the 'Process' button to 'Processing' (matches the dialog title,
  non-imperative, Alt+P) and reword its tooltip.
@git-moss git-moss merged commit b7b927d into git-moss:main Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants