From 559b4b37f9c90b6018db88044fa2f9e020a68a83 Mon Sep 17 00:00:00 2001 From: parking_turkeys Date: Sat, 29 Aug 2026 16:55:01 -0400 Subject: [PATCH] so i added the find oto line but im going to change it lol --- .gitignore | 2 ++ render/.render.h.swp | 0 render/.tools.c.swp | Bin 12288 -> 12288 bytes render/tools.c | 73 ++++++++++++++++++++++++++++++++++++++++--- utau.h | 10 ++++++ 5 files changed, 80 insertions(+), 5 deletions(-) delete mode 100644 render/.render.h.swp diff --git a/.gitignore b/.gitignore index 7f3cb10..db80235 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ *.gch *.exe +*.swp +*~ diff --git a/render/.render.h.swp b/render/.render.h.swp deleted file mode 100644 index e69de29..0000000 diff --git a/render/.tools.c.swp b/render/.tools.c.swp index 6b002b7257da85e9b2280544a29d553e9021cb0b..0a9e2f968ba356cefb6040cf986d4a6f9fe6a9bb 100644 GIT binary patch delta 1042 zcmZ|LPe_wt90%~-MjJb9VHR- z(vVJ#og}DZktciUVj$$DTbKTxOHT!L$<@K=`@Y*`MGZc@&-3j0{ds3m`O-u5 z8LBW2WAN)3(E+>y1D--2au9+p*mV(of)DT(-oSlWhZ#5lADu+6VFzBonv=>@!6E{q z&?U2~Xf5+=Dx?0vzIS0iqBBKb!#u{cs%I;DDc)_7AATzOB=+ z9lc>MOOht^lBP06Rz;MgOunS1Cy83e@tLWqD7LrppCtSJ=Eqt~(xN6(%jW*@MB>Tj z6`b*`;LCG3nP)M^8~5Z48?w$>EXKk_A$| z>v?9i+_)l{ub8tcdJ`dUThY9x39h%wnw5B}C|KE>P`&>xJlaUms@D2Syp@fGn{~~H z6;nCUcwK-gE1JxGc%b#BKWEY2S>&&I95&_+{G+X;Y>l8+_l>yPp30+!XE<)_J0NYV~m{t*%5z$VO~D8%u|Yz)C4*%C_)=53SF1grDA}od0kkyjElip lTXz8IkaHMewe@q;18sYxp#fRtN+~UvM-ysVXu+(9egh{M+JXQ8 delta 380 zcmXBQu}gw+5XSL)RZvS)$eNiEuT>nBrP?Sp+K}L>!wFf@jEq8EN$yIX0>yz2JOgL#Igak!K6ZTf8J-ij!)%UB_ z*k$U%sV%E7=a5fJDu3`dP;Pldn%@6`B&8V;dB-U-NF#)Py!MIQ;||9-!YpEN!HKqC z;2IXD;J~*}D`J^o8G)q{-GzQS>6?wuV9#BUOJ18KEMvurF&Ts$=t5`t_ zQH0<|n*%@bf$p)Lw{)ZYuBOLJ@@so$c+9THb=8QcHMKB)<*?nxh|-O$W}i&V55{L$ Vx>?L`TLm*5DVfEBSu!>v@&{s9NFx9M diff --git a/render/tools.c b/render/tools.c index f3a862f..d0e0971 100644 --- a/render/tools.c +++ b/render/tools.c @@ -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 + // + 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 --- 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 { -- 2.47.3