Page 1 of 1

Key Scale Level

PostPosted: Wed Oct 19, 2011 12:54 pm
by carbon14
The effects of KSL are not well documented in the OPL3 datasheet. But it is better documented in the OPL4 application guide.

NTS which has an effect on the behaviour of KSR has no effect on KSL.

KSL adds an attenution to the note which depends on the values of BLOCK, F-NUM and KSL itself. According to the OPL4 application guide, it's the 4 msb of F-NUM which matter. I have not exhaustively proven that this is the case on the OPL3, but I see no reason why it should differ. Certainly my results so far seem consistent between the documented behaviour of the OPL4 and the real-world behaviour of the OPL3

Re: Key Scale Level

PostPosted: Wed Oct 19, 2011 4:04 pm
by carbon14
Edited to correct lookup values

So, I have a basic principle here, but I've yet to determine quite the way to implement it.

Taking the BLOCK Value and multiplying by 8 gives me a starting point. If I use the 4 msb of F-NUM I can derive a lookup value to subtract from this starting point.

lookup values for 4msb F-NUM 0 ... 15 (56,32,24,19,16,13,11,9,8,6,5,4,3,2,1,0)

I have to clamp the subtraction avoid going negative

All of which gives me an attenuation that I can add for the damping. This value should be multiplied up by 16 to give the KSL=1 3db/octave damping, or by 8 for KSL=2 or by 32 for KSL=3

I'm sure I don't want a lookup, but I can't yet see where those values can be derived. (The first value of 56 may be spurious, because the damping is always 0 for 0 <= F-NUM < 64