Date : Fri, 21 May 2004 17:36:49 +0100
From : Richard Gellman <splodge@...>
Subject: Re: Sound wave representation / Goldie Lookin' Chain
Charles Ripperton wrote:
>>>Yep, thats correct. You will need to set the pitch to its highest
>>>value, which is so ridiculously high that nobody can actually hear
>>>it. This causes a "half position" on the speaker cone, which can
>>>then be varied by adjusting the attentuation values (the chip
>>>works inversely, having 0 as "full volume" and 15 as
>>>"infinite attentuation").
>>>
>>>
>>In terms of nybbles :-
>>
>>0000="full volume"
>>.
>>.
>>.
>>1111="infinite attentuation"
>>
>>
>>I'm not sure I follow, since in my mind there are two 'full volume'
>>values (i.e. maximum positive, and maximum negative amplitudes)?
>>
>>Am I asking a silly question? :/ :)
>>
>>
>
>
>Hi all,
>
>Could someone clear up that question, please? How are 'two' volumes
>(the negative and the positive) described in nybbles?
>
>Thanks,
>Charles
>
>
>
*cranks handle on projector*
Ok, the sound chip has a backwards volume system for each channel.
Rather than "how loud is this?" it refers to "How much quieter than
normal is this?".
A nybble (four bits) of the amplitude register is used to set this
attenuation value. This is why a humble beeb makes that low rapsing
sound on start-up. Since all registers are set to 0, thats a pitch of 0
(low frequency) with no attenuation (full volume). The noise channel
isnt heard as a pitch value of 0 equates to "no noise".
The confusion is arising because of the suggestion of superimposing a
waveform onto this system. The values used in the attentuation are
stepped evenly, so if you use the values 0 to 14 (i.e. excluding 15)
you get 15 evenly spaced amplitudes.
(Still with me?)
Now, a wave form requires a "zero-point" in order to have negative
amplitude. We are forcing the speaker cone to a half point by settings
it pitch impossily high. The human ear can't hear this so ignores it
(the same as if you put a DC voltage into a speaker). By varying the
amplitude of the channel, we can move the distance from the speaker of
the half-point. This allows us to generate the waveform.
If we now assume our waveform has a low resolution, with peak to peak
being from -7 to +7, then we can superimpose that onto our
"postive-only" values by subtracting 7 and then getting the absolute
(negative -> positive) result.. Thus +7 less 7 becomes 0, i.e. full
volume. +6 becomes -1, absolute is 1, becomes attentuation level 1, i.e.
slightly quieter than full volume.
At the opposite end of the scale, -7 subtract 7 becomes -14. Absolute is
+14, i.e. quietest level (one short of "channel off").
This puts the "zero point" as being a chip attentuation value of
abs(0-7) = 7.
With all this knowledge to hand one can put together a speedy piece of
machine code to vary the amplitudes of the half-point and produce
digital audio.
*switches off projector*
Clear? :)
-- Richard