9

The SID has various registers that are described as 16 linear steps: The Filter Volume, The Filter Resonance, and the Sustain of the voice envelopes.

The SUSTAIN levels range from zero to peak amplitude in 16 linear steps, with a SUSTAIN value of 0 selecting zero amplitude and a SUSTAIN value of 15 (#F) selecting the peak amplitude.

A SUSTAIN value of 8 would cause Voice 1 to SUSTAIN at an amplitude one-half the peak amplitude reached by the ATTACK cycle.

Now, maybe I'm bad a math, but I can't make those numbers work if I try to translate them to a 0-100% scale: If I divide 100 by 16, I get 6.25. That's a nice number because the value 8 would be exactly 50% (8 * 6.25).

But the maximum value of the register is 15 (0xF), and 15 * 6.25 only comes out to 93.75%, not to 100%.

If I divide 100 by 15, I get steps of 6.66666..., and a value of 8 gives me 53.33333...% - but the value of 15 gives me 100% as expected.

Is the 6.66...% per step correct, and the "8 equals half the maximum value" is just an approximation in the datasheet? Or did they do something special to make a value of 8 be exactly 50% and just fudge the steps around a bit? Or am I missing something obvious?

100/16 100/15
0 0 % 0 %
1 6.25 % 6.67 %
2 12.5 % 13.33 %
3 18.75 % 20 %
4 25 % 26.67 %
5 31.25 % 33.33 %
6 37.5 % 40 %
7 43.75 % 46.67 %
8 50 % 53.33 %
9 56.25 % 60 %
10 62.5 % 66.67 %
11 68.75 % 73.33 %
12 75 % 80 %
13 81.25 % 86.67 %
14 87.5 % 93.33 %
15 93.75 % 100 %
5
  • 1
    This is a difference of about 0.3 dB, which (by my admittedly superficial, non-blind ad-hoc testing) is barely perceptible, so this being an approximation seems quite probable. Also, I think there is a Spın̈al Tap joke hiding somewhere in here… who’s to say the 93.75% isn’t the ‘real’ 100%? (Okay, fine, if it’s compared to the attack amplitude, then there is a meaningful point of comparison. Still…) Dec 2, 2022 at 10:56
  • 2
    @user3840170: Actually, I wouldn't be surprised if a sustain value of 15 yields a value slightly short of the peak attack amplitude. I'd trust experimental measurements or an analysis of the die photo far more than I'd trust the documentation.
    – supercat
    Dec 2, 2022 at 22:07
  • @supercat Yeah, I got hung up a bit on the documentation mentioning 8 being half and the numbers working out beautifully with 6.25 except for that pesky 100% value :) Dec 2, 2022 at 22:21
  • @MichaelStum: I thought the SID was great back in the day, but often wished it had provided a means by which programmers could set the volume of a voice instantly. Having to have each voice ramp up to a non-configurable maximum volume was an annoying limitation which seems rather needless.
    – supercat
    Dec 2, 2022 at 22:30
  • 1
    @supercat Agreed that this should be settled by an oscilloscope, or at least a digital audio recorder. Dec 3, 2022 at 9:45

1 Answer 1

10

0 represents 0% and 15 represents 100%, so 100%/15 ≈ 6.67% per step is correct. You've got 16 values (0..15), encompassing only 15 intervals.

5
  • 6
    The basic fence-post error in reverse. Dec 2, 2022 at 12:39
  • 1
    Also the basic "I only have 10 fingers" problem :)
    – Brian H
    Dec 2, 2022 at 22:32
  • What does this answer add over the analysis already found within the question body? Dec 3, 2022 at 21:02
  • @user3840170 It provides an answer. The question was is it A or B?
    – Zac67
    Dec 3, 2022 at 21:04
  • Based on what? Why would not the other thing be the answer? Dec 4, 2022 at 12:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .