Changes

SP0256 Voice Generator

132 bytes added, 21:49, 19 December 2010
* [[SP0256 Allophones]]
* [[SP0256 Pin-Outs]]
* [[SP0256 on Printer Port (DIY)]]
== Voice Generator==
The voice generator relies on the Amplitude, Pitch, F0..F5, and B0..B5 registers, which are processed like so:
Another important register is the Repeat counter, which indicates when the next opcode shall be executed (and which may then load new values into the above registers).
== Sample Rate and Repeat Timings==The SP0256 is (usually) driven by a 3.12MHz oscillator, and it uses 7bit PWM output. So the sample rate should be , which is clocked at 3.12MHz/2, to obtain a 10kHz sample rate, the chip issues some dummy steps with constant LOW level additionally to the 128steps needed for 7bit PWM, probably further divided by two:making it a total number of 156 steps per sample.
Sample Rate = 3.12MHz/256 2/156 = 1210.1875kHz 0kHz ;82.051ns 100us per sample
Which means one sample is 82.051ns 100us long, that value multiplied by 64 or 91 gives the following timings per repeat:
56.251ms 4ms per repeat (noise and pause), or 79.466ms 1ms per repeat (tone with pitch=91)
That (guessed/undocumented) samplerate does more or less match Note: Some speech interfaces have the specifications that say that (unwanted PWM-) noise is above 10kHzchip overclocked to 4MHz, resulting in higher pitch & sample rate, and that wanted pitch can be up to 5kHz. And the repeat shorter timings do more or less match as with the timings shown in the allophone listnormal 3.12MHz.
== Amplitude/Pitch/Repeat==
The 8bit amplitude register defines the volume in floating point form,
| | |
|________|________|________ __ Zero level PITCH
<-Pitch-> __ Amplitude level (-)
<--------repeat=3--------->
Note that (aside from noise) the AL2 ROM uses only one pitch value: 5Bh aka 91 decimal (meaning that all vowels are using the same base frequency, and they differ only by using different filter settings).
== Amplitude/Noise/Repeat==
Noise is activated when setting pitch=0. The timings are then same as when pitch=64, but instead of outputting HIGH and NULL levels, the hardware does now randomly output HIGH or LOW levels, for example, pitch=0 and repeat=5:
The exact random algorithm is unknown (probably some shift/xor stuff?), the random levels seem to be output on each sample (not only on the first sample of a repeat). Like normal pitch, the noise is passed to the 6 filters.
== Pause/Repeat==
The pause command sets amplitude=0. The timings are then same as when pitch=64, but the output is always NULL, for example, pause and repeat=5:
__ Amplitude level (+)
______________________________ __ Zero level PAUSE (SILENCE)
<-64-> __ Amplitude level (-)
<----------repeat=5---------->
Pause does reset the filters to 0, so the silence is not affected by filters.
== Digital Filters==
As shown above, the amplitude/pitch/noise output is passed through six digital filter stages (using the F0..F5 and B0..B5 registers), each stage looks like so:
Above shows only positive values for index 0..127. Values for index -1..-128 should be 0..-511, or maybe -9..-512.
[[Category:Music and sound]]
4,585
edits