Skip to content

Commit

Permalink
lower the volume on phonemes UHH-M, ERR-M, SHI-M
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel committed Aug 25, 2017
1 parent 338660d commit 28a45a8
Show file tree
Hide file tree
Showing 161 changed files with 363 additions and 454 deletions.
3 changes: 2 additions & 1 deletion Processing/Intonation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ public string GetPhonemesIntonation (string phoneme, string surroundingPhrase, b
{
if (surroundingPhrase.Length == Pronunciation.ALGORITHM_PHRASE_SIZE)
{
return DerivedIntonationChoice (phoneme, surroundingPhrase, sentenceEndInPhrase);
string choice = DerivedIntonationChoice (phoneme, surroundingPhrase, sentenceEndInPhrase);
return choice;
}

else
Expand Down
2 changes: 1 addition & 1 deletion Processing/Pronunciation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void FactoryReset()
currentResults.Add (SPACE); //avoids setting WordIsolator.LetterIndex in this scenario since an empty space cant reset it when needed.
}

if (OutputManager.IsDebugging == false)
if (OutputManager.IsDebugging == false) //debugger only checks that the correct phonemes were selected; doesnt care about intonation
{
bool sentenceIsEnding = (letterIndex >= sentence.Length - SENTENCE_END_ZONES_LENGTH) ? true : false;

Expand Down
9 changes: 9 additions & 0 deletions TO DO LIST.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ BROKEN WORDS
TO DO
================//
+ finish intonation for all voices
+ why am I injecting intonationtype into pronunciation?
+ Because I apply the intonation number inside pronunciation
+ Tasks objective is to select the right number to append to each phoneme.
First I have some settings when implementing task factory; basic stuff and not finalized until testing.
Then I have to make a selecting algorithm in gladosIntonation.
+ what was my previous work trying to achieve and do I agree with it?



+ fix everything :^)

+ add computer voice support?
Expand Down
31 changes: 28 additions & 3 deletions VoiceCode/GladosVoice/GLADOSVoice.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,35 @@
using SETextToSpeechMod.Processing;
using System;
using SETextToSpeechMod.Processing;
using SETextToSpeechMod.VoiceCode.GladosVoice;

namespace SETextToSpeechMod
{
public sealed class GladosVoice// : SentenceFactory
public sealed class GladosVoice : TimelineFactory
{
//public GladosVoice (SoundPlayer inputEmitter) : base(inputEmitter, new GladosIntonation()) { }
public GladosVoice (SoundPlayer inputEmitter) : base(inputEmitter, new GladosIntonation()) { }

public override int ClipLength
{
get
{
throw new NotImplementedException();
}
}

public override int SpaceSize
{
get
{
throw new NotImplementedException();
}
}

public override int SyllableSize
{
get
{
throw new NotImplementedException();
}
}
}
}
229 changes: 133 additions & 96 deletions VoiceCode/GladosVoice/GladosIntonation.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using SETextToSpeechMod.Processing;
using SETextToSpeechMod;
using SETextToSpeechMod.Processing;
using System;
using System.Collections.Generic;
using System.Linq;
Expand All @@ -7,102 +8,138 @@

namespace SETextToSpeechMod.VoiceCode.GladosVoice
{
class GladosIntonation// : Intonation
class GladosIntonation : Intonation
{
// protected virtual int smallSize { get { return 6; } }
//protected virtual int mediumSize { get { return 50; } }
//protected virtual int largeSize { get { return OutputManager.MAX_LETTERS; } }
//protected int[] allSizes;

//protected virtual int[][] smallIntonationPatterns { get; } //an intonation pattern should be designed to loop on itself. it can be any size.
//protected virtual int[][] mediumIntonationPatterns { get; }
//protected virtual int[][] largeIntonationPatterns { get; }
//protected int[][][] allPitchOptions;


//allSizes = new int[]
//{
// smallSize,
// mediumSize,
// largeSize,
//};

//allPitchOptions = new int[][][]
Random rng = new Random();
const string SPACE = " ";

int smallSize
{
get
{
return 6;
}
}

int mediumSize
{
get
{
return 50;
}
}

int largeSize
{
get
{
return OutputManager.MAX_LETTERS;
}
}

int[] allSizes;

protected virtual int[][] smallIntonationPatterns
{
get;
}

//an intonation pattern should be designed to loop on itself. it can be any size.
int[][] mediumIntonationPatterns
{
get;
}

int[][] largeIntonationPatterns
{
get;
}

int[][][] allPitchOptions;

int voiceRange
{
get
{
return 11;
}
}

public override string VoiceId
{
get
{
return "-G";
}
}

readonly int[][] smallOptions = new int[][]
{
new int[] { 0, 1, 2, },
};

readonly int[][] mediumOptions = new int[][]
{
new int[] { 0, 1, 2, },
};

readonly int[][] largeOptions = new int[][]
{
new int[] { 0, 1, 2, },
};
int[] intonationArrayChosen;

int[] ChoosePitchPattern(int sizeIndex)
{
for (int u = 0; u < allSizes.Length; u++)
{
//if (timeline.Count <= allSizes[u])
//{
// //ChoosePitchPattern (u);
//}

//else if (u == allSizes.Length - 1)
//{
// //ChoosePitchPattern (allSizes.Length - 1); //assuming the array is ordered from largest to smallest!
//}
}

int currentLimit = allPitchOptions[sizeIndex].Length;
int randomPattern = rng.Next(currentLimit);
int[] intonationArray = allPitchOptions[sizeIndex][randomPattern];
return intonationArray;
}

protected override string DerivedIntonationChoice(string phoneme, string surroundingPhrase, bool sentenceEndInPhrase)
{
string choice = VoiceId + SPACE;

//if (phoneme != SPACE)
//{
// smallIntonationPatterns,
// mediumIntonationPatterns,
// largeIntonationPatterns,
//};

//protected virtual int voiceRange { get; }



//protected void ChoosePitchPattern (int sizeIndex)
//{
// int currentLimit = allPitchOptions[sizeIndex].Length;
// int randomPattern = rng.Next (currentLimit);
// intonationArrayChosen = allPitchOptions[sizeIndex][randomPattern];
//}

//protected override int[][] smallIntonationPatterns { get { return smallOptions; } }
//protected override int[][] mediumIntonationPatterns { get { return mediumOptions; } }
//protected override int[][] largeIntonationPatterns { get { return largeOptions; } }

//protected override int voiceRange { get { return 11; } }

//readonly int[][] smallOptions = new int[][]
//{
// new int[] { 0, 1, 2, },
//};

//readonly int[][] mediumOptions = new int[][]
//{
// new int[] { 0, 1, 2, },
//};

//readonly int[][] largeOptions = new int[][]
//{
// new int[] { 0, 1, 2, },
//};

//public GLADOSVoice (SoundPlayer inputEmitter) : base (inputEmitter, new GladosIntonation()){}

//void AddIntonations (int timelineIndex)
//{
// string intonation = " ";

// if (timeline[timelineIndex].ClipsSound != SPACE)
// {
// if (intonationArrayChosen == null)
// {
// for (int u = 0; u < allSizes.Length; u++)
// {
// if (timeline.Count <= allSizes[u])
// {
// //ChoosePitchPattern (u);
// }

// else if (u == allSizes.Length - 1)
// {
// //ChoosePitchPattern (allSizes.Length - 1); //assuming the array is ordered from largest to smallest!
// }
// }
// }

// if (arraysIndex >= intonationArrayChosen.Length)
// {
// arraysIndex = 0;
// }

// if (intonationArrayChosen[arraysIndex] > voiceRange)
// {
// intonationArrayChosen[arraysIndex] = voiceRange;
// }
// intonation += intonationArrayChosen[arraysIndex];
// timeline[timelineIndex] = new TimelineClip (timeline[timelineIndex].StartPoint, timeline[timelineIndex].ClipsSound + intonation);
// arraysIndex++;
// }
//}
// if (intonationArrayChosen == null)
// {

// }

// else
// {
// ChoosePitchPattern();
// }

// if (arraysIndex >= intonationArrayChosen.Length)
// {
// arraysIndex = 0;
// }

// if (intonationArrayChosen[arraysIndex] > voiceRange)
// {
// intonationArrayChosen[arraysIndex] = voiceRange;
// }
// intonation += intonationArrayChosen[arraysIndex];
// timeline[timelineIndex] = new TimelineClip(timeline[timelineIndex].StartPoint, timeline[timelineIndex].ClipsSound + intonation);
// arraysIndex++;
//}
return choice;
}
}
}
Binary file modified bin/Debug/CommandLine.dll
Binary file not shown.
Binary file modified bin/Debug/HavokWrapper.dll
Binary file not shown.
Loading

0 comments on commit 28a45a8

Please sign in to comment.