fluddokt / opsu

an open-source osu! client
GNU General Public License v3.0
123 stars 18 forks source link

[Discussion] How does opsu! handle double time mod? #311

Closed kairusds closed 4 years ago

kairusds commented 4 years ago

Sorry if this issue isn't really one but I've been meaning to ask how the game handles double time because all I can see is the music controller's pitch getting changed and I wanted to change the music controller's fake library to make the beatmap's audio the same with osu!

fluddokt commented 4 years ago

It does the simplest thing possible by just playing the audio at a different speed.

If you are trying to make it the same as osu! then I think you need to do something like time stretching. https://en.wikipedia.org/wiki/Audio_time_stretching_and_pitch_scaling

Seems complicated.

kairusds commented 4 years ago

I actually read some of osu!droid's music controller source code and it seems like it's not that hard but what's really bothering me is how the beatmap's approach rate and bpm gets affected by the audio's pitch. (I'm actually trying to make it so that dt changes the music's tempo instead of the pitch)

fluddokt commented 4 years ago

Well since most if not all of the gameplay is based off the track position of the music then the approach rate and bpm is affected by how fast or slow the music is playing. As in if using double time the music is played 1.5x faster so approach rate and bpm is will be 1.5x higher. (Gameplay wise nothing really changes) Though the code looks like its just changing the pitch, its really just changing the playback speed.

kairusds commented 4 years ago

oh okay