Skip to content

Commit ae43086

Browse files
committed
Set playspeed after variation load
1 parent 5054c58 commit ae43086

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

source/funkin/ui/debug/charting/ChartEditorState.hx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6322,6 +6322,9 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
63226322

63236323
public function postLoadInstrumental():Void
63246324
{
6325+
var playbackRate = ((menubarItemPlaybackSpeed.value ?? 1.0) * 2.0) / 100.0;
6326+
playbackRate = Math.floor(playbackRate / 0.05) * 0.05; // Round to nearest 5%
6327+
playbackRate = Math.max(0.05, Math.min(2.0, playbackRate)); // Clamp to 5% to 200%
63256328
if (audioInstTrack != null)
63266329
{
63276330
// Prevent the time from skipping back to 0 when the song ends.
@@ -6331,8 +6334,10 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
63316334
audioInstTrack.pause();
63326335
// Keep the track at the end.
63336336
audioInstTrack.time = audioInstTrack.length;
6337+
audioInstTrack.pitch = playbackRate;
63346338
}
63356339
audioVocalTrackGroup.pause();
6340+
audioVocalTrackGroup.pitch = playbackRate;
63366341
};
63376342
}
63386343
else

0 commit comments

Comments
 (0)