Skip to content

Commit

Permalink
v0.3.7 8 sync parameter support
Browse files Browse the repository at this point in the history
  • Loading branch information
VRCWizard authored May 13, 2022
1 parent 441868a commit a2b17c8
Show file tree
Hide file tree
Showing 4 changed files with 181 additions and 101 deletions.
139 changes: 77 additions & 62 deletions OutputText.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,23 @@ public async void outputVRChat(VoiceWizardWindow MainForm, string textstring)
float letterFloat1 = 0;
float letterFloat2 = 0;
float letterFloat3 = 0;
float letterFloat4 = 0;
float letterFloat5 = 0;
float letterFloat6 = 0;
float letterFloat7 = 0;

var message1 = new SharpOSC.OscMessage("/avatar/parameters/KAT_Pointer", 255);
var message2 = new SharpOSC.OscMessage("/avatar/parameters/KAT_CharSync0", letterFloat0);
var message3 = new SharpOSC.OscMessage("/avatar/parameters/KAT_CharSync1", letterFloat1);
var message4 = new SharpOSC.OscMessage("/avatar/parameters/KAT_CharSync2", letterFloat2);
var message5 = new SharpOSC.OscMessage("/avatar/parameters/KAT_CharSync3", letterFloat3);

var message6 = new SharpOSC.OscMessage("/avatar/parameters/KAT_CharSync4", letterFloat4);
var message7 = new SharpOSC.OscMessage("/avatar/parameters/KAT_CharSync5", letterFloat5);
var message8 = new SharpOSC.OscMessage("/avatar/parameters/KAT_CharSync6", letterFloat6);
var message9 = new SharpOSC.OscMessage("/avatar/parameters/KAT_CharSync7", letterFloat7);



var message0 = new SharpOSC.OscMessage("/avatar/parameters/KAT_Visible", true);
sender2.Send(message1);
Expand Down Expand Up @@ -184,8 +194,8 @@ public async void outputVRChat(VoiceWizardWindow MainForm, string textstring)
case '~': letter = 94; break;
case '€': letter = 95; break;

case '非': letter = 96; break;//trying to map
case '常': letter = 97; break;//trying to map
/// case '非': letter = 96; break;//trying to map
// case '常': letter = 97; break;//trying to map
// case '': letter = 98; break;
//case '': letter = 99; break;

Expand Down Expand Up @@ -433,64 +443,7 @@ public async void outputVRChat(VoiceWizardWindow MainForm, string textstring)
}
letter = letter / 127;

/* switch (c)
{
case 'a': letter = 0.511811f; break;
case 'b': letter = 0.51968503f; break;
case 'c': letter = 0.52755904f; break;
case 'd': letter = 0.53543305f; break;
case 'e': letter = 0.54330707f; break;
case 'f': letter = 0.5511811f; break;
case 'g': letter = 0.5590551f; break;
case 'h': letter = 0.56692916f; break;
case 'i': letter = 0.5748032f; break;
case 'j': letter = 0.5826772f; break;
case 'k': letter = 0.5905512f; break;
case 'l': letter = 0.5984252f; break;
case 'm': letter = 0.6062992f; break;
case 'n': letter = 0.61417323f; break;
case 'o': letter = 0.62204725f; break;
case 'p': letter = 0.62992126f; break;
case 'q': letter = 0.63779527f; break;
case 'r': letter = 0.6456693f; break;
case 's': letter = 0.6535433f; break;
case 't': letter = 0.6614173f; break;
case 'u': letter = 0.6692913f; break;
case 'v': letter = 0.6771653f; break;
case 'w': letter = 0.68503934f; break;
case 'x': letter = 0.6929134f; break;
case 'y': letter = 0.7007874f; break;
case 'z': letter = 0.70866144f; break;
case '1': letter = 0.13385826f; break;
case '2': letter = 0.14173229f; break;
case '3': letter = 0.1496063f; break;
case '4': letter = 0.15748031f; break;
case '5': letter = 0.16535433f; break;
case '6': letter = 0.17322835f; break;
case '7': letter = 0.18110237f; break;
case '8': letter = 0.18897638f; break;
case '9': letter = 0.19685039f; break;
case '0': letter = 0.12598425f; break;
case '$': letter = 0.031496063f; break;
case '\'': letter = 0.05511811f; break;
case '.': letter = 0.11023622f; break;
case ',': letter = 0.09448819f; break;
case ':': letter = 0.20472442f; break;
case ';': letter = 0.21259843f; break;
case '!': letter = 0.007874016f; break;
case ' ': letter = 0.0f; break;
case '?': letter = 0.24409449f; break;
case '[': letter = 0.46456692f; break;
case ']': letter = 0.48031497f; break;
default: letter = 0.0f; break;
}*/

switch (charCounter)
{
case 0:
Expand All @@ -503,31 +456,93 @@ public async void outputVRChat(VoiceWizardWindow MainForm, string textstring)
letterFloat2 = letter;
break;
case 3:
if (MainForm.numKATSyncParameters == "4")
{
Task.Delay(MainForm.debugDelayValue).Wait();
letterFloat3 = letter;
message1 = new SharpOSC.OscMessage("/avatar/parameters/KAT_Pointer", stringPoint);
message2 = new SharpOSC.OscMessage("/avatar/parameters/KAT_CharSync0", letterFloat0);
message3 = new SharpOSC.OscMessage("/avatar/parameters/KAT_CharSync1", letterFloat1);
message4 = new SharpOSC.OscMessage("/avatar/parameters/KAT_CharSync2", letterFloat2);
message5 = new SharpOSC.OscMessage("/avatar/parameters/KAT_CharSync3", letterFloat3);
message0 = new SharpOSC.OscMessage("/avatar/parameters/KAT_Visible", true);

sender2.Send(message1);
sender2.Send(message2);
sender2.Send(message3);
sender2.Send(message4);
sender2.Send(message5);
sender2.Send(message0);


stringPoint += 1;
charCounter = -1;
letterFloat0 = 0;
letterFloat1 = 0;
letterFloat2 = 0;
letterFloat3 = 0;


}
if (MainForm.numKATSyncParameters == "8")
{
letterFloat3 = letter;

}
break;
case 4:
letterFloat4 = letter;
break;
case 5:
letterFloat5 = letter;
break;
case 6:
letterFloat6 = letter;
break;
case 7:

Task.Delay(MainForm.debugDelayValue).Wait();
letterFloat3 = letter;
letterFloat7 = letter;
message1 = new SharpOSC.OscMessage("/avatar/parameters/KAT_Pointer", stringPoint);
message2 = new SharpOSC.OscMessage("/avatar/parameters/KAT_CharSync0", letterFloat0);
message3 = new SharpOSC.OscMessage("/avatar/parameters/KAT_CharSync1", letterFloat1);
message4 = new SharpOSC.OscMessage("/avatar/parameters/KAT_CharSync2", letterFloat2);
message5 = new SharpOSC.OscMessage("/avatar/parameters/KAT_CharSync3", letterFloat3);

message6 = new SharpOSC.OscMessage("/avatar/parameters/KAT_CharSync4", letterFloat4);
message7 = new SharpOSC.OscMessage("/avatar/parameters/KAT_CharSync5", letterFloat5);
message8 = new SharpOSC.OscMessage("/avatar/parameters/KAT_CharSync6", letterFloat6);
message9 = new SharpOSC.OscMessage("/avatar/parameters/KAT_CharSync7", letterFloat7);
message0 = new SharpOSC.OscMessage("/avatar/parameters/KAT_Visible", true);

sender2.Send(message1);
sender2.Send(message2);
sender2.Send(message3);
sender2.Send(message4);
sender2.Send(message5);

sender2.Send(message6);
sender2.Send(message7);
sender2.Send(message8);
sender2.Send(message9);

sender2.Send(message0);


stringPoint += 1;
charCounter = -1;
letterFloat0 = 0;
letterFloat1 = 0;
letterFloat2 = 0;
letterFloat3 = 0;

letterFloat4 = 0;
letterFloat5 = 0;
letterFloat6 = 0;
letterFloat7 = 0;
break;


default: break;
}

Expand Down
12 changes: 12 additions & 0 deletions Settings1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

108 changes: 69 additions & 39 deletions VoiceWizardWindow.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a2b17c8

Please sign in to comment.