undisbeliever / terrific-audio-driver

A homebrew audio driver for the Super Nintendo
Other
15 stars 3 forks source link

New pitch instructions #16

Open undisbeliever opened 3 weeks ago

undisbeliever commented 3 weeks ago

Updated 22 November 2024

KungFuFurby commented 3 weeks ago

The first piece of feedback running through my head is that there should be a way to disable noise in the middle of a note (as in, prior to key off). That is... a disable_noise instruction.

I also have a way to handle the noise generator situation between music and SFX, at least so that there is some handling to avoid conflicts:

undisbeliever commented 3 weeks ago

I've edited the play_noise instruction to add a way to disable noise.


Any sound that has a lower priority while noise is being used by more than one instance will have their VxVOL values zeroed out

This sounds possible but also very complicated in terms of managing state. The main difficulty is determining when to restore a channel's volume when noise stops in a different channel. I'm not sure if it is worth the added complexity at the moment. I'll have to think about this after I've added the play_noise instruction to the audio-driver.

KungFuFurby commented 2 weeks ago

I was looking at _update_vol_shadow_if_required__inline (albeit this may or may not turn it into an actual subroutine call in the process) to do the job of zeroing out VxVOL instead of doing a vol + pan calculation if the voice is using noise and it fails a priority check (as well as setting a dirty voice bit), and the process may be simplified if instead of a NON bit variable the music is forced to only have one voice at a time set for using noise, and the voice ID is saved in that memory location, since then the X register can simply be set to the voice ID in question.

On the MML side of things, I think N-, even without a value, might do the trick for turning off noise on a channel. This should also automatically be done when a SFX or music instance is terminated.

For other feedback not related to the ongoing discussion...

play_pitch and the pitch modulation instructions sound alright in terms of possible conflicts in MML, because P takes a number to begin with, whereas PM has a letter as the second character.

For set_detune_offset, I'd keep it running during instrument transitions, mostly because the same thing is happening for other commands (thinking of vibrato, early release, etc.).