How could i lower the speed for theses gui note frames

hello i am creating a rhythm game, and i have ran into a problem, i am trying to make the note frames according to the musics beat but for some reason the notes are moving really fast

–video

–Script that handles the spawning of the note frame

function sync:OnStart()
	self.audio:Play()
	
	self.secPerBeat = 60.0 / self.bpm
	self.dspSongTime = self.audio.TimePosition
	
	while true do
		print(self.audio.PlaybackLoudness)
		wait(self.secPerBeat/self.audio.PlaybackLoudness)
		self:OnCreateNotes(self.audio.PlaybackLoudness)
	end
end

—Scripts for creating the notes

function sync:OnCreateNotes(audio)
	local last = tick()
	local time = 0
	
	self.eventFireTime = 10
	
	if self.eventFireTime <= self.songBPM.Value then
		time = last + self.songBPM.Value /1000

		if tick() <= time then
			repeat
				run.Heartbeat:Wait()
			until tick() > time
			
			local notes = rep.Assets.Notes:Clone()
			notes.Parent = playerService.LocalPlayer.PlayerGui.BeatsScreen.BeatsFrame
			
			local hitBar = playerService.LocalPlayer.PlayerGui.BeatsScreen.BeatsFrame.HitBar
			notes:TweenPosition(UDim2.new(hitBar.Position.X.Scale + 1, hitBar.Position.X.Offset, hitBar.Position.Y.Scale, hitBar.Position.Y.Offset), "Out", "Quad", .9, true)
			
			if audio <= 500 then
				print("hold note")
			end
		end		
	end
end

I don’t know the answer 100%, but my best guess is this:

When calculating a quote on quote beat, the system probably fails because of whatever reason with the song. The conditions of the song or beat have to be perfect for this to work, or it will not know what to do

1 Like

Update I found I really useful open source script RhythmService: Easily make rhythm games and features