Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Noise channel can glitch out when getting on a bike #837

Open
ariscop opened this issue Mar 27, 2023 · 1 comment
Open

Noise channel can glitch out when getting on a bike #837

ariscop opened this issue Mar 27, 2023 · 1 comment

Comments

@ariscop
Copy link

ariscop commented Mar 27, 2023

This can be triggered somewhat reliably in violet city with the bike on select. hit select during the group two kicks, after the first snare

Music_VioletCity_Ch4:
	toggle_noise 3
	drum_speed 12
	drum_note 4, 2
	drum_note 3, 2
	drum_note 4, 1 < hit select here
	drum_note 4, 1
	drum_note 3, 2

Whatever noise note was playing will continue into the bicycle music, the snare for example can be heard somewhat easily, but is most apparent with Kick1 as its first note has a flat volume envelope, and continues to play until another note replaces it

Kick1:
	noise_note 32, 8, 8, 107 ; initial volume 8, increasing, 0 steps
	noise_note 32, 7, 1, 0
	sound_ret

Vanilla crystal avoids this issue by playing MUSIC_NONE for one frame before starting the bike music

The following also works around the issue but i've yet to find the root cause

Music_Bicycle_Ch4:
-       toggle_noise 0
        drum_speed 12
        rest 16
+       toggle_noise 0
        rest 16
 Music_Bicycle_branch_ee34b:
        rest 2
ariscop added a commit to ariscop/polishedcrystal that referenced this issue Mar 28, 2023
...i think
ariscop added a commit to ariscop/polishedcrystal that referenced this issue Mar 28, 2023
...i think
@ariscop
Copy link
Author

ariscop commented Mar 28, 2023

Still not entirely clear what happens but setting NOTE_REST (16afa85 ) seems to make it behave

With that set, UpdateChannels actually makes it to .ch4_rest and clears the currently playing note, otherwise it jumps to .ch4_noise_sampling and writes garbage to the sound regs instead

ariscop added a commit to ariscop/polishedcrystal that referenced this issue Apr 5, 2023
...i think
itsdarsh pushed a commit that referenced this issue May 17, 2023
* Remove useless rNR52 writes

Lower 4 bits are read-only, and its attempting to duplicate what
wSoundOutput already does

* Misc changes

bc isn't in use during InitSound
Moved a comment
SOUND_CHANNEL_ON doesnt need to be reset before ChannelInit

* Don't count rest notes as noise hits

* Fixes #837

...i think

* Don't call ReloadWaveform from the music player

Does not actually work. Writes are ignored since the dac is on

* Change waveform loading for audio channel 3

Only reloads as needed now to avoid turning off the dac

Also doesn't bother writing rNR31 as its value is ignored anyway

* Combine DutyCycle and SFXDutyCycle

Has the neat side effect of making duty cycle patterns visible in
the music player

* duty_cycle changes in hgss/ceruleancity

Removes some redundant commands and restores dummied out
duty_cycle_pattern calls

* Apply mono/stereo option once when writing rNR51

Removes a few places mono/stereo take different code paths, and
allows changing between them without restarting the music
nickjwilde pushed a commit to nickjwilde/polishedcrystal that referenced this issue Jul 7, 2023
* Remove useless rNR52 writes

Lower 4 bits are read-only, and its attempting to duplicate what
wSoundOutput already does

* Misc changes

bc isn't in use during InitSound
Moved a comment
SOUND_CHANNEL_ON doesnt need to be reset before ChannelInit

* Don't count rest notes as noise hits

* Fixes Rangi42#837

...i think

* Don't call ReloadWaveform from the music player

Does not actually work. Writes are ignored since the dac is on

* Change waveform loading for audio channel 3

Only reloads as needed now to avoid turning off the dac

Also doesn't bother writing rNR31 as its value is ignored anyway

* Combine DutyCycle and SFXDutyCycle

Has the neat side effect of making duty cycle patterns visible in
the music player

* duty_cycle changes in hgss/ceruleancity

Removes some redundant commands and restores dummied out
duty_cycle_pattern calls

* Apply mono/stereo option once when writing rNR51

Removes a few places mono/stereo take different code paths, and
allows changing between them without restarting the music
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant