]> _ Git - colon3wavtool.git/commitdiff
fixed rests :/
authorparking_turkeys <roya1060wien@gmail.com>
Fri, 14 Aug 2026 21:08:51 +0000 (17:08 -0400)
committerparking_turkeys <roya1060wien@gmail.com>
Fri, 14 Aug 2026 21:08:51 +0000 (17:08 -0400)
main.c
useful.c

diff --git a/main.c b/main.c
index 9637591..b517264 100644 (file)
--- a/main.c
+++ b/main.c
@@ -40,7 +40,7 @@ int main(int argc, char *argv[])
                */
                //MessageBox(NULL, argv[4], "rest length", MB_OK);
                input_wave_length = ceil(44100.0 * length_arg_to_float(argv[4])) * 2; //first the amount of samples, then how many bytes that is :3 
-               printf("%d", input_wave_length);
+               printf("the length %s becomes %f\n", argv[4], length_arg_to_float(argv[4]));
                input_wave = malloc(input_wave_length);
                
                for (int index = 0; index < input_wave_length/2; index++) {
index 7f9b6e1..5f2d949 100644 (file)
--- a/useful.c
+++ b/useful.c
@@ -22,6 +22,10 @@ float length_arg_to_float(char *arg)
        //and just adding the second part in i guess... shouldnt it be minused??
        //actually no idea why the second part exists so im skipping it for now lmao
        //tyty yawu code author. otherwise i would be COOKED
+
+       //OK NEW THING FIGURED OUT
+       //IF "calculate legnth on ui" is checked then uh
+       // the length thing is in MILLISECONDS. Yeah
        int i = 0;
        char c = 'x';
        char buffer[50] = {'\0'}; //who is making smth with a longer number tbh
@@ -65,7 +69,12 @@ float length_arg_to_float(char *arg)
                                                
        };
        z = sign * arg_to_float(buffer);
-       return x/y/8 + z/1000;
+       float result = x/y/8 + z/1000;
+       if (x == 0 || y == 0) {
+               //length calculated on UI
+               result = z/1000;
+       };
+       return result;
 };
 
 float arg_to_float(char *arg)