SP0256-AL2 speech synthesis
chip
-allophones.bas
allophones.bas
Option Explicit ' --------------------------------------------------------------------------------------- ' This module setsup constants that function as mnemonics for the ' phoneme set in the sp0256. These values are taken directly from ' data sheet for the chip. The allophone denoted as "OR" in the ' spec is labeled "OR1" here, since OR would conflict with the ' compiler. ' ' This module also contains a set of initialization routines for placing ' various allophones into groups, such as long vowles or ' voiceless fricatives. The initialization routines are all called from ' one main initialization routine.
' Pauses public const P10ms as byte = 0 public const P30ms as byte = 1 public const P50ms as byte = 2 public const P100ms as byte = 3 public const P200ms as byte = 4
' Phonemes public const OY as byte = 5 public const AY as byte = 6 public const EH as byte = 7 public const KK3 as byte = 8 public const PP as byte = 9 public const JH as byte = 10 public const NN1 as byte = 11 public const IH as byte = 12 public const TT2 as byte = 13 public const RR1 as byte = 14 public const AX as byte = 15 public const MM as byte = 16 public const TT1 as byte = 17 public const DH1 as byte = 18 public const IY as byte = 19 public const EY as byte = 20 public const DD1 as byte = 21 public const UW1 as byte = 22 public const AO as byte = 23 public const AA as byte = 24 public const YY2 as byte = 25 public const AE as byte = 26 public const HH1 as byte = 27 public const BB1 as byte = 28 public const TH as byte = 29 public const UH as byte = 30 public const UW2 as byte = 31 public const AW as byte = 32 public const DD2 as byte = 33 public const GG3 as byte = 34 public const VV as byte = 35 public const GG1 as byte = 36 public const SH as byte = 37 public const ZH as byte = 38 public const RR2 as byte = 39 public const FF as byte = 40 public const KK2 as byte = 41 public const KK1 as byte = 42 public const ZZ as byte = 43 public const NG as byte = 44 public const LL as byte = 45 public const WW as byte = 46 public const XR as byte = 47 public const WH as byte = 48 public const YY1 as byte = 49 public const CH as byte = 50 public const ER1 as byte = 51 public const ER2 as byte = 52 public const OW as byte = 53 public const DH2 as byte = 54 public const SS as byte = 55 public const NN2 as byte = 56 public const HH2 as byte = 57 public const OR1 as byte = 58 public const AR as byte = 59 public const YR as byte = 60 public const GG2 as byte = 61 public const EL as byte = 62 public const BB2 as byte = 63
' --------------------------------------------------------------------------------------- ' Phoneme array initialization subroutines. ' The phonemes in the sp0256 can be grouped into eight groups: ' Short + Long Vowels, Resonants, Voiced and Voiceless Fricatives ' (including affricatives), Voiced and Voiceless Stops, and Nasals ' There is also a group of R-Colored Vowels. ' ' The subroutines below initialize byte arrays representing each group. ' The subroutine InitializePhonemeArrays calls each other ' initialization routine. ' public const ShortVowelArrayLength as byte = 7 public const LongVowelArrayLength as byte = 9 public const ResonantArrayLength as byte = 6 public const VoicedFricativeArrayLength as byte = 5 public const VoicelessFricativeArrayLength as byte = 8 public const VoicedStopArrayLength as byte = 7 public const VoicelessStopArrayLength as byte = 6 public const NasalArrayLength as byte = 4 public const RColoredArrayLength as byte = 6
public sub InitializePhonemeArrays() call InitializeShortVowelArray() call InitializeLongVowelArray() call InitializeResonantArray() call InitializeVoicedFricativeArray() call InitializeVoicelessFricativeArray() call InitializeVoicedStopArray() call InitializeVoicelessStopArray() call InitializeNasalArray() call InitializeRColoredArray() end sub
private sub InitializeShortVowelArray() ShortVowelArray(1) = IH ShortVowelArray(2) = EH ShortVowelArray(3) = AE ShortVowelArray(4) = UH ShortVowelArray(5) = AO ShortVowelArray(6) = AX ShortVowelArray(7) = AA end sub
private sub InitializeLongVowelArray() LongVowelArray(1) = IY LongVowelArray(2) = EY LongVowelArray(3) = AY LongVowelArray(4) = OY LongVowelArray(5) = UW1 LongVowelArray(6) = UW2 LongVowelArray(7) = OW LongVowelArray(8) = AW LongVowelArray(9) = EL end sub
private sub InitializeResonantArray() ResonantArray(1) = WW ResonantArray(2) = RR1 ResonantArray(3) = RR2 ResonantArray(4) = LL ResonantArray(5) = YY1 ResonantArray(6) = YY2 end sub
private sub InitializeVoicedFricativeArray() VoicedFricativeArray(1) = VV VoicedFricativeArray(2) = DH1 VoicedFricativeArray(3) = DH2 VoicedFricativeArray(4) = ZZ VoicedFricativeArray(5) = ZH end sub
private sub InitializeVoicelessFricativeArray() VoicelessFricativeArray(1) = FF VoicelessFricativeArray(2) = TH VoicelessFricativeArray(3) = SS VoicelessFricativeArray(4) = HH1 VoicelessFricativeArray(5) = HH2 VoicelessFricativeArray(6) = WH VoicelessFricativeArray(7) = CH VoicelessFricativeArray(8) = JH end sub
private sub InitializeVoicedStopArray() VoicedStopArray(1) = BB1 VoicedStopArray(2) = BB2 VoicedStopArray(3) = DD1 VoicedStopArray(4) = DD2 VoicedStopArray(5) = GG1 VoicedStopArray(6) = GG2 VoicedStopArray(7) = GG3 end sub
private sub InitializeVoicelessStopArray() VoicelessStopArray(1) = PP VoicelessStopArray(2) = TT1 VoicelessStopArray(3) = TT2 VoicelessStopArray(4) = KK1 VoicelessStopArray(5) = KK2 VoicelessStopArray(6) = KK3 end sub
private sub InitializeNasalArray() NasalArray(1) = MM NasalArray(2) = NN1 NasalArray(3) = NN2 NasalArray(4) = NG end sub
private sub InitializeRColoredArray() RColoredArray(1) = ER1 RColoredArray(2) = ER2 RColoredArray(3) = OR1 RColoredArray(4) = AR RColoredArray(5) = YR RColoredArray(6) = XR end sub
|