login

online now

We have 76 guests and no members online

search

 
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Speech through serial comm

Speech through serial comm 4 years 4 months ago #352

I've set up a nice little frontend similar to tweaker, but with the ability to take a midi in. Everything works great but im having a heckuhva time getting speech trigger via serial command. Hoping someone can point me in the right direction
Last Edit: 4 years 3 months ago by administrator.
The administrator has disabled public write access.

Re: Speech through serial comm 4 years 4 months ago #353

It could be a problem in quite a few areas. Are you getting other sounds to function OK?
The administrator has disabled public write access.

Re: Speech through serial comm 4 years 4 months ago #354

Yep. I'm basically reverse engineering the tweaker program, but looking at the IC datasheet and the tweaker program, I cant find the serial commands to actually load phonemes.
The administrator has disabled public write access.

Re: Speech through serial comm 4 years 4 months ago #355

If you take a look at GinSingDefs.h, you'll find the allophone codes enumerated; that should hopefully save you some time and effort. The other thing that might help is to take a look at the GinSingVoice.cpp file. I have included the speak() method here to give you an idea of how its done in the library. The basic concept is to set the speech control register (129) with the allophone you wish to speak. the timing associated with each allophone is described in the datasheet that should help you avoid overruns, or you can check the status pin on the return to make sure the chip is ready for the next allophone.

From GinSingDefs.h:


// GSAllophone - synthesized voice phonemes morphed over time
//

enum GSAllophone
{
// inflections - these can preceed any phoneme, and are applied on the single subseuqent phoneme
// to use inflection over a larger span you can set the frequency and/or speed

_SPEEDUP = 1 , /* speed up */
_SPEEDDN = 2 , /* slow down */
_VOLUP = 3 , /* increase volume */
_VOLDN = 4 , /* decrase volume */
_PITCHUP = 5 , /* increase pitch */
_PITCHDN = 6 , /* decrase pitch */
_BENDUP = 7 , /* pitch bend up */
_BENDDN = 8 , /* pitch bend down */


// phonemes that create the words - these (along with inflections) are set into an array that uses _ENDPHRASE to terminate the sequence

_A = 192 , /* hat, fast, fan */ _AA = 193 , /* father, fall */ _AE = 194 , /* gate, ate, ray */
_AIR = 195 , /* hair, stair, repair */ _AU = 196 , /* hot, clock, fox */ _BE = 197 , /* bear, bird, bead */
_BO = 198 , /* bone, book, brown */ _EB = 199 , /* cab, crib, web */ _OB = 200 , /* bob, sub, tub */
_CH = 201 , /* church, feature, march */ _DE = 202 , /* deep, date, divide */ _DO = 203 , /* do, dust, dog */
_ED = 204 , /* could, bird */ _OD = 205 , /* bud, food */ _E = 206 , /* met, check, red */
_EE = 207 , /* see, even, feed */ _ER = 208 , /* fir, bird, burn */ _F = 209 , /* food, effort, off */
_GE = 210 , /* get, gate, guest */ _GO = 211 , /* got, glue, god */ _HE = 212 , /* help, hand, hair */
_HO = 213 , /* hoe, hot hung */ _I = 214 , /* sit, fix, pin */ _IE = 215 , /* mice, fight, white */
_J = 216 , /* dodge, jet, savage */ _KE = 217 , /* can't, clown, key */ _KO = 218 , /* comb, quick, coast */
_EK = 219 , /* speak, task */ _OK = 220 , /* ook, took, october */ _LE = 221 , /* lake, alarm, lapel */
_LO = 222 , /* clock, plus, hello */ _M = 223 , /* milk, famous, broom */ _NE = 224 , /* nip, danger, thin */
_NO = 225 , /* no, snow, on */ _NGE = 226 , /* think, ping */ _NGO = 227 , /* hung, song */
_OE = 228 , /* go, hello, snow */ _OI = 229 , /* boy, toy, voice */ _OO = 230 , /* book, could, should */
_OU = 231 , /* our, ouch, owl */ _OR = 232 , /* corn, four, your */ _PE = 233 , /* people, computer */
_PO = 234 , /* pow, copy */ _R = 235 , /* ray, brain, over */ _SE = 236 , /* see, vest, plus */
_SO = 237 , /* so, sweat */ _SH = 238 , /* ship, fiction, leash */ _T = 239 , /* part, little, sit */
_TH = 240 , /* thin, month */ _THH = 241 , /* there, that, this */ _TS = 242 , /* parts, costs, robots */
_U = 243 , /* luck, jump, plus */ _UE = 244 , /* food, june */ _V = 245 , /* vest, even, twelve */
_W = 246 , /* wool, sweat */ _Y = 247 , /* yes, yard, million */ _Z = 248 , /* zoo, zap */
_ZH = 249 , /* azure, treasure */ _PA0 = 250 , /* 12 milliseocond pause */ _PA1 = 251 , /* 48 millisecond pause */
_PA2 = 252 , /* 62 millisecond pause */ _FD0 = 253 , /* 1 millisecond delay */ _FD1 = 254 , /* 100 millisecond delay */
_FD2 = 255 , /* 600 millisecond delay */

_ENDPHRASE = 0 , /* terminate a string of allphones */



};




From GinSingVoice.cpp:


//
// speak - send a series of speech fragments (allophones) to the sound chip
//

void GinSingVoice::speak ( GSAllophone *allophoneList )
{
// write allophone bytes until we hit a zero

while ( (*allophoneList) != _ENDPHRASE )
{
ubyte dataByte = (*allophoneList);


// the byte may be an inflection - if so build the inflection register byte

if ( dataByte < _A )
{
switch ( dataByte )
{
case _SPEEDUP : _inflection |= SC_SpeedUpBit; break;
case _SPEEDDN : _inflection |= SC_SpeedDownBit; break;
case _VOLUP : _inflection |= SC_VolumeUpBit; break;
case _VOLDN : _inflection |= SC_VolumeDownBit; break;
case _PITCHUP : _inflection |= SC_PitchUpBit; break;
case _PITCHDN : _inflection |= SC_PitchDownBit; break;
case _BENDUP : _inflection |= SC_BendUpBit; break;
case _BENDDN : _inflection |= SC_BendDownBit; break;
default : break;
};
}

// if its not an inflection write the allophone and set the speech control register as needed

else
{
if ( _inflection )
{
gsPtr->sendCommand ( WriteOneByte , SpeechControl , _inflection ); _inflection = 0;
}

gsPtr->getSerial()->write ( (*allophoneList) );

}

allophoneList++;
}
}

Last Edit: 4 years 4 months ago by administrator.
The administrator has disabled public write access.

Re: Speech through serial comm 4 years 4 months ago #356

Awesome! Thanks.

so basically the command I'm sending now looks like this:


(27 129 232 0)
(1B 81 E8 00)

When I send this I don't get any output. If i take out the 00, then it plays but wont stop.

Other than that its working great.
The administrator has disabled public write access.

Re: Speech through serial comm 4 years 3 months ago #357

Sorry for the delayed response, when I first read it I missed the statement about it playing but not stopping. Some sounds are designed to play continuously, such as the "oo" sound to make the speech duration more under control. There are two ways that you can change this:

1. Run your own time based on the typical sound durations in the datasheet, or
2. Read the serial ready line, which will let you know when the chip has timed out the sound, although this can be pretty fast.

The GinSing uses both of these mechanisms internally to control the allophone timing, but you should be able to come up with your own mechanism if you're using the chip w/o the library.
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 0.183 seconds