    Bristol SID
    -----------

In release 0.40 bristol introduced a piece of code that emulated the Commodore
C64 6581 SID chip. The interface uses byte settings of the 31 chip registers to
be close to the original plus some floating point IO for extracting the audio
signal and configuring some analogue parameters and the 'softSID' is clocked
by the sample extraction process.

The chip uses integer maths and logic for the oscillators, ring mod, sync and
envelopes and emulates the analogue components of the 6581 with floating point
code, for the filter and S/N generation.

The oscillators will run as per the original using a single phase accumulator
and 16 bit frequency space. All the waveforms are extracted logically from the
ramp waveform generated by the phase accumulation. Sync and RingMod are also
extracted with the same methods. The noise generation is exor/add as per the
original however the noise signal will not degenerate when mixing waveforms.
The output waves are ANDed together. The bristol control register has an option
for Multi waveforms and when selected each oscillator will have its own phase
accumulator, can have a detune applied and will be mixed by summation rather
than using an AND function.

The envelope is an 8 bit up/down counter with a single gate bit. All the 4 bit
parameters give rates taken from the chip specifications including the slightly
exponential decay and release. Attack is a linear function and the sustain level
can only be decreased when active as the counter also refuses to count back up
when passed its peak.

The filter implements a 12dB/Octave multimode chamberlain filter providing LP,
BP and HP signals. This is not the best filter in the world however neither was
the original. An additional 24dB/Octave LP filter has been added, optionally 
available and with feedforward to provide 12/18dB signals. Between them the 
output can be quite rich.

The emulator provides some control over the 'analogue' section. The S/N ratio
can be configured from inaudible (just used to prevent denormal of the filter)
up to irritating levels. Oscillator leakage is configurable from none up to 
audible levels and the oscillator detune is configurable in cents although
this is a digital parameter and was not a part of the original.

Voice-3 provides an 8 bit output of its oscillator and envelope via the normal
output registers and the otherwise unused X and Y Analogue registers contain
the Voice-1 and Voice-2 oscillator output.

The bristol -sid emulator uses two softSID, one generating three audio voices
and a second one providing modulation signals by sampling the voice-3 osc and
env outputs and also by configuring voice-1 to generate noise to the output, 
resampling this noise and gating it from voice-3 to get sample and hold. This
would have been possible with the original as well if the output signal were
suitably coupled back on to one of the X/Y_Analogue inputs.

The emulator has several key assignment modes. The emulator is always just
monophonic but uses internal logic to assign voices. It can be played as a big
mono synth with three voices/oscillators, polyphonically with all voices either
sounding the same or optionally configured individually, and as of this release
a single arpeggiating mode - Poly-3. Poly-3 will assign Voice-1 to the lowest
note, voice-3 to the highest note and will arpeggiate Voice-2 through all other
keys that are pressed with a very high step rate. This is to provide some of
the sounds of the original C64 where fast arpeggiation was used to sounds 
chords rather than having to use all the voices. This first implementation 
does not play very well in Poly-3, a subsequent release will probably have a
split keyboard option where one half will arpeggiate and the other half will
play notes.

This is NOT a SID player, that would require large parts of the C64 to also be
emulated and there are plenty of SID players already available.

Bristol again thanks Andrew Coughlan, here for proposing the implementation of
a SID chip which turned out to be a very interesting project.
