clive is an audio live-coding skeleton for the C programming language
diff @ 2019-11-11 17:22:35 +0000 diff --git a/client/go.c b/client/go.c index 08b1847..72a9a3a 100644 --- a/client/go.c +++ b/client/go.c @@ -58,7 +58,7 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { sample kkHz = 60 + 0 * 10 * floor(4 * t); // pitch, quantisation in value kick = biquad(highpass(&s->kickbq, kkHz, kkQ), kick); // filter // kick = tanh(2 * kick); // distortion - sample kick_gain = 1; // amplify + sample kick_gain = 0; // amplify kick *= kick_gain; mixdown[0] += kick; mixdown[1] += kick; @@ -83,7 +83,7 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { sample crush = phasor(&s->crush, 4000 * pow(1, cos(twopi * t))); // sn[0] = samphold(&s->snaresh[0], sn[0], crush); // sn[1] = samphold(&s->snaresh[1], sn[1], crush); - sample snare_gain = 0; + sample snare_gain = 1; sn[0] *= snare_gain; sn[1] *= snare_gain; mixdown[0] += sn[0];
diff @ 2019-11-11 17:22:39 +0000 diff --git a/client/go.c b/client/go.c index 72a9a3a..5c98f77 100644 --- a/client/go.c +++ b/client/go.c @@ -58,7 +58,7 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { sample kkHz = 60 + 0 * 10 * floor(4 * t); // pitch, quantisation in value kick = biquad(highpass(&s->kickbq, kkHz, kkQ), kick); // filter // kick = tanh(2 * kick); // distortion - sample kick_gain = 0; // amplify + sample kick_gain = 1; // amplify kick *= kick_gain; mixdown[0] += kick; mixdown[1] += kick;
diff @ 2019-11-11 17:22:54 +0000 diff --git a/client/go.c b/client/go.c index 5c98f77..33423ba 100644 --- a/client/go.c +++ b/client/go.c @@ -73,7 +73,7 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { { snare * noise() , snare * noise() }; - sample snQ = flatq; // resonance + sample snQ = 10; // resonance sample snHz = 600; // pitch sn[0] = vcf(&s->snarevcf[0], snQ * sn[0], snHz, snQ); // filter sn[1] = vcf(&s->snarevcf[1], snQ * sn[1], snHz, snQ);
diff @ 2019-11-11 17:23:08 +0000 diff --git a/client/go.c b/client/go.c index 33423ba..a8cfc50 100644 --- a/client/go.c +++ b/client/go.c @@ -54,7 +54,7 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { kick *= kick; kick *= kick; kick = kick * sin(12 * twopi * kick); // shape into waveform - sample kkQ = flatq; // resonance + sample kkQ = 30; // resonance sample kkHz = 60 + 0 * 10 * floor(4 * t); // pitch, quantisation in value kick = biquad(highpass(&s->kickbq, kkHz, kkQ), kick); // filter // kick = tanh(2 * kick); // distortion
diff @ 2019-11-11 17:23:15 +0000 diff --git a/client/go.c b/client/go.c index a8cfc50..057df75 100644 --- a/client/go.c +++ b/client/go.c @@ -57,7 +57,7 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { sample kkQ = 30; // resonance sample kkHz = 60 + 0 * 10 * floor(4 * t); // pitch, quantisation in value kick = biquad(highpass(&s->kickbq, kkHz, kkQ), kick); // filter -// kick = tanh(2 * kick); // distortion + kick = tanh(2 * kick); // distortion sample kick_gain = 1; // amplify kick *= kick_gain; mixdown[0] += kick;
diff @ 2019-11-11 17:23:22 +0000 diff --git a/client/go.c b/client/go.c index 057df75..81219fb 100644 --- a/client/go.c +++ b/client/go.c @@ -55,7 +55,7 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { kick *= kick; kick = kick * sin(12 * twopi * kick); // shape into waveform sample kkQ = 30; // resonance - sample kkHz = 60 + 0 * 10 * floor(4 * t); // pitch, quantisation in value + sample kkHz = 60 + 10 * floor(4 * t); // pitch, quantisation in value kick = biquad(highpass(&s->kickbq, kkHz, kkQ), kick); // filter kick = tanh(2 * kick); // distortion sample kick_gain = 1; // amplify
diff @ 2019-11-11 17:23:37 +0000 diff --git a/client/go.c b/client/go.c index 81219fb..e0449aa 100644 --- a/client/go.c +++ b/client/go.c @@ -81,8 +81,8 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { sn[1] = sin(4 * sn[1]); // quantisation in time (bit-crush effect) sample crush = phasor(&s->crush, 4000 * pow(1, cos(twopi * t))); -// sn[0] = samphold(&s->snaresh[0], sn[0], crush); -// sn[1] = samphold(&s->snaresh[1], sn[1], crush); + sn[0] = samphold(&s->snaresh[0], sn[0], crush); + sn[1] = samphold(&s->snaresh[1], sn[1], crush); sample snare_gain = 1; sn[0] *= snare_gain; sn[1] *= snare_gain;
diff @ 2019-11-11 17:23:44 +0000 diff --git a/client/go.c b/client/go.c index e0449aa..f118b59 100644 --- a/client/go.c +++ b/client/go.c @@ -80,7 +80,7 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { sn[0] = sin(4 * sn[0]); // distortion sn[1] = sin(4 * sn[1]); // quantisation in time (bit-crush effect) - sample crush = phasor(&s->crush, 4000 * pow(1, cos(twopi * t))); + sample crush = phasor(&s->crush, 4000 * pow(2, cos(twopi * t))); sn[0] = samphold(&s->snaresh[0], sn[0], crush); sn[1] = samphold(&s->snaresh[1], sn[1], crush); sample snare_gain = 1;
diff @ 2019-11-11 17:23:58 +0000 diff --git a/client/go.c b/client/go.c index f118b59..16f0055 100644 --- a/client/go.c +++ b/client/go.c @@ -118,7 +118,7 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { // feedin from mix, feedback to mix and delays sample feedin = 1; - sample feedback = 0; + sample feedback = 1; mixdown[0] *= feedin; mixdown[1] *= feedin; del[0] *= feedback;
diff @ 2019-11-11 17:24:06 +0000 diff --git a/client/go.c b/client/go.c index 16f0055..bdafc33 100644 --- a/client/go.c +++ b/client/go.c @@ -117,7 +117,7 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { } // feedin from mix, feedback to mix and delays - sample feedin = 1; + sample feedin = 0; sample feedback = 1; mixdown[0] *= feedin; mixdown[1] *= feedin;
diff @ 2019-11-11 17:24:10 +0000 diff --git a/client/go.c b/client/go.c index bdafc33..09b1ccb 100644 --- a/client/go.c +++ b/client/go.c @@ -118,7 +118,7 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { // feedin from mix, feedback to mix and delays sample feedin = 0; - sample feedback = 1; + sample feedback = 10; mixdown[0] *= feedin; mixdown[1] *= feedin; del[0] *= feedback;
diff @ 2019-11-11 17:24:23 +0000 diff --git a/client/go.c b/client/go.c index 09b1ccb..82d74ae 100644 --- a/client/go.c +++ b/client/go.c @@ -93,8 +93,8 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { s->delay1.length = 4 * SR; // should match delay1buf array size s->delay2.length = 4 * SR; // should match delay2buf array size sample ms[2] = // delay times in milliseconds per beat * fractions of a beat - { (1000 * 60 / s->bpm) * (wrap(1 * t) < 1 ? 4. / 4 : 1. / 64) - , (1000 * 60 / s->bpm) * (wrap(2 * t) < 1 ? 4. / 4 : 1. / 48) + { (1000 * 60 / s->bpm) * (wrap(1 * t) < 0.75 ? 4. / 4 : 1. / 64) + , (1000 * 60 / s->bpm) * (wrap(2 * t) < 0.5 ? 4. / 4 : 1. / 48) }; ms[0] = lop(&s->lag[0], ms[0], 3); // make changes gradual ms[1] = lop(&s->lag[1], ms[1], 3);
diff @ 2019-11-11 17:24:42 +0000 diff --git a/client/go.c b/client/go.c index 82d74ae..ad53fbf 100644 --- a/client/go.c +++ b/client/go.c @@ -127,10 +127,10 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { del[1] += mixdown[1]; // dynamic range compression with band pass filter - del[0] = hip(&s->hip[0], del[0], 10); // high pass - del[1] = hip(&s->hip[1], del[1], 10); - del[0] = lop(&s->lop[0], del[0], 10000); // low pass - del[1] = lop(&s->lop[1], del[1], 10000); + del[0] = hip(&s->hip[0], del[0], 100); // high pass + del[1] = hip(&s->hip[1], del[1], 100); + del[0] = lop(&s->lop[0], del[0], 1000); // low pass + del[1] = lop(&s->lop[1], del[1], 1000); compress(del, &s->compress, 5, 10, 25, 48, del); // write to delay lines
diff @ 2019-11-11 17:25:03 +0000 diff --git a/client/go.c b/client/go.c index ad53fbf..64c8788 100644 --- a/client/go.c +++ b/client/go.c @@ -64,7 +64,7 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { mixdown[1] += kick; // simple snare drum - sample snare = 1 - wrap(2 * bar + 0.5); // ramp + sample snare = 1 - wrap(4 * bar + 0.5); // ramp snare *= snare; // make curved snare *= snare; snare *= snare; @@ -117,7 +117,7 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { } // feedin from mix, feedback to mix and delays - sample feedin = 0; + sample feedin = 1; sample feedback = 10; mixdown[0] *= feedin; mixdown[1] *= feedin;
diff @ 2019-11-11 17:25:32 +0000 diff --git a/client/go.c b/client/go.c index 64c8788..74c4ca2 100644 --- a/client/go.c +++ b/client/go.c @@ -49,7 +49,7 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { sample mixdown[2] = { 0, 0 }; // simple kick drum - sample kick = 1 - beat; // descending ramp + sample kick = 1 - wrap(8./3 * bar); // descending ramp kick *= kick; // make curved kick *= kick; kick *= kick;
diff @ 2019-11-11 17:25:46 +0000 diff --git a/client/go.c b/client/go.c index 74c4ca2..8343cde 100644 --- a/client/go.c +++ b/client/go.c @@ -64,7 +64,7 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { mixdown[1] += kick; // simple snare drum - sample snare = 1 - wrap(4 * bar + 0.5); // ramp + sample snare = 1 - wrap(16 * bar); // ramp snare *= snare; // make curved snare *= snare; snare *= snare;
diff @ 2019-11-11 17:25:54 +0000 diff --git a/client/go.c b/client/go.c index 8343cde..0ca5c64 100644 --- a/client/go.c +++ b/client/go.c @@ -68,7 +68,6 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { snare *= snare; // make curved snare *= snare; snare *= snare; - snare *= snare; sample sn[2] = // shape into waveform { snare * noise() , snare * noise()
diff @ 2019-11-11 17:26:01 +0000 diff --git a/client/go.c b/client/go.c index 0ca5c64..48eb87f 100644 --- a/client/go.c +++ b/client/go.c @@ -58,7 +58,7 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { sample kkHz = 60 + 10 * floor(4 * t); // pitch, quantisation in value kick = biquad(highpass(&s->kickbq, kkHz, kkQ), kick); // filter kick = tanh(2 * kick); // distortion - sample kick_gain = 1; // amplify + sample kick_gain = 0; // amplify kick *= kick_gain; mixdown[0] += kick; mixdown[1] += kick;
diff @ 2019-11-11 17:26:08 +0000 diff --git a/client/go.c b/client/go.c index 48eb87f..bfaa800 100644 --- a/client/go.c +++ b/client/go.c @@ -67,7 +67,6 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { sample snare = 1 - wrap(16 * bar); // ramp snare *= snare; // make curved snare *= snare; - snare *= snare; sample sn[2] = // shape into waveform { snare * noise() , snare * noise()
diff @ 2019-11-11 17:26:15 +0000 diff --git a/client/go.c b/client/go.c index bfaa800..c6999c7 100644 --- a/client/go.c +++ b/client/go.c @@ -66,7 +66,7 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { // simple snare drum sample snare = 1 - wrap(16 * bar); // ramp snare *= snare; // make curved - snare *= snare; +// snare *= snare; sample sn[2] = // shape into waveform { snare * noise() , snare * noise()
diff @ 2019-11-11 17:26:30 +0000 diff --git a/client/go.c b/client/go.c index c6999c7..781bc77 100644 --- a/client/go.c +++ b/client/go.c @@ -64,9 +64,12 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { mixdown[1] += kick; // simple snare drum - sample snare = 1 - wrap(16 * bar); // ramp + sample snare = 1 - wrap(bar); // ramp snare *= snare; // make curved -// snare *= snare; + snare *= snare; + snare *= snare; + snare *= snare; + snare *= snare; sample sn[2] = // shape into waveform { snare * noise() , snare * noise()
diff @ 2019-11-11 17:26:36 +0000 diff --git a/client/go.c b/client/go.c index 781bc77..072ffe2 100644 --- a/client/go.c +++ b/client/go.c @@ -64,7 +64,7 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { mixdown[1] += kick; // simple snare drum - sample snare = 1 - wrap(bar); // ramp + sample snare = 1 - wrap(bar + 0.5); // ramp snare *= snare; // make curved snare *= snare; snare *= snare;
diff @ 2019-11-11 17:26:52 +0000 diff --git a/client/go.c b/client/go.c index 072ffe2..10652b7 100644 --- a/client/go.c +++ b/client/go.c @@ -55,16 +55,16 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { kick *= kick; kick = kick * sin(12 * twopi * kick); // shape into waveform sample kkQ = 30; // resonance - sample kkHz = 60 + 10 * floor(4 * t); // pitch, quantisation in value + sample kkHz = 40 + 0 * floor(4 * t); // pitch, quantisation in value kick = biquad(highpass(&s->kickbq, kkHz, kkQ), kick); // filter kick = tanh(2 * kick); // distortion - sample kick_gain = 0; // amplify + sample kick_gain = 1; // amplify kick *= kick_gain; mixdown[0] += kick; mixdown[1] += kick; // simple snare drum - sample snare = 1 - wrap(bar + 0.5); // ramp + sample snare = 1 - wrap(2 * bar + 0.5); // ramp snare *= snare; // make curved snare *= snare; snare *= snare;
diff @ 2019-11-11 17:27:14 +0000 diff --git a/client/go.c b/client/go.c index 10652b7..fc8979b 100644 --- a/client/go.c +++ b/client/go.c @@ -106,7 +106,7 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { // matrix rotation for stereo effect { - sample angle = twopi / 24; + sample angle = twopi * t; sample co = cos(angle); sample si = sin(angle); sample tmp[2] =
diff @ 2019-11-11 17:27:24 +0000 diff --git a/client/go.c b/client/go.c index fc8979b..6f64af9 100644 --- a/client/go.c +++ b/client/go.c @@ -94,8 +94,8 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { s->delay1.length = 4 * SR; // should match delay1buf array size s->delay2.length = 4 * SR; // should match delay2buf array size sample ms[2] = // delay times in milliseconds per beat * fractions of a beat - { (1000 * 60 / s->bpm) * (wrap(1 * t) < 0.75 ? 4. / 4 : 1. / 64) - , (1000 * 60 / s->bpm) * (wrap(2 * t) < 0.5 ? 4. / 4 : 1. / 48) + { (1000 * 60 / s->bpm) * (wrap(8 * t) < 0.75 ? 4. / 4 : 1. / 64) + , (1000 * 60 / s->bpm) * (wrap(16 * t) < 0.5 ? 4. / 4 : 1. / 48) }; ms[0] = lop(&s->lag[0], ms[0], 3); // make changes gradual ms[1] = lop(&s->lag[1], ms[1], 3);
diff @ 2019-11-11 17:27:29 +0000 diff --git a/client/go.c b/client/go.c index 6f64af9..292c16b 100644 --- a/client/go.c +++ b/client/go.c @@ -97,8 +97,8 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { { (1000 * 60 / s->bpm) * (wrap(8 * t) < 0.75 ? 4. / 4 : 1. / 64) , (1000 * 60 / s->bpm) * (wrap(16 * t) < 0.5 ? 4. / 4 : 1. / 48) }; - ms[0] = lop(&s->lag[0], ms[0], 3); // make changes gradual - ms[1] = lop(&s->lag[1], ms[1], 3); + ms[0] = lop(&s->lag[0], ms[0], 13); // make changes gradual + ms[1] = lop(&s->lag[1], ms[1], 13); sample del[2] = { delread4(&s->delay1, ms[0]) , delread4(&s->delay2, ms[1])
diff @ 2019-11-11 17:27:49 +0000 diff --git a/client/go.c b/client/go.c index 292c16b..3e5d586 100644 --- a/client/go.c +++ b/client/go.c @@ -94,8 +94,8 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { s->delay1.length = 4 * SR; // should match delay1buf array size s->delay2.length = 4 * SR; // should match delay2buf array size sample ms[2] = // delay times in milliseconds per beat * fractions of a beat - { (1000 * 60 / s->bpm) * (wrap(8 * t) < 0.75 ? 4. / 4 : 1. / 64) - , (1000 * 60 / s->bpm) * (wrap(16 * t) < 0.5 ? 4. / 4 : 1. / 48) + { (1000 * 60 / s->bpm) * (wrap(8 * t) < 0.75 ? 2. / 4 : 1. / 64) + , (1000 * 60 / s->bpm) * (wrap(16 * t) < 0.5 ? 2. / 4 : 1. / 48) }; ms[0] = lop(&s->lag[0], ms[0], 13); // make changes gradual ms[1] = lop(&s->lag[1], ms[1], 13);
diff @ 2019-11-11 17:28:00 +0000 diff --git a/client/go.c b/client/go.c index 3e5d586..b27e6e7 100644 --- a/client/go.c +++ b/client/go.c @@ -94,7 +94,7 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { s->delay1.length = 4 * SR; // should match delay1buf array size s->delay2.length = 4 * SR; // should match delay2buf array size sample ms[2] = // delay times in milliseconds per beat * fractions of a beat - { (1000 * 60 / s->bpm) * (wrap(8 * t) < 0.75 ? 2. / 4 : 1. / 64) + { (1000 * 60 / s->bpm) * (wrap(8 * t) < 0.5 ? 2. / 4 : 1. / 64) , (1000 * 60 / s->bpm) * (wrap(16 * t) < 0.5 ? 2. / 4 : 1. / 48) }; ms[0] = lop(&s->lag[0], ms[0], 13); // make changes gradual
diff @ 2019-11-11 17:28:18 +0000 diff --git a/client/go.c b/client/go.c index b27e6e7..6086cc0 100644 --- a/client/go.c +++ b/client/go.c @@ -118,7 +118,7 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { } // feedin from mix, feedback to mix and delays - sample feedin = 1; + sample feedin = 0; sample feedback = 10; mixdown[0] *= feedin; mixdown[1] *= feedin;
diff @ 2019-11-11 17:28:34 +0000 diff --git a/client/go.c b/client/go.c index 6086cc0..9168254 100644 --- a/client/go.c +++ b/client/go.c @@ -40,6 +40,7 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { // time base s->bpm = 133; // tempo + s->bpm *= 1.000001; // s->time.phase = 0; // freeze time sample t = phasor(&s->time, s->bpm / 60 / 16); sample bar = wrap(4 * t);
diff @ 2019-11-11 17:28:45 +0000 diff --git a/client/go.c b/client/go.c index 9168254..10add3f 100644 --- a/client/go.c +++ b/client/go.c @@ -39,7 +39,7 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { } // time base - s->bpm = 133; // tempo + //s->bpm = 133; // tempo s->bpm *= 1.000001; // s->time.phase = 0; // freeze time sample t = phasor(&s->time, s->bpm / 60 / 16);
diff @ 2019-11-11 17:29:16 +0000 diff --git a/client/go.c b/client/go.c index 10add3f..71b06d5 100644 --- a/client/go.c +++ b/client/go.c @@ -39,8 +39,8 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { } // time base - //s->bpm = 133; // tempo - s->bpm *= 1.000001; + s->bpm = 1; // tempo + //s->bpm *= 1.000001; // s->time.phase = 0; // freeze time sample t = phasor(&s->time, s->bpm / 60 / 16); sample bar = wrap(4 * t);
diff @ 2019-11-11 17:29:29 +0000 diff --git a/client/go.c b/client/go.c index 71b06d5..b5282a6 100644 --- a/client/go.c +++ b/client/go.c @@ -131,8 +131,8 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { // dynamic range compression with band pass filter del[0] = hip(&s->hip[0], del[0], 100); // high pass del[1] = hip(&s->hip[1], del[1], 100); - del[0] = lop(&s->lop[0], del[0], 1000); // low pass - del[1] = lop(&s->lop[1], del[1], 1000); + del[0] = lop(&s->lop[0], del[0], 10); // low pass + del[1] = lop(&s->lop[1], del[1], 10); compress(del, &s->compress, 5, 10, 25, 48, del); // write to delay lines
diff @ 2019-11-11 17:29:40 +0000 diff --git a/client/go.c b/client/go.c index b5282a6..9619d9a 100644 --- a/client/go.c +++ b/client/go.c @@ -142,7 +142,7 @@ int go(S *s, int inchannels, const float *in, int outchannels, float *out) { mixdown[1] += del[1]; // output stereo audio - sample volume = 0.25; + sample volume = 0; for (int c = 0; c < outchannels && c < 2; ++c) { out[c] = tanh(volume * mixdown[c]); // clip }