PSG Envelopes

Page 1/2
| 2

Par PingPong

Prophet (4094)

Portrait de PingPong

09-03-2021, 00:19

Hi, all i've a question about the env gen.
Suppose that there is a channel whose volume is set up to say, at level 12.
Now, suppose i set the envelope for this channel. Also suppose i've setup a sawtooth env.
After setting the env what is the amplitude level?
a) it drops from 12 to 0 then increase to max
b) it increase from 12 to max then drop and recyle from 0

How does the psg affects (if they do) situations (a) or (b)?

Also, setting the env for more than one channel does some kind of restart in the amplitude modulation cycle?

!login ou Inscrivez-vous pour poster

Par Grauw

Ascended (10707)

Portrait de Grauw

09-03-2021, 01:11

The maximum envelope generator volume can not be controlled, it always goes to 15. The volume bits are ignored when you set the envelope enable bit.

The envelope shape register bits determine whether it starts from the top or the bottom. Setting this register also triggers the envelope. The bit in the volume register only selects whether it controls the volume, it does not trigger it, there’s only one envelope generator with one counter after all.

Personally, I think the EG is mostly useful for use at audio rates to produce tones. The envelope patterns it supports are a bit limited at normal LFO rates. You can implement more flexible ADSR envelopes by controlling the volume manually on a 60 Hz interrupt (in assembly at least).

Par PingPong

Prophet (4094)

Portrait de PingPong

09-03-2021, 01:41

thx, clear and demotivating explanation.
having three env gen and the ability to interact with volume controls would have made psg more appealing, i know there is a psg improvement with three env gens, and other useful features,

Par Grauw

Ascended (10707)

Portrait de Grauw

09-03-2021, 02:31

What can I say, the AY-3-8910 is a primitive sound chip developed in 1978 for a specific price point. Sound chips were in their infancy. Competitors like the SN76489 (1980) don’t even have one at all. At least it gives us access to different waveforms, even though that was not its original intent.

Any envelope generator is in principle not super useful since the CPU can implement its own volume control at LFO rates, which will always be more flexible than what the hardware provides. So you don’t need them. Except on the OPLL, since the CPU does not have access to the modulator level. And on the PSG, because it can modulate into audio frequencies.

Par PingPong

Prophet (4094)

Portrait de PingPong

09-03-2021, 08:18

your point is an interesting point. Basically you say "You do not need env gen because CPU can do the same in a more flexible way with little power".
Another chip that have some kind of "automated" volume control is the C64's SID with it's ADSR. Do you think basically the same for ADSR?

Par Sandy Brand

Champion (295)

Portrait de Sandy Brand

09-03-2021, 10:28

I think there are tricks you can pull off to sort of 'control' the volume level.

For example, with a sawtooth shape, start the generator with a 'short' envelope period and then half-way through the period just change the envelope period to something much longer and 'drag it out' so to say.

But yeah, it is not super useful.

Par Grauw

Ascended (10707)

Portrait de Grauw

09-03-2021, 10:57

PingPong wrote:

Another chip that have some kind of "automated" volume control is the C64's SID with it's ADSR. Do you think basically the same for ADSR?

Yes, although ADSR is more useful for modeling instruments, there are more complex patterns possible with the CPU, and I would say any serious tracker will let you to specify those precisely with “instrument macros” or whatever they are called.

The primary benefit of envelope generators is to reduce the load on the CPU, to fire-and-forget sounds. However for 3-channel sound chips that benefit is imo not much. (As opposed to FM chips which have many operators and require I/O waits.)

Par sd_snatcher

Prophet (3645)

Portrait de sd_snatcher

10-03-2021, 14:46

Grauw wrote:

At least it gives us access to different waveforms, even though that was not its original intent.

Are you aware that you can use the envelope generator to generate different waveforms on the PSG, right? Wink

It wasn't also meant for that, but if the DCSG is going to be considered capable of generating different waveforms, then the PSG also is.

Par Grauw

Ascended (10707)

Portrait de Grauw

10-03-2021, 18:53

Yes, in that sentence “it” was referring to the PSG EG Smile. I mention it in my prior post.

Par aoineko

Paladin (888)

Portrait de aoineko

08-01-2022, 19:38

Hello,
I have a question about the PSG envelope so I take the liberty of recyling this thread.
When you disable Tone and Noise on a channel, but leave the envelope activation flag on, there is a glitchy sound that can keeps playing.
Is this a known problem?
I think I read something about this at a time when I didn't understand anything about PSG, but now I can't find the info.
I know that leaving the envelope on when you turn off the Tone and Noise doesn't make much sense, but as I'm working on the sound part of my C library, I'd like to be sure that this is the expected behavior.
I made a test program: https://webmsx.org/?ROM=https://github.com/aoineko-fr/CMSX/r...
I haven't tried it on a real MSX yet, but the behavior is the same on all the emulators I tested.

Par Grauw

Ascended (10707)

Portrait de Grauw

08-01-2022, 19:59

Hey aioneko, when the tone and noise are disabled in the mixer it makes their output is 1 permanently. So the envelope still affects the volume, and that can be used to generate saw & triangle-ish tones actually (using very high envelope frequencies). But anyway, normally to mute channels you would set the volume to 0 instead of turning off the tone channels in the mixer.

Page 1/2
| 2