Awuwunya / AMPS

Ample Music Playback System development project
Apache License 2.0
23 stars 1 forks source link

PSG ADSR #12

Open Awuwunya opened 4 years ago

Awuwunya commented 4 years ago

ADSR (Attack, Decay, Sustain, Release) is simplified form of how FM voices operate regarding volume. This allows for more control over how the notes sound, and indeed would help PSG sound a little more natural while also allowing Volume Envelopes be used for more complex effects on top of that. This feature would make it possible to also have PSG do a more natural fade-out after a note is released.

sikthehedgehog commented 4 years ago

Echo already has an envelope format for PSG… though it needs the whole envelope slope to be included and it lacks the release part (I really need to get around doing that some day — byte values $F0~$FD are still free for extensions) https://plutiedev.com/format-eef

Probably more important though, it's not just a volume envelope but also a pitch envelope. It's not that big of a deal with FM where you have a lot to toy with, but with PSG they're pretty much a must (and if you look at the 8-bit Sonic games they rely on this a lot). One obvious example of an instrument that benefits from this is a whistle. https://plutiedev.com/psg-whistle

Again, the pitches available are… kinda questionable (when I asked for comments nobody said anything, and only after I froze the format and pushed the feature I got people complain about it, ugh). Considering using one of the free values as a prefix for arbitrary pitches >_>

In any case you may want to consider pitch envelopes for PSG alongside volume envelopes.

Awuwunya commented 4 years ago

The way your PSG envelopes are similar to how volume and modulation envelopes work in AMPS. I have a prototype of this feature which instead uses few parameters, and the engine works out the envelope itself completely through. This way, the user doesn't need to worry about as much details and although there is less control from the user, more features can be implemented (such as release, and notes that don't fully decay). I won't release a lot of info yet, but safe to say its an additional layer on top of the pre-existing envelopes!