Skip to content

OpenMiles sound issues - #41

Merged
nolffan merged 3 commits into
masterfrom
openmiles-sound-issues
Oct 18, 2026
Merged

nolffan merged 3 commits into
masterfrom
openmiles-sound-issues

Conversation

@nolffan

@nolffan nolffan commented Oct 18, 2026

Copy link
Copy Markdown
Owner

Focused on fixing #31.

nolffan and others added 3 commits October 18, 2026 16:50
Patch 0002 mapped the 0..127 sample volume through a table interpolated
from an earlier measurement and combined it with the master volume and
the pan as exact floating-point gains. NOLF came out louder than with
retail Miles (issue #31). Measured again -- a tone, and the game's own
sounds, played through the retail Miles 6.0i mss32.dll and through
OpenMiles under Wine, with ALSA's output recorded to a file -- Miles 6's
arithmetic is integer and linear: each 0..127 volume is scaled to
v * 128 / 127, a sample's level is (sample * master) >> 7 over 128, and a
pan's far side is its distance from that edge over 64.5. OpenMiles now
does the same for Miles 6 builds (and reads the master volume back as it
was set), and the two agree within 0.01 dB at every volume from 127 to
4, every master volume and pan tried and for the game's PCM, IMA ADPCM
and MP3 sounds; the old table was 1.5-3 dB too loud at the middle and low
volumes most sounds use. Over two minutes of A Tenuous Lead (M05S03) the
game is now 0.8 dB from retail Miles, where it was 2.5 dB; what is left
is not in any sound measured on its own. OpenMiles' suite: no new
failures (the four tests of later versions' curve fail as before).

Refs #31

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The crane outside the warehouse in A Tenuous Lead (M05S03) drilled: the
engine loops its sound, LIFT3.wav, over the file's cue region with
AIL_set_sample_loop_block, in byte offsets into the sample's data, which
for IMA ADPCM are compressed blocks. OpenMiles divided them by the
decoded frame size, which put the loop at about an eighth of where it
belongs, so the crane played its first 108 ms and then repeated a 66 ms
stretch of it for as long as it moved. Recorded in-game, retail Miles
6.0i plays to 830 ms and loops back to 323 ms, the start of the block
each offset falls in; patch 0005 makes OpenMiles do the same, and in the
game it now does. OpenMiles' suite: no new failures (the four tests of
later versions' volume curve fail as before).

Fixes #31

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OpenMiles resamples each sound to its 44100 Hz mix with miniaudio's pitch
resampler, which miniaudio runs without its low-pass filter, so a
22050 Hz sound -- most of NOLF's effects -- came out with its mirror
image at 11-22 kHz, 30-45 dB down. Patch 0004 turns the filter on at its
highest order: the image above 12 kHz is now 58-84 dB down and nothing
below 9 kHz changes, and the playback rate changing every 5 ms for 4 s
leaves the output as steady as before (the instability miniaudio fears).
Retail Miles 6.0i avoids the image only by mixing at the 22050 Hz NOLF
asks for, which cuts the dialogue off at 10 kHz; recorded in-game
(M05S03), the modern build's dialogue now reaches 14 kHz, an improvement
on retail rather than a match. OpenMiles' suite: no new failures (the
four tests of later versions' volume curve fail as before).

Refs #31

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nolffan
nolffan merged commit a16e5e8 into master Oct 18, 2026
6 checks passed
@nolffan
nolffan deleted the openmiles-sound-issues branch October 18, 2026 21:53
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.

1 participant