Immersive Melodies [Fabric/Forge]

Immersive Melodies [Fabric/Forge]

7M Downloads

Midi Track Desync

KingShibaInu opened this issue ยท 7 comments

commented

When the game lags on client-side or server-side midi tracks become desynced for the rest of a song, and becomes more and more noticeable on songs with great amounts of tracks.

The easiest way to reproduce it is to play a midi with 10 tracks+; but, you can also intentionally lag the game out to cause it as well. It becomes more of a problem on larger modpacks due to instabilities.

Of course, the expected behavior is for it to sound good; but constantly resyncing them would probably be taxing on the network so I'd recommend resyncing maybe after each bar or two.

commented

Is a single player enough, as in, the desync happens between tracks and not between entities? Does the track plays properly without lags?

commented

I think what's happening is that it starts playing tracks one after another starting with #1, so the more tracks you have the worse it gets, I've been experiencing sections of songs starting multiple seconds before they should in a relatively lag free environment.

commented

Can you add a good example for me to reconstruct?

commented

I've noticed this same issue.

I think I found the exact midi track mentioned in #88 , here: http://www.vgmusic.com/music/console/nintendo/wii/SMG_-_Gusty_Garden.mid

It's really noticeable if you just listen to the Flute and Strings 2 track by themself. They start off mostly in sync, but as the song progresses, the Flute track starts to get ahead of the strings.

Furthermore, the Oboe and Flute tracks (Which seem to be the same notes), are 100% together for about 40 seconds, then after a long rest, they're off from each other by an 8th note or so. That leads me to believe it's less that it starts playing the tracks offset, but that something is happening with the playback to desync them.

I'm making my observations in a fresh, undeveloped 1.20.1 singleplayer world, with about 144 mods. (So no lag from machines or mob farms, etc.)

Actually, to be certain, I've just made a fresh instance of MC with only this mod installed, and the same desync between tracks occurred.

commented

I've gotten this issue real bad on one of my own midis I've created, and I think it has to do with the complexity of note timing, there's some kind of desync between the rate of which notes are played in the midi, and the rate of which notes are played in-game. The full midi labeled "Battle" plays perfectly, zero desyncs, but each individual track becomes out sync with each other, even when played on the same instrument by the same player, and it just becomes a mess of noise.
https://www.dropbox.com/scl/fi/3b0a73ibeah273c00y7ht/battle.mid?rlkey=7eqdlbxi0fla8f0oo3jgd9oax&dl=0

commented

Ah, I think I finally got it; upcoming version 0.4.0 should work again. Thanks for your help!

commented

I downloaded the new 0.4.0 version you published on curseforge, and testing it with the same SMG Gusty Garden is working beautifully.

Flute and Strings 2 have remained completely in sync throughout the whole midi. (as well as the other tracks, lol)

I've tested some other complicated midis as well, and they remain in sync too.

I have noticed something else though. I'm going to make a new issue for it.