clive is a C audio live-coding skeleton. It allows you to hot-swap DSP processing callbacks, providing not much more than automatic C code recompilation, object code reloading, and state preservation.
diff @ 2012-02-18 19:32:36 +0000 diff --git a/src/go.c b/src/go.c index 9879110..2be0b35 100644 --- a/src/go.c +++ b/src/go.c @@ -1,7 +1,16 @@ +#include <stdlib.h> +#define SR 48000.0 +#include <math.h> +#define PI 3.1415926 + typedef struct { float like_a_butterfly; + double radioactivity; } S; float go(S *s, float x) { - return 0; + s->radioactivity += 1/(1e5 * SR); + double decay = rand() / (double) RAND_MAX < s->radioactivity; + double o = decay * 0.9; + return o; }
diff @ 2012-02-18 19:33:52 +0000 diff --git a/src/go.c b/src/go.c index 2be0b35..5acf397 100644 --- a/src/go.c +++ b/src/go.c @@ -6,11 +6,15 @@ typedef struct { float like_a_butterfly; double radioactivity; + float delayline[1024]; + int delaywrite; } S; float go(S *s, float x) { s->radioactivity += 1/(1e5 * SR); double decay = rand() / (double) RAND_MAX < s->radioactivity; double o = decay * 0.9; + s->delaywrite = (s->delaywrite + 1) % 1024; + s->delayline[s->delaywrite] = tanh(o); return o; }
diff @ 2012-02-18 19:36:06 +0000 diff --git a/src/go.c b/src/go.c index 5acf397..e6391a2 100644 --- a/src/go.c +++ b/src/go.c @@ -8,13 +8,21 @@ typedef struct { double radioactivity; float delayline[1024]; int delaywrite; + double delayread[8]; } S; float go(S *s, float x) { s->radioactivity += 1/(1e5 * SR); double decay = rand() / (double) RAND_MAX < s->radioactivity; double o = decay * 0.9; + for (int i = 0; i < 8; ++i) { + s->delayread = fmod(s->delayread + 1/1024.0, 1); + double r = s->delayread * 1024; + int ri = floor(r); + double rf = r - ri; + o += s->delayline[ri] * (1 - rf) + rf * s->delayline[(ri + 1)%1024]; + } s->delaywrite = (s->delaywrite + 1) % 1024; - s->delayline[s->delaywrite] = tanh(o); + s->delayline[s->delaywrite] = tanh(o/16); return o; }
diff @ 2012-02-18 19:36:18 +0000 diff --git a/src/go.c b/src/go.c index e6391a2..51398e5 100644 --- a/src/go.c +++ b/src/go.c @@ -16,8 +16,8 @@ float go(S *s, float x) { double decay = rand() / (double) RAND_MAX < s->radioactivity; double o = decay * 0.9; for (int i = 0; i < 8; ++i) { - s->delayread = fmod(s->delayread + 1/1024.0, 1); - double r = s->delayread * 1024; + s->delayread = fmod(s->delayread[i] + 1/1024.0, 1); + double r = s->delayread[i] * 1024; int ri = floor(r); double rf = r - ri; o += s->delayline[ri] * (1 - rf) + rf * s->delayline[(ri + 1)%1024];
diff @ 2012-02-18 19:36:27 +0000 diff --git a/src/go.c b/src/go.c index 51398e5..2b7bc1e 100644 --- a/src/go.c +++ b/src/go.c @@ -16,7 +16,7 @@ float go(S *s, float x) { double decay = rand() / (double) RAND_MAX < s->radioactivity; double o = decay * 0.9; for (int i = 0; i < 8; ++i) { - s->delayread = fmod(s->delayread[i] + 1/1024.0, 1); + s->delayread[i] = fmod(s->delayread[i] + 1/1024.0, 1); double r = s->delayread[i] * 1024; int ri = floor(r); double rf = r - ri;
diff @ 2012-02-18 19:36:55 +0000 diff --git a/src/go.c b/src/go.c index 2b7bc1e..ec7ed1f 100644 --- a/src/go.c +++ b/src/go.c @@ -9,6 +9,7 @@ typedef struct { float delayline[1024]; int delaywrite; double delayread[8]; + double leak; } S; float go(S *s, float x) { @@ -22,6 +23,8 @@ float go(S *s, float x) { double rf = r - ri; o += s->delayline[ri] * (1 - rf) + rf * s->delayline[(ri + 1)%1024]; } + s->leak = s->leak * 0.999 + 0.001 * o; + o -= s->leak; s->delaywrite = (s->delaywrite + 1) % 1024; s->delayline[s->delaywrite] = tanh(o/16); return o;
diff @ 2012-02-18 19:38:42 +0000 diff --git a/src/go.c b/src/go.c index ec7ed1f..b7b66a4 100644 --- a/src/go.c +++ b/src/go.c @@ -10,6 +10,7 @@ typedef struct { int delaywrite; double delayread[8]; double leak; + double px, py; } S; float go(S *s, float x) { @@ -25,6 +26,15 @@ float go(S *s, float x) { } s->leak = s->leak * 0.999 + 0.001 * o; o -= s->leak; + double pa = 2 * PI * 60 / SR: + double pr = 0.99; + double qx = pr * cos(pa); + double qy = pr * sin(pa); + double px = s->px * qx - qy * s->py + o; + double py = s->px * qy + qx * s->py; + s->px = px; + s->py = py; + o += px; s->delaywrite = (s->delaywrite + 1) % 1024; s->delayline[s->delaywrite] = tanh(o/16); return o;
diff @ 2012-02-18 19:38:55 +0000 diff --git a/src/go.c b/src/go.c index b7b66a4..7546e71 100644 --- a/src/go.c +++ b/src/go.c @@ -26,7 +26,7 @@ float go(S *s, float x) { } s->leak = s->leak * 0.999 + 0.001 * o; o -= s->leak; - double pa = 2 * PI * 60 / SR: + double pa = 2 * PI * 60 / SR; double pr = 0.99; double qx = pr * cos(pa); double qy = pr * sin(pa);
diff @ 2012-02-18 19:39:00 +0000 diff --git a/src/go.c b/src/go.c index 7546e71..fdf5d72 100644 --- a/src/go.c +++ b/src/go.c @@ -27,7 +27,7 @@ float go(S *s, float x) { s->leak = s->leak * 0.999 + 0.001 * o; o -= s->leak; double pa = 2 * PI * 60 / SR; - double pr = 0.99; + double pr = 0.9; double qx = pr * cos(pa); double qy = pr * sin(pa); double px = s->px * qx - qy * s->py + o;
diff @ 2012-02-18 19:39:15 +0000 diff --git a/src/go.c b/src/go.c index fdf5d72..4b96fcd 100644 --- a/src/go.c +++ b/src/go.c @@ -18,7 +18,7 @@ float go(S *s, float x) { double decay = rand() / (double) RAND_MAX < s->radioactivity; double o = decay * 0.9; for (int i = 0; i < 8; ++i) { - s->delayread[i] = fmod(s->delayread[i] + 1/1024.0, 1); + s->delayread[i] = fmod(s->delayread[i] + (1 + (0.001 * i)/1024.0, 1); double r = s->delayread[i] * 1024; int ri = floor(r); double rf = r - ri;
diff @ 2012-02-18 19:39:20 +0000 diff --git a/src/go.c b/src/go.c index 4b96fcd..ab2b3fa 100644 --- a/src/go.c +++ b/src/go.c @@ -18,7 +18,7 @@ float go(S *s, float x) { double decay = rand() / (double) RAND_MAX < s->radioactivity; double o = decay * 0.9; for (int i = 0; i < 8; ++i) { - s->delayread[i] = fmod(s->delayread[i] + (1 + (0.001 * i)/1024.0, 1); + s->delayread[i] = fmod(s->delayread[i] + (1 + (0.001 * i))/1024.0, 1); double r = s->delayread[i] * 1024; int ri = floor(r); double rf = r - ri;
diff @ 2012-02-18 19:39:33 +0000 diff --git a/src/go.c b/src/go.c index ab2b3fa..7136e3b 100644 --- a/src/go.c +++ b/src/go.c @@ -24,8 +24,6 @@ float go(S *s, float x) { double rf = r - ri; o += s->delayline[ri] * (1 - rf) + rf * s->delayline[(ri + 1)%1024]; } - s->leak = s->leak * 0.999 + 0.001 * o; - o -= s->leak; double pa = 2 * PI * 60 / SR; double pr = 0.9; double qx = pr * cos(pa); @@ -35,6 +33,8 @@ float go(S *s, float x) { s->px = px; s->py = py; o += px; + s->leak = s->leak * 0.999 + 0.001 * o; + o -= s->leak; s->delaywrite = (s->delaywrite + 1) % 1024; s->delayline[s->delaywrite] = tanh(o/16); return o;
diff @ 2012-02-18 19:39:49 +0000 diff --git a/src/go.c b/src/go.c index 7136e3b..a50ce17 100644 --- a/src/go.c +++ b/src/go.c @@ -14,7 +14,7 @@ typedef struct { } S; float go(S *s, float x) { - s->radioactivity += 1/(1e5 * SR); + s->radioactivity -= 1/(1e5 * SR); double decay = rand() / (double) RAND_MAX < s->radioactivity; double o = decay * 0.9; for (int i = 0; i < 8; ++i) {
diff @ 2012-02-18 19:40:46 +0000 diff --git a/src/go.c b/src/go.c index a50ce17..6fdcf05 100644 --- a/src/go.c +++ b/src/go.c @@ -11,12 +11,15 @@ typedef struct { double delayread[8]; double leak; double px, py; + double e; } S; float go(S *s, float x) { s->radioactivity -= 1/(1e5 * SR); double decay = rand() / (double) RAND_MAX < s->radioactivity; double o = decay * 0.9; + s->e *= 0.999; + s->e += decay; for (int i = 0; i < 8; ++i) { s->delayread[i] = fmod(s->delayread[i] + (1 + (0.001 * i))/1024.0, 1); double r = s->delayread[i] * 1024; @@ -24,7 +27,7 @@ float go(S *s, float x) { double rf = r - ri; o += s->delayline[ri] * (1 - rf) + rf * s->delayline[(ri + 1)%1024]; } - double pa = 2 * PI * 60 / SR; + double pa = 2 * PI * (60 + 60 * e) / SR; double pr = 0.9; double qx = pr * cos(pa); double qy = pr * sin(pa);
diff @ 2012-02-18 19:40:50 +0000 diff --git a/src/go.c b/src/go.c index 6fdcf05..32e2063 100644 --- a/src/go.c +++ b/src/go.c @@ -27,7 +27,7 @@ float go(S *s, float x) { double rf = r - ri; o += s->delayline[ri] * (1 - rf) + rf * s->delayline[(ri + 1)%1024]; } - double pa = 2 * PI * (60 + 60 * e) / SR; + double pa = 2 * PI * (60 + 60 * s->e) / SR; double pr = 0.9; double qx = pr * cos(pa); double qy = pr * sin(pa);
diff @ 2012-02-18 19:41:01 +0000 diff --git a/src/go.c b/src/go.c index 32e2063..f0dcd74 100644 --- a/src/go.c +++ b/src/go.c @@ -18,7 +18,7 @@ float go(S *s, float x) { s->radioactivity -= 1/(1e5 * SR); double decay = rand() / (double) RAND_MAX < s->radioactivity; double o = decay * 0.9; - s->e *= 0.999; + s->e *= 0.9999; s->e += decay; for (int i = 0; i < 8; ++i) { s->delayread[i] = fmod(s->delayread[i] + (1 + (0.001 * i))/1024.0, 1);
diff @ 2012-02-18 19:41:04 +0000 diff --git a/src/go.c b/src/go.c index f0dcd74..32e2063 100644 --- a/src/go.c +++ b/src/go.c @@ -18,7 +18,7 @@ float go(S *s, float x) { s->radioactivity -= 1/(1e5 * SR); double decay = rand() / (double) RAND_MAX < s->radioactivity; double o = decay * 0.9; - s->e *= 0.9999; + s->e *= 0.999; s->e += decay; for (int i = 0; i < 8; ++i) { s->delayread[i] = fmod(s->delayread[i] + (1 + (0.001 * i))/1024.0, 1);
diff @ 2012-02-18 19:41:55 +0000 diff --git a/src/go.c b/src/go.c index 32e2063..dede1c8 100644 --- a/src/go.c +++ b/src/go.c @@ -12,14 +12,18 @@ typedef struct { double leak; double px, py; double e; + double clock; } S; float go(S *s, float x) { + double old_clock = s->clock; + s->clock = fmod(s->clock + 0.5/SR, 1); + double tick = s->clock < old_clock; s->radioactivity -= 1/(1e5 * SR); double decay = rand() / (double) RAND_MAX < s->radioactivity; double o = decay * 0.9; s->e *= 0.999; - s->e += decay; + s->e += clock; for (int i = 0; i < 8; ++i) { s->delayread[i] = fmod(s->delayread[i] + (1 + (0.001 * i))/1024.0, 1); double r = s->delayread[i] * 1024;
diff @ 2012-02-18 19:41:58 +0000 diff --git a/src/go.c b/src/go.c index dede1c8..5d89d00 100644 --- a/src/go.c +++ b/src/go.c @@ -23,7 +23,7 @@ float go(S *s, float x) { double decay = rand() / (double) RAND_MAX < s->radioactivity; double o = decay * 0.9; s->e *= 0.999; - s->e += clock; + s->e += tick; for (int i = 0; i < 8; ++i) { s->delayread[i] = fmod(s->delayread[i] + (1 + (0.001 * i))/1024.0, 1); double r = s->delayread[i] * 1024;
diff @ 2012-02-18 19:42:09 +0000 diff --git a/src/go.c b/src/go.c index 5d89d00..33bc2f3 100644 --- a/src/go.c +++ b/src/go.c @@ -21,7 +21,7 @@ float go(S *s, float x) { double tick = s->clock < old_clock; s->radioactivity -= 1/(1e5 * SR); double decay = rand() / (double) RAND_MAX < s->radioactivity; - double o = decay * 0.9; + double o = 0; //decay * 0.9; s->e *= 0.999; s->e += tick; for (int i = 0; i < 8; ++i) {
diff @ 2012-02-18 19:42:17 +0000 diff --git a/src/go.c b/src/go.c index 33bc2f3..34e64d9 100644 --- a/src/go.c +++ b/src/go.c @@ -22,7 +22,7 @@ float go(S *s, float x) { s->radioactivity -= 1/(1e5 * SR); double decay = rand() / (double) RAND_MAX < s->radioactivity; double o = 0; //decay * 0.9; - s->e *= 0.999; + s->e *= 0.9999; s->e += tick; for (int i = 0; i < 8; ++i) { s->delayread[i] = fmod(s->delayread[i] + (1 + (0.001 * i))/1024.0, 1);
diff @ 2012-02-18 19:42:27 +0000 diff --git a/src/go.c b/src/go.c index 34e64d9..eb9d147 100644 --- a/src/go.c +++ b/src/go.c @@ -22,7 +22,7 @@ float go(S *s, float x) { s->radioactivity -= 1/(1e5 * SR); double decay = rand() / (double) RAND_MAX < s->radioactivity; double o = 0; //decay * 0.9; - s->e *= 0.9999; + s->e *= 0.99999; s->e += tick; for (int i = 0; i < 8; ++i) { s->delayread[i] = fmod(s->delayread[i] + (1 + (0.001 * i))/1024.0, 1);
diff @ 2012-02-18 19:42:44 +0000 diff --git a/src/go.c b/src/go.c index eb9d147..04f7e1e 100644 --- a/src/go.c +++ b/src/go.c @@ -31,7 +31,7 @@ float go(S *s, float x) { double rf = r - ri; o += s->delayline[ri] * (1 - rf) + rf * s->delayline[(ri + 1)%1024]; } - double pa = 2 * PI * (60 + 60 * s->e) / SR; + double pa = 2 * PI * (60 + 600 * s->e) / SR; double pr = 0.9; double qx = pr * cos(pa); double qy = pr * sin(pa);
diff @ 2012-02-18 19:42:56 +0000 diff --git a/src/go.c b/src/go.c index 04f7e1e..964e0d4 100644 --- a/src/go.c +++ b/src/go.c @@ -22,7 +22,7 @@ float go(S *s, float x) { s->radioactivity -= 1/(1e5 * SR); double decay = rand() / (double) RAND_MAX < s->radioactivity; double o = 0; //decay * 0.9; - s->e *= 0.99999; + s->e *= 0.9999; s->e += tick; for (int i = 0; i < 8; ++i) { s->delayread[i] = fmod(s->delayread[i] + (1 + (0.001 * i))/1024.0, 1);
diff @ 2012-02-18 19:43:04 +0000 diff --git a/src/go.c b/src/go.c index 964e0d4..80c56de 100644 --- a/src/go.c +++ b/src/go.c @@ -43,6 +43,6 @@ float go(S *s, float x) { s->leak = s->leak * 0.999 + 0.001 * o; o -= s->leak; s->delaywrite = (s->delaywrite + 1) % 1024; - s->delayline[s->delaywrite] = tanh(o/16); + s->delayline[s->delaywrite] = tanh(o/32); return o; }
diff @ 2012-02-18 19:43:31 +0000 diff --git a/src/go.c b/src/go.c index 80c56de..ff35d4f 100644 --- a/src/go.c +++ b/src/go.c @@ -43,6 +43,6 @@ float go(S *s, float x) { s->leak = s->leak * 0.999 + 0.001 * o; o -= s->leak; s->delaywrite = (s->delaywrite + 1) % 1024; - s->delayline[s->delaywrite] = tanh(o/32); + s->delayline[s->delaywrite] = sin(PI * s->delaywrite / 1024.0) * tanh(o/32); return o; }
diff @ 2012-02-18 19:43:38 +0000 diff --git a/src/go.c b/src/go.c index ff35d4f..2712bfe 100644 --- a/src/go.c +++ b/src/go.c @@ -25,7 +25,7 @@ float go(S *s, float x) { s->e *= 0.9999; s->e += tick; for (int i = 0; i < 8; ++i) { - s->delayread[i] = fmod(s->delayread[i] + (1 + (0.001 * i))/1024.0, 1); + s->delayread[i] = fmod(s->delayread[i] + (1 + (0.01 * i))/1024.0, 1); double r = s->delayread[i] * 1024; int ri = floor(r); double rf = r - ri;
diff @ 2012-02-18 19:44:01 +0000 diff --git a/src/go.c b/src/go.c index 2712bfe..49f9cbc 100644 --- a/src/go.c +++ b/src/go.c @@ -13,9 +13,11 @@ typedef struct { double px, py; double e; double clock; + double tempo; } S; float go(S *s, float x) { + s->tempo = 0.5; double old_clock = s->clock; s->clock = fmod(s->clock + 0.5/SR, 1); double tick = s->clock < old_clock;
diff @ 2012-02-18 19:44:05 +0000 diff --git a/src/go.c b/src/go.c index 49f9cbc..ee13d89 100644 --- a/src/go.c +++ b/src/go.c @@ -19,7 +19,7 @@ typedef struct { float go(S *s, float x) { s->tempo = 0.5; double old_clock = s->clock; - s->clock = fmod(s->clock + 0.5/SR, 1); + s->clock = fmod(s->clock + s->tempo/SR, 1); double tick = s->clock < old_clock; s->radioactivity -= 1/(1e5 * SR); double decay = rand() / (double) RAND_MAX < s->radioactivity;
diff @ 2012-02-18 19:44:21 +0000 diff --git a/src/go.c b/src/go.c index ee13d89..23fbdd8 100644 --- a/src/go.c +++ b/src/go.c @@ -21,7 +21,7 @@ float go(S *s, float x) { double old_clock = s->clock; s->clock = fmod(s->clock + s->tempo/SR, 1); double tick = s->clock < old_clock; - s->radioactivity -= 1/(1e5 * SR); + s->radioactivity = 0; double decay = rand() / (double) RAND_MAX < s->radioactivity; double o = 0; //decay * 0.9; s->e *= 0.9999;
diff @ 2012-02-18 19:44:44 +0000 diff --git a/src/go.c b/src/go.c index 23fbdd8..00dfbad 100644 --- a/src/go.c +++ b/src/go.c @@ -17,7 +17,7 @@ typedef struct { } S; float go(S *s, float x) { - s->tempo = 0.5; + s->tempo += 1e-6/SR; double old_clock = s->clock; s->clock = fmod(s->clock + s->tempo/SR, 1); double tick = s->clock < old_clock;
diff @ 2012-02-18 19:44:52 +0000 diff --git a/src/go.c b/src/go.c index 00dfbad..baffa81 100644 --- a/src/go.c +++ b/src/go.c @@ -34,7 +34,7 @@ float go(S *s, float x) { o += s->delayline[ri] * (1 - rf) + rf * s->delayline[(ri + 1)%1024]; } double pa = 2 * PI * (60 + 600 * s->e) / SR; - double pr = 0.9; + double pr = 0.95; double qx = pr * cos(pa); double qy = pr * sin(pa); double px = s->px * qx - qy * s->py + o;
diff @ 2012-02-18 19:45:09 +0000 diff --git a/src/go.c b/src/go.c index baffa81..6c77629 100644 --- a/src/go.c +++ b/src/go.c @@ -27,7 +27,7 @@ float go(S *s, float x) { s->e *= 0.9999; s->e += tick; for (int i = 0; i < 8; ++i) { - s->delayread[i] = fmod(s->delayread[i] + (1 + (0.01 * i))/1024.0, 1); + s->delayread[i] = fmod(s->delayread[i] + (1 + ((2&i) - 1)*(0.01 * i))/1024.0, 1); double r = s->delayread[i] * 1024; int ri = floor(r); double rf = r - ri;
diff @ 2012-02-18 19:45:23 +0000 diff --git a/src/go.c b/src/go.c index 6c77629..6ef1cd5 100644 --- a/src/go.c +++ b/src/go.c @@ -34,7 +34,7 @@ float go(S *s, float x) { o += s->delayline[ri] * (1 - rf) + rf * s->delayline[(ri + 1)%1024]; } double pa = 2 * PI * (60 + 600 * s->e) / SR; - double pr = 0.95; + double pr = 0.5; double qx = pr * cos(pa); double qy = pr * sin(pa); double px = s->px * qx - qy * s->py + o;
diff @ 2012-02-18 19:45:34 +0000 diff --git a/src/go.c b/src/go.c index 6ef1cd5..c8cf8f7 100644 --- a/src/go.c +++ b/src/go.c @@ -37,7 +37,7 @@ float go(S *s, float x) { double pr = 0.5; double qx = pr * cos(pa); double qy = pr * sin(pa); - double px = s->px * qx - qy * s->py + o; + double px = s->px * qx - qy * s->py + o * 4; double py = s->px * qy + qx * s->py; s->px = px; s->py = py;
diff @ 2012-02-18 19:45:47 +0000 diff --git a/src/go.c b/src/go.c index c8cf8f7..d5d6fdd 100644 --- a/src/go.c +++ b/src/go.c @@ -4,7 +4,6 @@ #define PI 3.1415926 typedef struct { - float like_a_butterfly; double radioactivity; float delayline[1024]; int delaywrite;
diff @ 2012-02-18 19:46:05 +0000 diff --git a/src/go.c b/src/go.c index d5d6fdd..68a547f 100644 --- a/src/go.c +++ b/src/go.c @@ -26,7 +26,7 @@ float go(S *s, float x) { s->e *= 0.9999; s->e += tick; for (int i = 0; i < 8; ++i) { - s->delayread[i] = fmod(s->delayread[i] + (1 + ((2&i) - 1)*(0.01 * i))/1024.0, 1); + s->delayread[i] = fmod(s->delayread[i] + (1 + ((2&i) - 1)*(0.1 * i))/1024.0, 1); double r = s->delayread[i] * 1024; int ri = floor(r); double rf = r - ri;
diff @ 2012-02-18 19:46:16 +0000 diff --git a/src/go.c b/src/go.c index 68a547f..0b3360f 100644 --- a/src/go.c +++ b/src/go.c @@ -44,6 +44,6 @@ float go(S *s, float x) { s->leak = s->leak * 0.999 + 0.001 * o; o -= s->leak; s->delaywrite = (s->delaywrite + 1) % 1024; - s->delayline[s->delaywrite] = sin(PI * s->delaywrite / 1024.0) * tanh(o/32); + s->delayline[s->delaywrite] = sin(PI * s->delaywrite / 1024.0) * tanh(o/16); return o; }
diff @ 2012-02-18 19:46:24 +0000 diff --git a/src/go.c b/src/go.c index 0b3360f..158735b 100644 --- a/src/go.c +++ b/src/go.c @@ -44,6 +44,6 @@ float go(S *s, float x) { s->leak = s->leak * 0.999 + 0.001 * o; o -= s->leak; s->delaywrite = (s->delaywrite + 1) % 1024; - s->delayline[s->delaywrite] = sin(PI * s->delaywrite / 1024.0) * tanh(o/16); + s->delayline[s->delaywrite] = sin(PI * s->delaywrite / 1024.0) * tanh(o/15); return o; }
diff @ 2012-02-18 19:46:42 +0000 diff --git a/src/go.c b/src/go.c index 158735b..26ff112 100644 --- a/src/go.c +++ b/src/go.c @@ -26,7 +26,7 @@ float go(S *s, float x) { s->e *= 0.9999; s->e += tick; for (int i = 0; i < 8; ++i) { - s->delayread[i] = fmod(s->delayread[i] + (1 + ((2&i) - 1)*(0.1 * i))/1024.0, 1); + s->delayread[i] = fmod(s->delayread[i] + (1 + ((2&i) - 1)*(0.1 * i))/512.0, 1); double r = s->delayread[i] * 1024; int ri = floor(r); double rf = r - ri;
diff @ 2012-02-18 19:47:19 +0000 diff --git a/src/go.c b/src/go.c index 26ff112..1f6bf49 100644 --- a/src/go.c +++ b/src/go.c @@ -13,6 +13,7 @@ typedef struct { double e; double clock; double tempo; + double strong; } S; float go(S *s, float x) { @@ -43,6 +44,8 @@ float go(S *s, float x) { o += px; s->leak = s->leak * 0.999 + 0.001 * o; o -= s->leak; + s->strong = s->strong * 0.5 + 0.5 * o; + o = s->strong; s->delaywrite = (s->delaywrite + 1) % 1024; s->delayline[s->delaywrite] = sin(PI * s->delaywrite / 1024.0) * tanh(o/15); return o;
diff @ 2012-02-18 19:47:35 +0000 diff --git a/src/go.c b/src/go.c index 1f6bf49..c2a2d13 100644 --- a/src/go.c +++ b/src/go.c @@ -33,7 +33,7 @@ float go(S *s, float x) { double rf = r - ri; o += s->delayline[ri] * (1 - rf) + rf * s->delayline[(ri + 1)%1024]; } - double pa = 2 * PI * (60 + 600 * s->e) / SR; + double pa = 2 * PI * (70 + 600 * s->e) / SR; double pr = 0.5; double qx = pr * cos(pa); double qy = pr * sin(pa);
diff @ 2012-02-18 19:47:45 +0000 diff --git a/src/go.c b/src/go.c index c2a2d13..5961a48 100644 --- a/src/go.c +++ b/src/go.c @@ -33,7 +33,7 @@ float go(S *s, float x) { double rf = r - ri; o += s->delayline[ri] * (1 - rf) + rf * s->delayline[(ri + 1)%1024]; } - double pa = 2 * PI * (70 + 600 * s->e) / SR; + double pa = 2 * PI * (777 + 600 * s->e) / SR; double pr = 0.5; double qx = pr * cos(pa); double qy = pr * sin(pa);
diff @ 2012-02-18 19:48:25 +0000 diff --git a/src/go.c b/src/go.c index 5961a48..5e6592c 100644 --- a/src/go.c +++ b/src/go.c @@ -14,16 +14,18 @@ typedef struct { double clock; double tempo; double strong; + int t; } S; float go(S *s, float x) { + s->t += 1; s->tempo += 1e-6/SR; double old_clock = s->clock; s->clock = fmod(s->clock + s->tempo/SR, 1); double tick = s->clock < old_clock; s->radioactivity = 0; double decay = rand() / (double) RAND_MAX < s->radioactivity; - double o = 0; //decay * 0.9; + double o = (t>>13) & 0xFF; s->e *= 0.9999; s->e += tick; for (int i = 0; i < 8; ++i) {
diff @ 2012-02-18 19:48:33 +0000 diff --git a/src/go.c b/src/go.c index 5e6592c..14ddcfc 100644 --- a/src/go.c +++ b/src/go.c @@ -25,7 +25,7 @@ float go(S *s, float x) { double tick = s->clock < old_clock; s->radioactivity = 0; double decay = rand() / (double) RAND_MAX < s->radioactivity; - double o = (t>>13) & 0xFF; + double o = (s->t>>13) & 0xFF; s->e *= 0.9999; s->e += tick; for (int i = 0; i < 8; ++i) {
diff @ 2012-02-18 19:48:49 +0000 diff --git a/src/go.c b/src/go.c index 14ddcfc..dc0141e 100644 --- a/src/go.c +++ b/src/go.c @@ -25,7 +25,7 @@ float go(S *s, float x) { double tick = s->clock < old_clock; s->radioactivity = 0; double decay = rand() / (double) RAND_MAX < s->radioactivity; - double o = (s->t>>13) & 0xFF; + double o = ((s->t>>13) & 0xFF - 0x80) / 0x80; s->e *= 0.9999; s->e += tick; for (int i = 0; i < 8; ++i) {
diff @ 2012-02-18 19:48:57 +0000 diff --git a/src/go.c b/src/go.c index dc0141e..230ee9a 100644 --- a/src/go.c +++ b/src/go.c @@ -25,7 +25,7 @@ float go(S *s, float x) { double tick = s->clock < old_clock; s->radioactivity = 0; double decay = rand() / (double) RAND_MAX < s->radioactivity; - double o = ((s->t>>13) & 0xFF - 0x80) / 0x80; + double o = (((s->t>>13) & 0xFF) - 0x80) / 0x80; s->e *= 0.9999; s->e += tick; for (int i = 0; i < 8; ++i) {
diff @ 2012-02-18 19:49:13 +0000 diff --git a/src/go.c b/src/go.c index 230ee9a..a44b4c4 100644 --- a/src/go.c +++ b/src/go.c @@ -26,7 +26,7 @@ float go(S *s, float x) { s->radioactivity = 0; double decay = rand() / (double) RAND_MAX < s->radioactivity; double o = (((s->t>>13) & 0xFF) - 0x80) / 0x80; - s->e *= 0.9999; + s->e *= 0.999; s->e += tick; for (int i = 0; i < 8; ++i) { s->delayread[i] = fmod(s->delayread[i] + (1 + ((2&i) - 1)*(0.1 * i))/512.0, 1);
diff @ 2012-02-18 19:49:17 +0000 diff --git a/src/go.c b/src/go.c index a44b4c4..329978e 100644 --- a/src/go.c +++ b/src/go.c @@ -25,7 +25,7 @@ float go(S *s, float x) { double tick = s->clock < old_clock; s->radioactivity = 0; double decay = rand() / (double) RAND_MAX < s->radioactivity; - double o = (((s->t>>13) & 0xFF) - 0x80) / 0x80; + double o = (((s->t>>12) & 0xFF) - 0x80) / 0x80; s->e *= 0.999; s->e += tick; for (int i = 0; i < 8; ++i) {
diff @ 2012-02-18 19:49:21 +0000 diff --git a/src/go.c b/src/go.c index 329978e..0a930bb 100644 --- a/src/go.c +++ b/src/go.c @@ -25,7 +25,7 @@ float go(S *s, float x) { double tick = s->clock < old_clock; s->radioactivity = 0; double decay = rand() / (double) RAND_MAX < s->radioactivity; - double o = (((s->t>>12) & 0xFF) - 0x80) / 0x80; + double o = (((s->t>>11) & 0xFF) - 0x80) / 0x80; s->e *= 0.999; s->e += tick; for (int i = 0; i < 8; ++i) {
diff @ 2012-02-18 19:49:25 +0000 diff --git a/src/go.c b/src/go.c index 0a930bb..a210304 100644 --- a/src/go.c +++ b/src/go.c @@ -25,7 +25,7 @@ float go(S *s, float x) { double tick = s->clock < old_clock; s->radioactivity = 0; double decay = rand() / (double) RAND_MAX < s->radioactivity; - double o = (((s->t>>11) & 0xFF) - 0x80) / 0x80; + double o = (((s->t>>10) & 0xFF) - 0x80) / 0x80; s->e *= 0.999; s->e += tick; for (int i = 0; i < 8; ++i) {
diff @ 2012-02-18 19:49:31 +0000 diff --git a/src/go.c b/src/go.c index a210304..3ec19c5 100644 --- a/src/go.c +++ b/src/go.c @@ -29,7 +29,7 @@ float go(S *s, float x) { s->e *= 0.999; s->e += tick; for (int i = 0; i < 8; ++i) { - s->delayread[i] = fmod(s->delayread[i] + (1 + ((2&i) - 1)*(0.1 * i))/512.0, 1); + s->delayread[i] = fmod(s->delayread[i] + (1 + ((2&i) - 1)*(0.1 * i))/513.0, 1); double r = s->delayread[i] * 1024; int ri = floor(r); double rf = r - ri;
diff @ 2012-02-18 19:49:41 +0000 diff --git a/src/go.c b/src/go.c index 3ec19c5..642691f 100644 --- a/src/go.c +++ b/src/go.c @@ -36,7 +36,7 @@ float go(S *s, float x) { o += s->delayline[ri] * (1 - rf) + rf * s->delayline[(ri + 1)%1024]; } double pa = 2 * PI * (777 + 600 * s->e) / SR; - double pr = 0.5; + double pr = 0.7; double qx = pr * cos(pa); double qy = pr * sin(pa); double px = s->px * qx - qy * s->py + o * 4;
diff @ 2012-02-18 19:49:55 +0000 diff --git a/src/go.c b/src/go.c index 642691f..7e8ab1d 100644 --- a/src/go.c +++ b/src/go.c @@ -49,6 +49,6 @@ float go(S *s, float x) { s->strong = s->strong * 0.5 + 0.5 * o; o = s->strong; s->delaywrite = (s->delaywrite + 1) % 1024; - s->delayline[s->delaywrite] = sin(PI * s->delaywrite / 1024.0) * tanh(o/15); + s->delayline[s->delaywrite] = sin(PI * s->delaywrite / 1024.0) * tanh(o/13); return o; }
diff @ 2012-02-18 19:50:01 +0000 diff --git a/src/go.c b/src/go.c index 7e8ab1d..e189454 100644 --- a/src/go.c +++ b/src/go.c @@ -29,7 +29,7 @@ float go(S *s, float x) { s->e *= 0.999; s->e += tick; for (int i = 0; i < 8; ++i) { - s->delayread[i] = fmod(s->delayread[i] + (1 + ((2&i) - 1)*(0.1 * i))/513.0, 1); + s->delayread[i] = fmod(s->delayread[i] + (1 + ((2&i) - 1)*(0.1 * i))/256.0, 1); double r = s->delayread[i] * 1024; int ri = floor(r); double rf = r - ri;
diff @ 2012-02-18 19:50:13 +0000 diff --git a/src/go.c b/src/go.c index e189454..3c0bbc4 100644 --- a/src/go.c +++ b/src/go.c @@ -29,7 +29,7 @@ float go(S *s, float x) { s->e *= 0.999; s->e += tick; for (int i = 0; i < 8; ++i) { - s->delayread[i] = fmod(s->delayread[i] + (1 + ((2&i) - 1)*(0.1 * i))/256.0, 1); + s->delayread[i] = fmod(s->delayread[i] + (1 + ((2&i) - 1)*(0.2 * i))/256.0, 1); double r = s->delayread[i] * 1024; int ri = floor(r); double rf = r - ri;
diff @ 2012-02-18 19:50:21 +0000 diff --git a/src/go.c b/src/go.c index 3c0bbc4..cd48d1a 100644 --- a/src/go.c +++ b/src/go.c @@ -29,7 +29,7 @@ float go(S *s, float x) { s->e *= 0.999; s->e += tick; for (int i = 0; i < 8; ++i) { - s->delayread[i] = fmod(s->delayread[i] + (1 + ((2&i) - 1)*(0.2 * i))/256.0, 1); + s->delayread[i] = fmod(s->delayread[i] + (1 + ((2&i) - 1)*(0.2 * i))/127.0, 1); double r = s->delayread[i] * 1024; int ri = floor(r); double rf = r - ri;
diff @ 2012-02-18 19:50:28 +0000 diff --git a/src/go.c b/src/go.c index cd48d1a..25bfc23 100644 --- a/src/go.c +++ b/src/go.c @@ -39,7 +39,7 @@ float go(S *s, float x) { double pr = 0.7; double qx = pr * cos(pa); double qy = pr * sin(pa); - double px = s->px * qx - qy * s->py + o * 4; + double px = s->px * qx - qy * s->py + o; double py = s->px * qy + qx * s->py; s->px = px; s->py = py;
diff @ 2012-02-18 19:50:38 +0000 diff --git a/src/go.c b/src/go.c index 25bfc23..3bb7966 100644 --- a/src/go.c +++ b/src/go.c @@ -46,7 +46,7 @@ float go(S *s, float x) { o += px; s->leak = s->leak * 0.999 + 0.001 * o; o -= s->leak; - s->strong = s->strong * 0.5 + 0.5 * o; + s->strong = s->strong * 0.75 + 0.25 * o; o = s->strong; s->delaywrite = (s->delaywrite + 1) % 1024; s->delayline[s->delaywrite] = sin(PI * s->delaywrite / 1024.0) * tanh(o/13);
diff @ 2012-02-18 19:50:45 +0000 diff --git a/src/go.c b/src/go.c index 3bb7966..1fb0760 100644 --- a/src/go.c +++ b/src/go.c @@ -46,7 +46,7 @@ float go(S *s, float x) { o += px; s->leak = s->leak * 0.999 + 0.001 * o; o -= s->leak; - s->strong = s->strong * 0.75 + 0.25 * o; + s->strong = s->strong * 0.85 + 0.15 * o; o = s->strong; s->delaywrite = (s->delaywrite + 1) % 1024; s->delayline[s->delaywrite] = sin(PI * s->delaywrite / 1024.0) * tanh(o/13);
diff @ 2012-02-18 19:51:00 +0000 diff --git a/src/go.c b/src/go.c index 1fb0760..d7edbd2 100644 --- a/src/go.c +++ b/src/go.c @@ -19,7 +19,7 @@ typedef struct { float go(S *s, float x) { s->t += 1; - s->tempo += 1e-6/SR; + s->tempo += 1e-4/SR; double old_clock = s->clock; s->clock = fmod(s->clock + s->tempo/SR, 1); double tick = s->clock < old_clock;
diff @ 2012-02-18 19:51:11 +0000 diff --git a/src/go.c b/src/go.c index d7edbd2..31158f4 100644 --- a/src/go.c +++ b/src/go.c @@ -44,7 +44,7 @@ float go(S *s, float x) { s->px = px; s->py = py; o += px; - s->leak = s->leak * 0.999 + 0.001 * o; + s->leak = s->leak * 0.99 + 0.01 * o; o -= s->leak; s->strong = s->strong * 0.85 + 0.15 * o; o = s->strong;
diff @ 2012-02-18 19:51:19 +0000 diff --git a/src/go.c b/src/go.c index 31158f4..229401d 100644 --- a/src/go.c +++ b/src/go.c @@ -44,7 +44,7 @@ float go(S *s, float x) { s->px = px; s->py = py; o += px; - s->leak = s->leak * 0.99 + 0.01 * o; + s->leak = s->leak * 0.99999 + 0.0001 * o; o -= s->leak; s->strong = s->strong * 0.85 + 0.15 * o; o = s->strong;
diff @ 2012-02-18 19:51:24 +0000 diff --git a/src/go.c b/src/go.c index 229401d..af51a9d 100644 --- a/src/go.c +++ b/src/go.c @@ -44,7 +44,7 @@ float go(S *s, float x) { s->px = px; s->py = py; o += px; - s->leak = s->leak * 0.99999 + 0.0001 * o; + s->leak = s->leak * 0.9999 + 0.0001 * o; o -= s->leak; s->strong = s->strong * 0.85 + 0.15 * o; o = s->strong;
diff @ 2012-02-18 19:51:27 +0000 diff --git a/src/go.c b/src/go.c index af51a9d..a8f0eed 100644 --- a/src/go.c +++ b/src/go.c @@ -44,7 +44,7 @@ float go(S *s, float x) { s->px = px; s->py = py; o += px; - s->leak = s->leak * 0.9999 + 0.0001 * o; + s->leak = s->leak * 0.9999 + 0.001 * o; o -= s->leak; s->strong = s->strong * 0.85 + 0.15 * o; o = s->strong;
diff @ 2012-02-18 19:51:37 +0000 diff --git a/src/go.c b/src/go.c index a8f0eed..6a187ca 100644 --- a/src/go.c +++ b/src/go.c @@ -46,7 +46,7 @@ float go(S *s, float x) { o += px; s->leak = s->leak * 0.9999 + 0.001 * o; o -= s->leak; - s->strong = s->strong * 0.85 + 0.15 * o; + s->strong = s->strong * 0.95 + 0.05 * o; o = s->strong; s->delaywrite = (s->delaywrite + 1) % 1024; s->delayline[s->delaywrite] = sin(PI * s->delaywrite / 1024.0) * tanh(o/13);
diff @ 2012-02-18 19:51:43 +0000 diff --git a/src/go.c b/src/go.c index 6a187ca..d3c7b00 100644 --- a/src/go.c +++ b/src/go.c @@ -49,6 +49,6 @@ float go(S *s, float x) { s->strong = s->strong * 0.95 + 0.05 * o; o = s->strong; s->delaywrite = (s->delaywrite + 1) % 1024; - s->delayline[s->delaywrite] = sin(PI * s->delaywrite / 1024.0) * tanh(o/13); + s->delayline[s->delaywrite] = sin(PI * s->delaywrite / 1024.0) * tanh(o/12); return o; }
diff @ 2012-02-18 19:51:52 +0000 diff --git a/src/go.c b/src/go.c index d3c7b00..32ecc0f 100644 --- a/src/go.c +++ b/src/go.c @@ -49,6 +49,6 @@ float go(S *s, float x) { s->strong = s->strong * 0.95 + 0.05 * o; o = s->strong; s->delaywrite = (s->delaywrite + 1) % 1024; - s->delayline[s->delaywrite] = sin(PI * s->delaywrite / 1024.0) * tanh(o/12); + s->delayline[s->delaywrite] = sin(PI * s->delaywrite / 1024.0) * tanh(o/9); return o; }
diff @ 2012-02-18 19:51:58 +0000 diff --git a/src/go.c b/src/go.c index 32ecc0f..4b89dba 100644 --- a/src/go.c +++ b/src/go.c @@ -49,6 +49,6 @@ float go(S *s, float x) { s->strong = s->strong * 0.95 + 0.05 * o; o = s->strong; s->delaywrite = (s->delaywrite + 1) % 1024; - s->delayline[s->delaywrite] = sin(PI * s->delaywrite / 1024.0) * tanh(o/9); + s->delayline[s->delaywrite] = sin(PI * s->delaywrite / 1024.0) * tanh(o/5); return o; }
diff @ 2012-02-18 19:52:11 +0000 diff --git a/src/go.c b/src/go.c index 4b89dba..a623df6 100644 --- a/src/go.c +++ b/src/go.c @@ -29,7 +29,7 @@ float go(S *s, float x) { s->e *= 0.999; s->e += tick; for (int i = 0; i < 8; ++i) { - s->delayread[i] = fmod(s->delayread[i] + (1 + ((2&i) - 1)*(0.2 * i))/127.0, 1); + s->delayread[i] = fmod(s->delayread[i] + (1 + ((2&i) - 1)*(0.3 * i))*48/SR, 1); double r = s->delayread[i] * 1024; int ri = floor(r); double rf = r - ri;
diff @ 2012-02-18 19:52:23 +0000 diff --git a/src/go.c b/src/go.c index a623df6..adabd17 100644 --- a/src/go.c +++ b/src/go.c @@ -29,7 +29,7 @@ float go(S *s, float x) { s->e *= 0.999; s->e += tick; for (int i = 0; i < 8; ++i) { - s->delayread[i] = fmod(s->delayread[i] + (1 + ((2&i) - 1)*(0.3 * i))*48/SR, 1); + s->delayread[i] = fmod(s->delayread[i] + (1 + ((2&i) - 1)*(i))*48/SR, 1); double r = s->delayread[i] * 1024; int ri = floor(r); double rf = r - ri;
diff @ 2012-02-18 19:52:39 +0000 diff --git a/src/go.c b/src/go.c index adabd17..a91e7b5 100644 --- a/src/go.c +++ b/src/go.c @@ -29,7 +29,7 @@ float go(S *s, float x) { s->e *= 0.999; s->e += tick; for (int i = 0; i < 8; ++i) { - s->delayread[i] = fmod(s->delayread[i] + (1 + ((2&i) - 1)*(i))*48/SR, 1); + s->delayread[i] = fmod(s->delayread[i] + (48+(2&i) - 1)*(i))/SR, 1); double r = s->delayread[i] * 1024; int ri = floor(r); double rf = r - ri;
diff @ 2012-02-18 19:52:54 +0000 diff --git a/src/go.c b/src/go.c index a91e7b5..7e1b643 100644 --- a/src/go.c +++ b/src/go.c @@ -29,7 +29,7 @@ float go(S *s, float x) { s->e *= 0.999; s->e += tick; for (int i = 0; i < 8; ++i) { - s->delayread[i] = fmod(s->delayread[i] + (48+(2&i) - 1)*(i))/SR, 1); + s->delayread[i] = fmod(s->delayread[i] + (48+(2&i) - 1)*i)/SR, 1); double r = s->delayread[i] * 1024; int ri = floor(r); double rf = r - ri;
diff @ 2012-02-18 19:53:14 +0000 diff --git a/src/go.c b/src/go.c index 7e1b643..f7c5b80 100644 --- a/src/go.c +++ b/src/go.c @@ -29,7 +29,7 @@ float go(S *s, float x) { s->e *= 0.999; s->e += tick; for (int i = 0; i < 8; ++i) { - s->delayread[i] = fmod(s->delayread[i] + (48+(2&i) - 1)*i)/SR, 1); + s->delayread[i] = fmod(s->delayread[i] + (48+(2&i - 1)*i)/SR, 1); double r = s->delayread[i] * 1024; int ri = floor(r); double rf = r - ri;
diff @ 2012-02-18 19:53:21 +0000 diff --git a/src/go.c b/src/go.c index f7c5b80..39e5076 100644 --- a/src/go.c +++ b/src/go.c @@ -29,7 +29,7 @@ float go(S *s, float x) { s->e *= 0.999; s->e += tick; for (int i = 0; i < 8; ++i) { - s->delayread[i] = fmod(s->delayread[i] + (48+(2&i - 1)*i)/SR, 1); + s->delayread[i] = fmod(s->delayread[i] + (48+((2&i) - 1)*i)/SR, 1); double r = s->delayread[i] * 1024; int ri = floor(r); double rf = r - ri;
diff @ 2012-02-18 19:53:35 +0000 diff --git a/src/go.c b/src/go.c index 39e5076..022acbe 100644 --- a/src/go.c +++ b/src/go.c @@ -29,7 +29,7 @@ float go(S *s, float x) { s->e *= 0.999; s->e += tick; for (int i = 0; i < 8; ++i) { - s->delayread[i] = fmod(s->delayread[i] + (48+((2&i) - 1)*i)/SR, 1); + s->delayread[i] = fmod(s->delayread[i] + (49+((2&i) - 1)*i)/SR, 1); double r = s->delayread[i] * 1024; int ri = floor(r); double rf = r - ri;
diff @ 2012-02-18 19:54:28 +0000 diff --git a/src/go.c b/src/go.c index 022acbe..24ad29b 100644 --- a/src/go.c +++ b/src/go.c @@ -48,7 +48,12 @@ float go(S *s, float x) { o -= s->leak; s->strong = s->strong * 0.95 + 0.05 * o; o = s->strong; - s->delaywrite = (s->delaywrite + 1) % 1024; - s->delayline[s->delaywrite] = sin(PI * s->delaywrite / 1024.0) * tanh(o/5); + if (s->tick) { + s->delaywrite = 0; + } + s->delaywrite = s->delaywrite + 1; + if (s->delaywrite < 1024) { + s->delayline[s->delaywrite] = sin(PI * s->delaywrite / 1024.0) * tanh(o/5); + } return o; }
diff @ 2012-02-18 19:54:32 +0000 diff --git a/src/go.c b/src/go.c index 24ad29b..0b4c6b8 100644 --- a/src/go.c +++ b/src/go.c @@ -48,7 +48,7 @@ float go(S *s, float x) { o -= s->leak; s->strong = s->strong * 0.95 + 0.05 * o; o = s->strong; - if (s->tick) { + if (tick) { s->delaywrite = 0; } s->delaywrite = s->delaywrite + 1;
diff @ 2012-02-18 19:54:46 +0000 diff --git a/src/go.c b/src/go.c index 0b4c6b8..d6584b4 100644 --- a/src/go.c +++ b/src/go.c @@ -21,7 +21,7 @@ float go(S *s, float x) { s->t += 1; s->tempo += 1e-4/SR; double old_clock = s->clock; - s->clock = fmod(s->clock + s->tempo/SR, 1); + s->clock = fmod(s->clock + 2/SR, 1); double tick = s->clock < old_clock; s->radioactivity = 0; double decay = rand() / (double) RAND_MAX < s->radioactivity;
diff @ 2012-02-18 19:55:16 +0000 diff --git a/src/go.c b/src/go.c index d6584b4..9fce296 100644 --- a/src/go.c +++ b/src/go.c @@ -43,7 +43,7 @@ float go(S *s, float x) { double py = s->px * qy + qx * s->py; s->px = px; s->py = py; - o += px; +// o += px; s->leak = s->leak * 0.9999 + 0.001 * o; o -= s->leak; s->strong = s->strong * 0.95 + 0.05 * o;
diff @ 2012-02-18 19:55:26 +0000 diff --git a/src/go.c b/src/go.c index 9fce296..dafc5ca 100644 --- a/src/go.c +++ b/src/go.c @@ -46,8 +46,8 @@ float go(S *s, float x) { // o += px; s->leak = s->leak * 0.9999 + 0.001 * o; o -= s->leak; - s->strong = s->strong * 0.95 + 0.05 * o; - o = s->strong; +// s->strong = s->strong * 0.95 + 0.05 * o; +// o = s->strong; if (tick) { s->delaywrite = 0; }
diff @ 2012-02-18 19:55:44 +0000 diff --git a/src/go.c b/src/go.c index dafc5ca..639f778 100644 --- a/src/go.c +++ b/src/go.c @@ -29,7 +29,7 @@ float go(S *s, float x) { s->e *= 0.999; s->e += tick; for (int i = 0; i < 8; ++i) { - s->delayread[i] = fmod(s->delayread[i] + (49+((2&i) - 1)*i)/SR, 1); + s->delayread[i] = fmod(s->delayread[i] + 49/SR, 1); double r = s->delayread[i] * 1024; int ri = floor(r); double rf = r - ri;
diff @ 2012-02-18 19:56:07 +0000 diff --git a/src/go.c b/src/go.c index 639f778..2f71595 100644 --- a/src/go.c +++ b/src/go.c @@ -29,7 +29,7 @@ float go(S *s, float x) { s->e *= 0.999; s->e += tick; for (int i = 0; i < 8; ++i) { - s->delayread[i] = fmod(s->delayread[i] + 49/SR, 1); + s->delayread[i] = fmod(s->delayread[i] + (49 + (i / 1024))/SR, 1); double r = s->delayread[i] * 1024; int ri = floor(r); double rf = r - ri;
diff @ 2012-02-18 19:56:15 +0000 diff --git a/src/go.c b/src/go.c index 2f71595..699ac34 100644 --- a/src/go.c +++ b/src/go.c @@ -29,7 +29,7 @@ float go(S *s, float x) { s->e *= 0.999; s->e += tick; for (int i = 0; i < 8; ++i) { - s->delayread[i] = fmod(s->delayread[i] + (49 + (i / 1024))/SR, 1); + s->delayread[i] = fmod(s->delayread[i] + (49 + (i / 1024.0))/SR, 1); double r = s->delayread[i] * 1024; int ri = floor(r); double rf = r - ri;
diff @ 2012-02-18 19:56:42 +0000 diff --git a/src/go.c b/src/go.c index 699ac34..4716ad1 100644 --- a/src/go.c +++ b/src/go.c @@ -29,7 +29,7 @@ float go(S *s, float x) { s->e *= 0.999; s->e += tick; for (int i = 0; i < 8; ++i) { - s->delayread[i] = fmod(s->delayread[i] + (49 + (i / 1024.0))/SR, 1); + s->delayread[i] = fmod(s->delayread[i] + (49 + (i / 1024.0))/SR, 0.5); double r = s->delayread[i] * 1024; int ri = floor(r); double rf = r - ri;
diff @ 2012-02-18 19:56:56 +0000 diff --git a/src/go.c b/src/go.c index 4716ad1..54043a5 100644 --- a/src/go.c +++ b/src/go.c @@ -25,7 +25,7 @@ float go(S *s, float x) { double tick = s->clock < old_clock; s->radioactivity = 0; double decay = rand() / (double) RAND_MAX < s->radioactivity; - double o = (((s->t>>10) & 0xFF) - 0x80) / 0x80; + double o = 0.125 * (((s->t>>10) & 0xFF) - 0x80) / 0x80; s->e *= 0.999; s->e += tick; for (int i = 0; i < 8; ++i) {
diff @ 2012-02-18 19:57:04 +0000 diff --git a/src/go.c b/src/go.c index 54043a5..e0d0b57 100644 --- a/src/go.c +++ b/src/go.c @@ -25,7 +25,7 @@ float go(S *s, float x) { double tick = s->clock < old_clock; s->radioactivity = 0; double decay = rand() / (double) RAND_MAX < s->radioactivity; - double o = 0.125 * (((s->t>>10) & 0xFF) - 0x80) / 0x80; + double o = 0.00125 * (((s->t>>10) & 0xFF) - 0x80) / 0x80; s->e *= 0.999; s->e += tick; for (int i = 0; i < 8; ++i) {
diff @ 2012-02-18 19:57:31 +0000 diff --git a/src/go.c b/src/go.c index e0d0b57..9774188 100644 --- a/src/go.c +++ b/src/go.c @@ -35,7 +35,7 @@ float go(S *s, float x) { double rf = r - ri; o += s->delayline[ri] * (1 - rf) + rf * s->delayline[(ri + 1)%1024]; } - double pa = 2 * PI * (777 + 600 * s->e) / SR; + double pa = 2 * PI * (777 + 6000 * s->e) / SR; double pr = 0.7; double qx = pr * cos(pa); double qy = pr * sin(pa);
diff @ 2012-02-18 19:57:37 +0000 diff --git a/src/go.c b/src/go.c index 9774188..a1b016c 100644 --- a/src/go.c +++ b/src/go.c @@ -43,7 +43,7 @@ float go(S *s, float x) { double py = s->px * qy + qx * s->py; s->px = px; s->py = py; -// o += px; + o += px; s->leak = s->leak * 0.9999 + 0.001 * o; o -= s->leak; // s->strong = s->strong * 0.95 + 0.05 * o;
diff @ 2012-02-18 19:58:24 +0000 diff --git a/src/go.c b/src/go.c index a1b016c..27a079d 100644 --- a/src/go.c +++ b/src/go.c @@ -44,7 +44,7 @@ float go(S *s, float x) { s->px = px; s->py = py; o += px; - s->leak = s->leak * 0.9999 + 0.001 * o; + s->leak = s->leak * 0.999 + 0.001 * o; o -= s->leak; // s->strong = s->strong * 0.95 + 0.05 * o; // o = s->strong;
diff @ 2012-02-18 19:59:45 +0000 diff --git a/src/go.c b/src/go.c index 27a079d..dacd829 100644 --- a/src/go.c +++ b/src/go.c @@ -15,21 +15,25 @@ typedef struct { double tempo; double strong; int t; + int k; } S; float go(S *s, float x) { + s->k = 1024; s->t += 1; s->tempo += 1e-4/SR; double old_clock = s->clock; s->clock = fmod(s->clock + 2/SR, 1); double tick = s->clock < old_clock; + if (tick) { s->k--; } + if (! s->k) { s->k = 1024; } s->radioactivity = 0; double decay = rand() / (double) RAND_MAX < s->radioactivity; double o = 0.00125 * (((s->t>>10) & 0xFF) - 0x80) / 0x80; s->e *= 0.999; s->e += tick; for (int i = 0; i < 8; ++i) { - s->delayread[i] = fmod(s->delayread[i] + (49 + (i / 1024.0))/SR, 0.5); + s->delayread[i] = fmod(s->delayread[i] + (49 + (i / (double) (s->k + 1)))/SR, 0.5); double r = s->delayread[i] * 1024; int ri = floor(r); double rf = r - ri;
diff @ 2012-02-18 19:59:48 +0000 diff --git a/src/go.c b/src/go.c index dacd829..c54d395 100644 --- a/src/go.c +++ b/src/go.c @@ -19,7 +19,7 @@ typedef struct { } S; float go(S *s, float x) { - s->k = 1024; +// s->k = 1024; s->t += 1; s->tempo += 1e-4/SR; double old_clock = s->clock;
diff @ 2012-02-18 20:00:22 +0000 diff --git a/src/go.c b/src/go.c index c54d395..1ae6e1f 100644 --- a/src/go.c +++ b/src/go.c @@ -33,7 +33,7 @@ float go(S *s, float x) { s->e *= 0.999; s->e += tick; for (int i = 0; i < 8; ++i) { - s->delayread[i] = fmod(s->delayread[i] + (49 + (i / (double) (s->k + 1)))/SR, 0.5); + s->delayread[i] = fmod(s->delayread[i] + (49 + (16 * i / (double) (s->k + 1)))/SR, 0.5); double r = s->delayread[i] * 1024; int ri = floor(r); double rf = r - ri;
diff @ 2012-02-18 20:00:52 +0000 diff --git a/src/go.c b/src/go.c index 1ae6e1f..df75c03 100644 --- a/src/go.c +++ b/src/go.c @@ -21,11 +21,11 @@ typedef struct { float go(S *s, float x) { // s->k = 1024; s->t += 1; - s->tempo += 1e-4/SR; + s->tempo = 2;; double old_clock = s->clock; s->clock = fmod(s->clock + 2/SR, 1); double tick = s->clock < old_clock; - if (tick) { s->k--; } + if (tick) { s->k--; s->tempo *= 0.9999; } if (! s->k) { s->k = 1024; } s->radioactivity = 0; double decay = rand() / (double) RAND_MAX < s->radioactivity;
diff @ 2012-02-18 20:00:59 +0000 diff --git a/src/go.c b/src/go.c index df75c03..480d624 100644 --- a/src/go.c +++ b/src/go.c @@ -21,9 +21,9 @@ typedef struct { float go(S *s, float x) { // s->k = 1024; s->t += 1; - s->tempo = 2;; + s->tempo = 2; double old_clock = s->clock; - s->clock = fmod(s->clock + 2/SR, 1); + s->clock = fmod(s->clock + s->tempo/SR, 1); double tick = s->clock < old_clock; if (tick) { s->k--; s->tempo *= 0.9999; } if (! s->k) { s->k = 1024; }
diff @ 2012-02-18 20:01:18 +0000 diff --git a/src/go.c b/src/go.c index 480d624..f5a81fa 100644 --- a/src/go.c +++ b/src/go.c @@ -57,7 +57,7 @@ float go(S *s, float x) { } s->delaywrite = s->delaywrite + 1; if (s->delaywrite < 1024) { - s->delayline[s->delaywrite] = sin(PI * s->delaywrite / 1024.0) * tanh(o/5); + s->delayline[s->delaywrite] = sin(PI * s->delaywrite / 1024.0) * tanh(o/6); } return o; }
diff @ 2012-02-18 20:01:38 +0000 diff --git a/src/go.c b/src/go.c index f5a81fa..beadf27 100644 --- a/src/go.c +++ b/src/go.c @@ -39,7 +39,7 @@ float go(S *s, float x) { double rf = r - ri; o += s->delayline[ri] * (1 - rf) + rf * s->delayline[(ri + 1)%1024]; } - double pa = 2 * PI * (777 + 6000 * s->e) / SR; + double pa = 2 * PI * (777 + 600 * s->e) / SR; double pr = 0.7; double qx = pr * cos(pa); double qy = pr * sin(pa);
diff @ 2012-02-18 20:01:44 +0000 diff --git a/src/go.c b/src/go.c index beadf27..b5441bc 100644 --- a/src/go.c +++ b/src/go.c @@ -39,7 +39,7 @@ float go(S *s, float x) { double rf = r - ri; o += s->delayline[ri] * (1 - rf) + rf * s->delayline[(ri + 1)%1024]; } - double pa = 2 * PI * (777 + 600 * s->e) / SR; + double pa = 2 * PI * (60 + 600 * s->e) / SR; double pr = 0.7; double qx = pr * cos(pa); double qy = pr * sin(pa);
diff @ 2012-02-18 20:01:54 +0000 diff --git a/src/go.c b/src/go.c index b5441bc..d337270 100644 --- a/src/go.c +++ b/src/go.c @@ -25,7 +25,7 @@ float go(S *s, float x) { double old_clock = s->clock; s->clock = fmod(s->clock + s->tempo/SR, 1); double tick = s->clock < old_clock; - if (tick) { s->k--; s->tempo *= 0.9999; } + if (tick) { s->k--; s->tempo *= 0.999; } if (! s->k) { s->k = 1024; } s->radioactivity = 0; double decay = rand() / (double) RAND_MAX < s->radioactivity;
diff @ 2012-02-18 20:02:51 +0000 diff --git a/src/go.c b/src/go.c index d337270..56b640b 100644 --- a/src/go.c +++ b/src/go.c @@ -27,6 +27,7 @@ float go(S *s, float x) { double tick = s->clock < old_clock; if (tick) { s->k--; s->tempo *= 0.999; } if (! s->k) { s->k = 1024; } + if (s->tempo < 0.0001) { s->tempo = * (double*) 0; } s->radioactivity = 0; double decay = rand() / (double) RAND_MAX < s->radioactivity; double o = 0.00125 * (((s->t>>10) & 0xFF) - 0x80) / 0x80;
diff @ 2012-02-18 20:02:57 +0000 diff --git a/src/go.c b/src/go.c index 56b640b..208e4b5 100644 --- a/src/go.c +++ b/src/go.c @@ -25,7 +25,7 @@ float go(S *s, float x) { double old_clock = s->clock; s->clock = fmod(s->clock + s->tempo/SR, 1); double tick = s->clock < old_clock; - if (tick) { s->k--; s->tempo *= 0.999; } + if (tick) { s->k--; s->tempo *= 0.99; } if (! s->k) { s->k = 1024; } if (s->tempo < 0.0001) { s->tempo = * (double*) 0; } s->radioactivity = 0;
diff @ 2012-02-18 20:03:18 +0000 diff --git a/src/go.c b/src/go.c index 208e4b5..0ee06d4 100644 --- a/src/go.c +++ b/src/go.c @@ -21,11 +21,10 @@ typedef struct { float go(S *s, float x) { // s->k = 1024; s->t += 1; - s->tempo = 2; double old_clock = s->clock; s->clock = fmod(s->clock + s->tempo/SR, 1); double tick = s->clock < old_clock; - if (tick) { s->k--; s->tempo *= 0.99; } + if (tick) { s->k--; s->tempo *= 0.999; } if (! s->k) { s->k = 1024; } if (s->tempo < 0.0001) { s->tempo = * (double*) 0; } s->radioactivity = 0;
diff @ 2012-02-18 20:03:39 +0000 diff --git a/src/go.c b/src/go.c index 0ee06d4..6728201 100644 --- a/src/go.c +++ b/src/go.c @@ -33,7 +33,7 @@ float go(S *s, float x) { s->e *= 0.999; s->e += tick; for (int i = 0; i < 8; ++i) { - s->delayread[i] = fmod(s->delayread[i] + (49 + (16 * i / (double) (s->k + 1)))/SR, 0.5); + s->delayread[i] = fmod(s->delayread[i] + (49 + (17 * i / (double) (s->k + 1)))/SR, 0.5); double r = s->delayread[i] * 1024; int ri = floor(r); double rf = r - ri; @@ -50,8 +50,6 @@ float go(S *s, float x) { o += px; s->leak = s->leak * 0.999 + 0.001 * o; o -= s->leak; -// s->strong = s->strong * 0.95 + 0.05 * o; -// o = s->strong; if (tick) { s->delaywrite = 0; }
diff @ 2012-02-18 20:03:58 +0000 diff --git a/src/go.c b/src/go.c index 6728201..89458b5 100644 --- a/src/go.c +++ b/src/go.c @@ -27,8 +27,6 @@ float go(S *s, float x) { if (tick) { s->k--; s->tempo *= 0.999; } if (! s->k) { s->k = 1024; } if (s->tempo < 0.0001) { s->tempo = * (double*) 0; } - s->radioactivity = 0; - double decay = rand() / (double) RAND_MAX < s->radioactivity; double o = 0.00125 * (((s->t>>10) & 0xFF) - 0x80) / 0x80; s->e *= 0.999; s->e += tick; @@ -40,7 +38,7 @@ float go(S *s, float x) { o += s->delayline[ri] * (1 - rf) + rf * s->delayline[(ri + 1)%1024]; } double pa = 2 * PI * (60 + 600 * s->e) / SR; - double pr = 0.7; + double pr = 0.8; double qx = pr * cos(pa); double qy = pr * sin(pa); double px = s->px * qx - qy * s->py + o;
diff @ 2012-02-18 20:04:12 +0000 diff --git a/src/go.c b/src/go.c index 89458b5..86e6eda 100644 --- a/src/go.c +++ b/src/go.c @@ -28,7 +28,7 @@ float go(S *s, float x) { if (! s->k) { s->k = 1024; } if (s->tempo < 0.0001) { s->tempo = * (double*) 0; } double o = 0.00125 * (((s->t>>10) & 0xFF) - 0x80) / 0x80; - s->e *= 0.999; + s->e *= 0.995; s->e += tick; for (int i = 0; i < 8; ++i) { s->delayread[i] = fmod(s->delayread[i] + (49 + (17 * i / (double) (s->k + 1)))/SR, 0.5);
diff @ 2012-02-18 20:04:40 +0000 diff --git a/src/go.c b/src/go.c index 86e6eda..ac4b48e 100644 --- a/src/go.c +++ b/src/go.c @@ -24,9 +24,9 @@ float go(S *s, float x) { double old_clock = s->clock; s->clock = fmod(s->clock + s->tempo/SR, 1); double tick = s->clock < old_clock; - if (tick) { s->k--; s->tempo *= 0.999; } + if (tick) { s->k--; s->tempo *= 1.01; } if (! s->k) { s->k = 1024; } - if (s->tempo < 0.0001) { s->tempo = * (double*) 0; } + if (s->tempo > 1000) { s->tempo = * (double*) 0; } double o = 0.00125 * (((s->t>>10) & 0xFF) - 0x80) / 0x80; s->e *= 0.995; s->e += tick;