Rémi Bernon (@rbernon) commented about dlls/dmusic/instrument.c:
region->wave_link.ulTableIndex = sample_index;
- /* SF2 implementation for the original hardware applies a factor of 0.4 to
* the attenuation value. Although this does not comply with the SF2 spec,* most soundfonts expect this behavior. */- attenuation = (SHORT)generators->amount[SF_GEN_INITIAL_ATTENUATION].value * 0.4; unity_note = generators->amount[SF_GEN_OVERRIDING_ROOT_KEY].value; if (unity_note == (WORD)-1) unity_note = sample->original_key; region->wave_sample.usUnityNote = unity_note - (SHORT)generators->amount[SF_GEN_COARSE_TUNE].value; region->wave_sample.sFineTune = generators->amount[SF_GEN_FINE_TUNE].value;
- region->wave_sample.lAttenuation = sample->correction;
- region->wave_sample.lAttenuation = (LONG)floor(attenuation * -65536. + 0.5);
Is this really supposed to be rounding like that? It's kind of weird.