Fuzzy sound

Blitz3D Forums/Blitz3D Beginners Area/Fuzzy sound

Q(Posted 2005) [#1]
Whenever I load my 2nd song the mid sounds fuzzy. The code goes something like this:

Global MAIN = PlayMusic("SOUNDS/MUSIC/c2endng.mid")

Global CREDITSVIEW = False
Global PLAYGAME = False

Global WAVE = 1

HidePointer

While Not Keyhit(1)

	Cls

	DrawImage BG, 140, 110
	DrawImage PLAY, 235, 180
	DrawImage OPTIONS, 235, 210
	DrawImage HIGHSCORES, 235, 245
	DrawImage HELP, 235, 280
	DrawImage CREDITS, 235, 310
	DrawImage Exit1, 235, 375
	
	DrawImage cursor, MouseX(), MouseY()
	If ImagesOverlap(CURSOR2, MouseX(), MouseY(), PLAY, 235, 180)
		If MouseDown(1) = True Then PLAYGAME = True
		If MouseDown(1) = True Then StopChannel MAIN
	EndIf
	
	If ImagesOverlap(CURSOR2, MouseX(), MouseY(), Exit1, 235, 370)
		If MouseDown(1) = True Then End
	EndIf
	
	If ImagesOverlap(CURSOR2, MouseX(), MouseY(), CREDITS, 235, 310)
		If MouseDown(1) = True Then CREDITSVIEW = True
		If MouseDown(1) = True Then StopChannel MAIN
	EndIf
	
	Flip
	
wend

CREDITS_SONG = PlayMusic("SOUNDS/MUSIC/Voyager.MID")



Sledge(Posted 2005) [#2]
Off the top of my head, try sending the second tune down the MAIN channel after you stop the first. I don't really go for Midi so that's just a guess.

Also:

If ImagesOverlap(CURSOR2, MouseX(), MouseY(), PLAY, 235, 180)
If MouseDown(1) = True Then PLAYGAME = True
If MouseDown(1) = True Then StopChannel MAIN
EndIf



...would be better as...
If ImagesOverlap(CURSOR2, MouseX(), MouseY(), PLAY, 235, 180)
	If MouseDown(1) = True
		PLAYGAME = True
		StopChannel MAIN
	EndIf	
EndIf


By testing for the MouseHit multiple times for a single menu choice all you're doing is introducing the possibility that some of the code for that option won't be executed (because the player could very well release the mouse button after the first MouseHit test).

While I'm rambling, I would probably do that bit in reverse, too... wait for a mouseclick and then see if the pointer is over a menu button. It won't make a whole load of difference here, but automatically reducing the amount of checks is a good habit to get into for later.


Q(Posted 2005) [#3]
I still have a fuzzy sound :o(


Sledge(Posted 2005) [#4]
Yeah I just tried something similar here and, no matter whether I use the same channel or not, it sounds fine. Try a .mod file... if midi's don't work for you then quite frankly that's a blessing :D


Jams(Posted 2005) [#5]
Sounds like a problem with your soundcard, when you say fuzzy, is it kind of choppy?? Like it's stopping and starting thousands of times a second?


Q(Posted 2005) [#6]
It's not choppy. It sounds staticy while playing, and the bass sounds like it has more dBs than it should.