SPC Gain Mode Decrease Types Question

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
SPC Gain Mode Decrease Types Question
by on (#139538)
So, if I understand this correctly, you can't get the decrease GAIN modes to be audible unless the voice is already playing something audible.. Amirite?

I think I'm right.. so let me ask another question.. What is so useful about GAIN modes? I've seen very few SPCs use it at all.

OH I get it.. You can design very fine ADSR / custom ADSR.. but you need to time the setting of the Gain modes and values with the playing of the sample... OK
Re: SPC Gain Mode Decrease Types Question
by on (#139612)
So what is the question you're asking ? I don't see the point of asking questions and answering them yourself, exept if you do it in a well-written pedagogical doccument, which you clearly aren't doing here.

When you key on a channel in gain mode, the enveloppe is normally at 0 because that's the value it was left off after KeyOff (the release phase makes the enveloppe decreasing very quickly). However, if you key on without keying off, or right after keying off in a way that didn't allow the release phase to make the enveloppe reach 0, then it will not be at 0.

And I don't know why the SPC allows both ADSR and GAIN control, this is similar to asking why the NES allow 8 sprites per line or why there is status flags in the 6502. However, this can be useful to not be limited to ADSR and allow other types of envelope control. You can also start in ADSR and then switch to gain after some amount of time, to get an extra effect with little effort, I have seen many music engines doing this. GAIN can also be useful to make a pause in ADSR when the game pauses (FF6 and Chrono Trigger does this, though they don't use GAIN otherwise).
Re: SPC Gain Mode Decrease Types Question
by on (#139638)
SNESMod uses gain.

I haven't seen much documentation that addresses the differet modes. Are there any advantages to using ADSR over gain?
Re: SPC Gain Mode Decrease Types Question
by on (#139674)
Augustus Blackheart wrote:
I haven't seen much documentation that addresses the differet modes. Are there any advantages to using ADSR over gain?

Techically speaking, the only advantage is that you can directly access a state machine without any hardware write, and it makes the software simpler that if the same state maching would have to be maintained in software.

It also makes very short attack or decay possible, that would be harder to do entierely in software because the software would have to be run fast enough to keep track of it (while playing music and sound effects).