Digitized sound + 2 spare channels possible?
Moderator: Moderators
-
- The Most Noble Order of Denial
- Posts: 343
- Joined: Fri May 01, 2009 4:44 pm
Digitized sound + 2 spare channels possible?
I was wondering if you set two channels up with the same frequency but 180 degrees out of phase with each other, would changing volume on both channels in tandem produce analogue levels?
Thus leaving 1 noise channel and 1 tone channel free for music?
Thus leaving 1 noise channel and 1 tone channel free for music?
- Mike
- Herr VC
- Posts: 4816
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
Unless you 'program' one of Viznut's new waveforms, the tone generators of the VIC output square waves. Two of them with the same frequency, but 180 degrees out of phase will cancel out each other completely. There's only one volume register which applies to all voices. So it's not quite clear to me how you'd been going to produce analogue levels.
You can de-tune two voices slightly (taking their octave difference into account), which results in a beat. The resulting amplitude envelope might suggest it should be possible to attenuate volume levels continuosly - but it's really only an aural illusion.
My bet's still on PCM over the volume register (as has been done with Sid Vicious, Berzerk MMX+ and Pulse Sounds).
You can de-tune two voices slightly (taking their octave difference into account), which results in a beat. The resulting amplitude envelope might suggest it should be possible to attenuate volume levels continuosly - but it's really only an aural illusion.
My bet's still on PCM over the volume register (as has been done with Sid Vicious, Berzerk MMX+ and Pulse Sounds).
-
- The Most Noble Order of Denial
- Posts: 343
- Joined: Fri May 01, 2009 4:44 pm
- Mike
- Herr VC
- Posts: 4816
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
They are simply added. However, with high values of the volume register and two or more voices activated, clipping might occur.
I remember experimenting with the same voice playback program for the c64 and I played it thru the voice register not the volume to see if it would work and it actually did?! Think Triangle or Square sounded best?
I just pumped the same 4 bit samples and even tried proper 8 bit as well - just experimenting with the program a little y'know?
It was thrilling to hear about 10 seconds of Star Wars 'fanfare' being played back on the Commy. Not too sure how the Vic would hold up but it can't hurt to play around and see.
I just pumped the same 4 bit samples and even tried proper 8 bit as well - just experimenting with the program a little y'know?
It was thrilling to hear about 10 seconds of Star Wars 'fanfare' being played back on the Commy. Not too sure how the Vic would hold up but it can't hurt to play around and see.
Learning all the time...
-
- The Most Noble Order of Denial
- Posts: 343
- Joined: Fri May 01, 2009 4:44 pm
I wish I could up-vote that link! It explains why you can play analogue levels by changing the volume register. Namely because "The voltage for the 0 state when stopped is somewhere between the low and high on states, not quite half way but biased slightly towards the low side. "Mike wrote:They are simply added. However, with high values of the volume register and two or more voices activated, clipping might occur.
What a lucky bug to have in the hardware.
I've updated my emulator code to correctly emulate that feature now (before it was hacked in).
Last edited by matsondawson on Fri Mar 23, 2012 7:28 pm, edited 1 time in total.
-
- The Most Noble Order of Denial
- Posts: 343
- Joined: Fri May 01, 2009 4:44 pm
Actually you may be able to get a little more precision doing DAC by...
1/ Assuming the four channels outputs when off sum to a relative value of 1.8 (4*0.45) once they reach the volume section, that would give us 0->27 in steps of 1.8
2/ Setting two channels 180 degrees out of phase then switching between them when they are at their MAXIMUM values to produce a 2.35 (1 + 3 * 0.45) to the volume register producing 0->35.25 in steps of 2.35
3/ Setting two channels 180 degrees out of phase then switching between them when they are at their MINIMUM values to produce a 1.35 (0 + 3 * 0.45) to the volume register producing 0->20.25 in steps of 1.35
The values I've picked are just relative to each other and not real values.
1/ Assuming the four channels outputs when off sum to a relative value of 1.8 (4*0.45) once they reach the volume section, that would give us 0->27 in steps of 1.8
2/ Setting two channels 180 degrees out of phase then switching between them when they are at their MAXIMUM values to produce a 2.35 (1 + 3 * 0.45) to the volume register producing 0->35.25 in steps of 2.35
3/ Setting two channels 180 degrees out of phase then switching between them when they are at their MINIMUM values to produce a 1.35 (0 + 3 * 0.45) to the volume register producing 0->20.25 in steps of 1.35
The values I've picked are just relative to each other and not real values.
-
- The Most Noble Order of Denial
- Posts: 343
- Joined: Fri May 01, 2009 4:44 pm
- Mike
- Herr VC
- Posts: 4816
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
Internally, the square wave sound generators are realised as 8-bit LFSR. When they're active, one bit is shifted out, inverted, output and inserted at the other end, at the rate programmed with the low 7 bits of the frequency register (and taking the octaves into account).
However, Viznut's new waveforms are exactly generated this way, by starting off with a purged LFSR and then quickly switching the voice at the highest frequency on and off for 8 times - and then changing to the desired frequency. So the sound generator doesn't anymore output '1111111100000000' but rather something like '1011110101000010'. Once the waveform is 'programmed', the frequency can be changed without problems, as long as the voice remains enabled.
When the enable bit is set to 0, only zeroes are output and inserted at the other end. This purges the LFSR within 8 steps.matsondawson wrote:I guess this all depends on whether the channels still generate a wave internally when they are off.
However, Viznut's new waveforms are exactly generated this way, by starting off with a purged LFSR and then quickly switching the voice at the highest frequency on and off for 8 times - and then changing to the desired frequency. So the sound generator doesn't anymore output '1111111100000000' but rather something like '1011110101000010'. Once the waveform is 'programmed', the frequency can be changed without problems, as long as the voice remains enabled.
-
- The Most Noble Order of Denial
- Posts: 343
- Joined: Fri May 01, 2009 4:44 pm
- pixel
- Vic 20 Scientist
- Posts: 1330
- Joined: Fri Feb 28, 2014 3:56 am
- Website: http://hugbox.org/
- Location: Berlin, Germany
- Occupation: Pan–galactic shaman
Re:
This is odd. The noise generator doesn't look very different on the die shot at http://visual6502.org/images/pages/MOS_ ... shots.htmlMike wrote:That's the noise generator.matsondawson wrote:In the VICE source it has a 1024 x 8 bit lookup (8192 bits), which suggests a 13bit LFSR.
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
https://github.com/SvenMichaelKlose