bbbradsmith / nsfplay

Nintendo NES sound file NSF music player
https://bbbradsmith.github.io/nsfplay/
277 stars 42 forks source link

Sunsoft 5B Envelope Emulation Inaccuracies #43

Closed N-SPC700 closed 3 years ago

N-SPC700 commented 3 years ago

In j0CC-FamiTracker, the user can perform a trick widely used in current day AY music: The envelope half volume trick. By setting the tone registers to ultrasonic levels, the user is able to effectively "halve" the volume of the envelope. j0CC emulates this fine, as do Atari ST and ZX Spectrum emulators. However, it seems that NSFPlay doesn't support this trick, instead it just silences itself in an awkward manner. Issue #7 seems to reference this, albeit under PWM Envelope Volume Control (which makes little sense, since the 5B/AY/YM don't support PWM by default, although it can produce similar effects by mixing tone with envelope).

bbbradsmith commented 3 years ago

Yes, what you noticed in the roadmap is indeed this issue. (5B needs a rewrite, more or less.) I called it PWM because this effect is technically a 50% pulse width modulation of the envelope signal. It's not a variable PWM, just one fixed rate of it, but it's still a PWM in my view... but I don't care about the semantics of it much, I just needed to write it down in a way I can understand it.

Anyway, you're now the second person to ask about it. If you can make a clear NSF example for testing please attach it to this thread. I'm going to close the issue though just because it's already on the roadmap.

N-SPC700 commented 3 years ago

Since a good example is needed, I have made a short example NSF, which also includes the j0CC source module (for comparison):

envelope_half_volume.zip

bbbradsmith commented 3 years ago

Thanks.