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

Improve MIDI playback accuracy #2478

Merged
merged 4 commits into from Mar 20, 2021
Merged

Conversation

Ghabry
Copy link
Member

@Ghabry Ghabry commented Mar 14, 2021

by processing messages in smaller chunks. This reduces the resolution from 4-8ms to 1ms.

dk.zip

  • dkbad.ogg - Upstream
  • dkgood.ogg - This patch
  • dkorig.ogg - RPG_RT (different soundfont)

@Ghabry Ghabry added this to the 0.6.3 milestone Mar 14, 2021
@fdelapena
Copy link
Contributor

fdelapena commented Mar 15, 2021

Though a previous hotfix for loop broke midi tempo (pitch change) in master (not just for wildmidi), https://easyrpg.org/play/pr2478/?game=smashbros note timings play properly now 👍

@Ghabry
Copy link
Member Author

Ghabry commented Mar 15, 2021

The playback speed does not change anymore?
Okay will check this

@Ghabry
Copy link
Member Author

Ghabry commented Mar 15, 2021

My last Pitch patch had a bug: The calculation was wrong, must be 100/pitch, not pitch/100.

I also added a clamping for invalid BGM/SE values. I read in the Yume2kki Discord that a song in the latest version uses a pitch of 20. This is adjusted to 100 because it is out-of-range. Now it becomes 50. This is at least closer. Lifting the range would need testing first, so this fix was faster.

@Ghabry Ghabry force-pushed the music-limits branch 2 times, most recently from 41c9129 to 620a66b Compare March 15, 2021 11:30
@fdelapena
Copy link
Contributor

The pitch/tempo works again, thanks!
About clamping values: RPG_RT.exe supports modified pitch values below 50% / above 150%. It's unlikely somebody modified this by hand, but based on experience with some weird games tweaking some values... well, we can wait until some bug report appears 👍.

…ks. This reduces the resolution from 4-8ms to 1ms.
Some songs in Yume2kki use a pitch of 20. This patch does not fix it (value too low) but the result comes closer without additional testing.
@fdelapena fdelapena mentioned this pull request Mar 16, 2021
7 tasks
@fdelapena fdelapena merged commit 239686f into EasyRPG:master Mar 20, 2021
@carstene1ns carstene1ns mentioned this pull request Mar 23, 2021
1 task
@Ghabry Ghabry deleted the music-limits branch May 27, 2021 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants