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

A possible solution to the old issue of Beatblock music becoming out of sync with the platforms changing #235

Open
worMatty opened this issue May 7, 2022 · 1 comment

Comments

@worMatty
Copy link

worMatty commented May 7, 2022

Hey, folks.

In the past, the platforms in the Beatblock boss were in sync with the music. Unfortunately they became out of sync over time, presumably because timers are not accurate, so they were changed to be on separate timers. I think this is unfortunate as the syncing was a great effect, and the lack of it makes it harder to play (at least for me because I'm still familiar with the old way).

I've thought of a few ways to try and fix this over the years, as it's something I think could happen in other stuff, too, but I think I found a simple fix that doesn't require altering the sound files.

There is a client command named sndplaydelay which lets you play a sound from a specified point in its length. For example, if you want to play a sound from ten seconds in, you use sndplaydelay -10 sound.wav. If you use the command again, it will override the sound and move to the point you specify. You can use it to jump around to different points in a music track.

My proposal is to use this command to play the music track, and to issue the command again whenever the platforms are toggled, supplying the correct point in the track as the argument so as to keep them in sync. For example, if the platforms toggle every five seconds, the process would look like this:

sndplaydelay -0 music/track.mp3 (I think this should work, if not then try -0.1)
sndplaydelay -5 music/track.mp3 and toggle platforms
sndplaydelay -10 music/track.mp3 and toggle platforms
sndplaydelay -15 music/track.mp3 and toggle platforms
and so on...

If the command is issued as frequently as the platforms are toggled, the variance between the toggling and the music beat landing should be minimal and hopefully unnoticeable.

There are some problems with this command. It only accepts direct sound file paths, and doesn't work with game sound name entries from a soundscript. But since the music and plugin are part of a bundle, this shouldn't be a problem. I haven't tested it with looping wavs, and I haven't determined the best way to stop it. It might be possible to supply a time that exceeds the track length to make it stop, but I have had some success with sending sndplaydelay 10 sound.wav and then sndplaydelay -10 sound.wav. If you monitored the channel the music track was played on, you could send common/null.wav on the same channel to silence it.

@gdfsgdfg
Copy link

gdfsgdfg commented May 9, 2022

Has never been out of sync in the newer versions for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants