]> _ Git - colon3utau.git/commitdiff
so i added the find oto line but im going to change it lol
authorparking_turkeys <roya1060wien@gmail.com>
Sat, 29 Aug 2026 20:55:01 +0000 (16:55 -0400)
committerparking_turkeys <roya1060wien@gmail.com>
Sat, 29 Aug 2026 20:55:01 +0000 (16:55 -0400)
.gitignore
render/.render.h.swp [deleted file]
render/.tools.c.swp
render/tools.c
utau.h

index 7f3cb10..db80235 100644 (file)
@@ -1,2 +1,4 @@
 *.gch
 *.exe
+*.swp
+*~
diff --git a/render/.render.h.swp b/render/.render.h.swp
deleted file mode 100644 (file)
index e69de29..0000000
index 6b002b7..0a9e2f9 100644 (file)
Binary files a/render/.tools.c.swp and b/render/.tools.c.swp differ
index f3a862f..d0e0971 100644 (file)
@@ -1,22 +1,29 @@
 #include "render.h"
 
-static int call_wavtool  (struct USTinfo *ust_settings, struct USTnote *note);
-static int call_resampler(struct USTinfo *ust_settings, struct USTnote *note);
+static int call_wavtool  (struct USTinfo *ust_settings, struct USTnote *note, char *oto);
+static int call_resampler(struct USTinfo *ust_settings, struct USTnote *note, char *oto);
+
+static char *find_oto_line(char *oto_dir, char *lyric);
 
 static char curr_note_file[10]; // n0000.wav\0
 static int notes_done = 0;
 
 int process_note  (struct USTinfo *settings, struct USTnote *note)
 {
-       call_resampler(settings, note);
-       call_wavtool  (settings, note);
+       char *oto = find_oto_line(settings->voicedir, note->lyric);
+       call_resampler(settings, note, oto);
+       call_wavtool  (settings, note, oto);
 
        return 1;
 };
 
 int call_resampler(struct USTinfo *s, struct USTnote *n)
 {
-       sprintf(curr_note_file, "n%04d.wav
+       //resampler <in> <out> <midi> <velocity> <flags> <oto[1]> <length>
+       //<oto[2]> <oto[3]> <volume> <modulation> <!tempo> <pitchbend>
+       sprintf(curr_note_file, "n%04d.wav", notes_done);
+       notes_done++;
+       char *infile = 
 
 int call_wavtool  (struct USTinfo *s, struct USTnote *n)
 {
@@ -27,3 +34,59 @@ int call_wavtool  (struct USTinfo *s, struct USTnote *n)
        char *outfile_path = "out.wav";
        char *infile_path = 
 };
+
+char *find_oto_line(char *oto_dir, char *lyric)
+{
+       static char line[1000]; //who has a longer oto line tbh
+       char check[64]; int c_i = 0;
+       FILE *fp;
+       int check = 0; //the part you want to check is the part after =
+       int correct = 0; //if 0 && check > 1 dont add anything ig??
+
+       char *oto_path = malloc(snprintf(NULL, 0, "%s/oto.ini", oto_dir));
+       sprintf(oto_path, "%s/oto.ini", oto_dir);
+
+       fp = fopen(oto_path, "r");
+
+       char c; int i = 0;
+       while ((c = getc(fp)) != EOF) {
+               line[i] = c;
+               switch (c) {
+                       case '=':
+                               check = 1;
+                               c_i = 0;
+                               break;
+                       case ',':
+                               if (check == 1) {
+                                       check[c_i] = '\0';
+                                       if (same(check, lyric)) {
+                                               correct = 1;
+                                       };
+                               };
+                               check = 2;
+                               break;
+                       case '\n':
+                               if (correct == 1) {
+                                       line[i] = '\0';
+                                       goto found;
+                               };
+                               i = 0;
+                               check = 0;
+                               break;
+                       default:
+                               if (check == 1) {
+                                       check[c_i] = c;
+                                       c_i++;
+                               };
+                               break;
+               };
+               i++;
+       };
+
+       return NULL;
+
+       found:
+               return line;
+
+
+
diff --git a/utau.h b/utau.h
index 9b893d7..0eff124 100644 (file)
--- a/utau.h
+++ b/utau.h
@@ -70,6 +70,16 @@ struct USTnote {
        int intensity;
        float modulation;
 };
+
+struct oto_line {
+       char *filename;
+       char *alias;
+       float offset;
+       float consonant;
+       float cutoff;
+       float preutterance;
+       float overlap;
+};
        
 
 typedef struct {