Help with making audio merge smoothly

Hello everyone, I am attempting to make a vehicle sound script using the RPM and want to use a different audio every 1000 rpm instead of one audio that constantly changes pitch as you can hear more of the changes the engine makes every rpm.

I currently use the sub 1000 numbers as the interlude part and the 1000s to decide which audio should play like this:

local function Sounds(lwrrpm, hrrpm, RPMC, Throttle)
	for i,v in pairs(SoundModel:GetDescendants())do 
		if v.Name~="BOV" and v.Name~="Boost" and v:IsA("Sound") then
			v.Volume=0
		end
		if Throttle>=0.5 then
			if v.Name==tostring(hrrpm).."L" then
				v.Volume=SoundData.SoundData[hrrpm].Volume*(RPMC/500)
				v.DIST.Level=SoundData.SoundData[hrrpm].Distortion
				v.PITC.Octave=1-(RPMC/2500)
			elseif v.Name==tostring(lwrrpm).."L" then
				v.Volume=SoundData.SoundData[lwrrpm].Volume
				v.DIST.Level=SoundData.SoundData[lwrrpm].Distortion
				v.PITC.Octave=1+(RPMC/2500)
			end
		else
			if v.Name==tostring(hrrpm).."C" then
				v.Volume=SoundData.SoundData[hrrpm].Volume*(RPMC/500)
				v.DIST.Level=SoundData.SoundData[hrrpm].Distortion
				v.PITC.Octave=1-(RPMC/2500)
			elseif v.Name==tostring(lwrrpm).."C" then
				v.Volume=SoundData.SoundData[lwrrpm].Volume
				v.DIST.Level=SoundData.SoundData[lwrrpm].Distortion
				v.PITC.Octave=1+(RPMC/2500)
			end
		end
	end
end

I am also using C to use the audio when there is no throttle being applied and L is for load which means there is throttle being applied. hrrpm is the current rpm +1 and lwrrpm is the current rpm. this is what it sounds like which really makes me think i used the sound an UFO would make


yes i know it sounds bad but thats why im asking the smart people. WARNING IT MAY BE LOUD

I thank you for investing time reading all of my stupidity

It seems like the problem is simply the loop not running every frame. How are you executing this code? On the server or client?

Well since the audio has to run serversided and the chassis (A-Chassis) is only giving rpm values and such clientsided i have to use a remoteevent to send it to serverside which really sucks for performance but i dont really mind performance in this game for now. the client runs .Changed on the RPM and the Turbo and and sends a remote every change

In that case, it might be a sound filtering issue. The sound is played on the client, and .2 seconds later it plays on the server and the client. Removing replication for the client you’re using would probably fix this.