Links

An investigation into the behaviour of the Yamaha OPL3 chipset.
With a view to a more accurate emulator

Re: Links

Postby carbon14 » Tue May 22, 2012 8:33 am

Attenuation lookup table.

I frequently refer to this lookup table while I'm reviewing the data output from the data capture.

The first columns give the attenuation value in the inverse logarithmic form used throughout most of the calculations.
The result column gives the resultant waveform amplitude after the exponential conversion
+1 is that amplitude above the 16-bit midpoint 32768
+2 is twice that amplitude above the midpoint (useful for addititive synthesis mode CNT=1)
-1 is that amplitude below the midpoint
-2 is twice that amplitude below the midpoint
User avatar
carbon14
 
Posts: 124
Joined: Tue Aug 05, 2008 9:11 am
Location: York, England

Re: Links

Postby opl3 » Thu May 24, 2012 6:33 am

I use a similar table, but with a different negative amplitude. Usually I just compare captured values to values generated by software.

A sine wave and other applicable waveforms can have both positive and negative sign, even if the attenuation is so high that the output value is 0. In OPL, the positive zero is 0, and the negative zero is -1, because it is done as ones complement.

Thus, for example a square wave is either +4084 or -4085, in offset binary 36852 (0x8FF4) or 28683 (0x700B).

This is why sometimes some calculations seem wrong, if the assumption is that an operator always outputs 0 when it has high attennuation. But if the phase generator is running (phase increment is larger than 0), and the waveform has a negative part, then it will alternate between 0 and -1 accordingly. I solve that by selecting a waveform that only has positive sign. Attack speed of 0 will also keep that max attenuation so output keeps at 0.

That is also the noise that can be seen output from the chip when all notes are just turned off and set to high attenuation. There might be any number of channels having phase generators running and outputing 0 or -1. So to reset a chip into silent mode, every channel needs a note on-note off sequence which starts a zero frequency note with waveform that only has positive part and also the attack speed of 0 so the envelope will stay at max attenuation.
opl3
 
Posts: 55
Joined: Sun Sep 26, 2010 8:11 pm

Re: Links

Postby carbon14 » Sun May 27, 2012 9:37 am

That's a useful description of what's necessary to silence the chip. Thanks.
User avatar
carbon14
 
Posts: 124
Joined: Tue Aug 05, 2008 9:11 am
Location: York, England


Return to Yamaha OPL-3 research

Who is online

Users browsing this forum: No registered users and 10 guests

cron