Jump to content
IGNORED

Music sounds conflicted.


PuzZLeR

Recommended Posts

Greetings,

 

Personally, I don't think background music during gameplay is necessary for my latest project, since I prefer it quiet with just the sound effects to be heard more fully. (Music can make it sound cheesy if not careful.)

 

However, just for kicks, I did some experimentation.

 

The music plays great on static screens, but during gameplay it sounds gargled. What's strange about this is that it's not always gargled, just when a certain sprite/MOB moves. It's like there's some conflict of some sort.

 

I have tried to mess around with ORG, PLAY SIMPLE, etc, yet still the gargle persists.

 

Does this sound familiar to some? Any quick and dirty solution I can try?

Link to comment
Share on other sites

 

Does this sound familiar to some? Any quick and dirty solution I can try?

 

Not really a solution, but something quick-and-dirty for you to try: post some code so that people can try to help. ;)

 

UPDATE: Some things to consider: the STIC is mapped to locations $0000 - $0032 and the PSG is mapped to locations $01F0 - $01FF, so if you are doing any manual manipulations to the address in variables, and happen to get an overflow, it is conceivable that a purported write to a MOB register ends up in the PSG instead -- especially if using 8-bit variables.

 

Another thought is that, if you are storing a pointer in an 8-bit variable, it will get truncated to it's lower byte, which may coincide with a PSG address.

 

-dZ.

Edited by DZ-Jay
Link to comment
Share on other sites

 

Greetings,

 

Personally, I don't think background music during gameplay is necessary for my latest project, since I prefer it quiet with just the sound effects to be heard more fully. (Music can make it sound cheesy if not careful.)

 

However, just for kicks, I did some experimentation.

 

The music plays great on static screens, but during gameplay it sounds gargled. What's strange about this is that it's not always gargled, just when a certain sprite/MOB moves. It's like there's some conflict of some sort.

 

I have tried to mess around with ORG, PLAY SIMPLE, etc, yet still the gargle persists.

 

Does this sound familiar to some? Any quick and dirty solution I can try?

 

From your description, it sounds like it could be a sound effect causing some problem. If you have music playing, make sure that your sound effects are constrained to the third channel (SOUND 2), so that they don't conflict with the music player. Also, make sure you use PLAY SIMPLE (to only play music in the first two channels). If you use PLAY FULL, it may conflict with your sound effects.

 

-dZ.

Edited by DZ-Jay
Link to comment
Share on other sites

UPDATE: Some things to consider: the STIC is mapped to locations $0000 - $0032 and the PSG is mapped to locations $00F0 - $00FF, so if you are doing any manual manipulations to the address in variables, and happen to get an overflow, it is conceivable that a purported write to a MOB register ends up in the PSG instead -- especially if using 8-bit variables.

 

Minor correction here: The PSG is mapped at $1F0 - $1FF in the main unit. The ECS PSG is at $00F0 - $00FF.

Link to comment
Share on other sites

See if you have a wait in your game loop to keep the game running at 60 fps, and not uncapped fps.

 

Gameloop:

<Game logic stuff>

wait

goto Gameloop

 

So sprite and other stuff can be push into the register during that time.

 

Is the SOUND statement buffered as well? The PSG does not have restrictions on access.

 

-dZ.

Link to comment
Share on other sites

Hey thanks for your replies - very much appreciated. :-D I've read every one of them, but I wanted to do a bit more experimentation before a proper reply to the responses.

 

The problem is solved. For now.

 

For academic reasons:

 

 

call (gosub ) this routine at the end of sound

 

sound_reset: PROCEDURE
SOUND 0,1,0
SOUND 1,1,0
SOUND 2,1,0
SOUND 4,,$38
RETURN
END

 

 

Very ironic. Yes,sound_reset is important, and I did indeed have such a procedure, but it was what was causing the problem. I was calling the sound_reset after a certain action with the sprites with an IF, which was causing the conflict, or relieving the conflict when the IF did not apply. Changing it to the following solved the problem:

sound_reset:    PROCEDURE
    SOUND 2,1,0   'or SOUND 2,,0 was also fine
    SOUND 4,,$38
    RETURN
END

Apparently, even deactivating the first and second channels (SOUND 0 and SOUND 1 respectively) somehow activates them in a different way. Now I just stay away from them entirely (when playing music) and delete them from the procedure.

 

At any rate, I'm still glad I started this thread. I still have a few comments and questions which may generate some valuable discussion.

 

SOUND 4 seems to work. I do indeed work with PLAY SIMPLE (but use PLAY SIMPLE NO DRUMS to be safe). Hopefully I don't have a problem down the road with this channel.

 

SOUND 3 now sucks with background music. It "works" but doesn't do the same thing with music on. :(

 

From your description, it sounds like it could be a sound effect causing some problem. If you have music playing, make sure that your sound effects are constrained to the third channel (SOUND 2), so that they don't conflict with the music player. Also, make sure you use PLAY SIMPLE (to only play music in the first two channels). If you use PLAY FULL, it may conflict with your sound effects.

 

True indeed. And it makes sense that the first two channels were causing the problem (even if I was only deactivating them).

 

I ask the Forum, how about the role SOUND 3 and SOUND 4 play in this context? Any feedback on this?

 

...if you are doing any manual manipulations to the address in variables, and happen to get an overflow, it is conceivable that a purported write to a MOB register ends up in the PSG instead -- especially if using 8-bit variables.

 

Another thought is that, if you are storing a pointer in an 8-bit variable, it will get truncated to it's lower byte, which may coincide with a PSG address.

 

 

 

The PSG is mapped at $1F0 - $1FF in the main unit. The ECS PSG is at $00F0 - $00FF.

 

I did indeed play around with ORG and tried to isolate sound and music in different ROM segments so they don't conflict. I had no success. I was wondering, is there a proper way to do this?

 

Just an idea, maybe it is silly, but do you have at least a Wait instruction in your main loop?

 

Kiwi said: (For some reason the Forum was not letting me quote you properly, so I do this manually. :) )

 

See if you have a wait in your game loop to keep the game running at 60 fps, and not uncapped fps.

Gameloop:
<Game logic stuff>
wait
goto Gameloop

So sprite and other stuff can be push into the register during that time.

 

Ha ha. I've accomplised that bumble in the past, and it has created sound/music problems before, so worth pointing out. :)

Edited by PuzZLeR
Link to comment
Share on other sites

I don't know if this is your problem, but I just thought this: Do not have the PLAY MUSIC in your loop. It needs to be called just once.

 

It wasn't my problem, but you bring up an interesting point. Changing the music upon game level, screen, mode, etc, is easy. Changing the music during, say during an in-level action such as a power up received, etc, is an adventure.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...