From: parking_turkeys Date: Mon, 19 Oct 2026 20:29:54 +0000 (-0400) Subject: It kinda works (-telling the pitch) X-Git-Url: http://git.p-t.hackclub.app/?a=commitdiff_plain;h=44758b58bb8a22c06fdbe927607d79756a779a6b;p=colon3sampler.git It kinda works (-telling the pitch) --- diff --git a/Makefile b/Makefile index 40404e8..abac15b 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ linux: $(CC) *.h *.c -Werror -Wall -Wno-unused-label -lm -o colon3sampler -std=c99 linux-test: linux @echo "testing the thing with an UTAU + oto stuff" - ./colon3sampler test/a.wav test/a_out.wav F4 100 / 24.0 550 56 73 100 0 !120 + ./colon3sampler test/a.wav test/a_out.wav F4 100 / 24.0 21000 56 73 100 0 !120 @echo "testing the thing with teto singing A on C4 (switch to G4)" @echo "./colon3sampler test/test.wav test/test_out.wav G4 100 / 0.0 550 2 2 100 0 !120" @echo "it doesnt work btw but i frogor how to do comments" diff --git a/change_length.c b/change_length.c index 218c319..2e19107 100644 --- a/change_length.c +++ b/change_length.c @@ -2,21 +2,26 @@ int change_wave_len(int16_t w[], int w_B, int16_t ow[], int co, int ow_B) { + if (w_B == ow_B) return 0; int end_samples = (w_B/2) - co; + int half_samples = co/2; int i = 0; +anfang: + for (i = 0; (i < half_samples) && (i < ow_B/2-end_samples); i++) { + ow[i] = w[i]; + }; if (w_B < ow_B) goto loop_co; if (w_B > ow_B) goto cut_wave; - return 0; loop_co: int co_i = 0; - for (i = 0; i < (ow_B/2-end_samples); i++) { + for (i = i; i < (ow_B/2-end_samples); i++) { ow[i] = w[co_i++]; - if (co_i == co) co_i = 0; + if (co_i == co) co_i = half_samples; }; goto append_end; cut_wave: if (end_samples >= (ow_B/2)) goto append_end; - for (i = 0; i < (ow_B/2-end_samples); i++) { + for (i = i; i < (ow_B/2-end_samples); i++) { ow[i] = w[i]; }; goto append_end;