[SCM] calf/master: + Remove aclocal.m4 (it shouldn't have been in the repository in the first place!)
js at users.alioth.debian.org
js at users.alioth.debian.org
Tue May 7 15:36:51 UTC 2013
The following commit has been merged in the master branch:
commit 4f5b187077147b723f1ed0950f1d9626a9775c88
Author: kfoltman <kfoltman at 78b06b96-2940-0410-b7fc-879d825d01d8>
Date: Sat Dec 29 18:01:37 2007 +0000
+ Remove aclocal.m4 (it shouldn't have been in the repository in the first place!)
git-svn-id: https://calf.svn.sourceforge.net/svnroot/calf/trunk@55 78b06b96-2940-0410-b7fc-879d825d01d8
diff --git a/autogen.sh b/autogen.sh
index 2a6fc5f..3267d12 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,6 +1,7 @@
#!/bin/sh
aclocal
-autoheader
-automake --force-missing
-autoconf
+libtoolize --force --automake --copy
+autoheader --force
+autoconf --force
+automake --force-missing --copy
./configure --prefix=/usr $@
diff --git a/src/calf/fixed_point.h b/src/calf/fixed_point.h
index 7df20dc..953b47b 100644
--- a/src/calf/fixed_point.h
+++ b/src/calf/fixed_point.h
@@ -207,6 +207,14 @@ public:
return lerp_by_fract_int<U, UseBits>(data[pos], data[pos+1]);
}
+ /// Untested... I've started it to get a sin/cos readout for rotaryorgan, but decided to use table-less solution instead
+ /// Do not assume it works, because it most probably doesn't
+ template<class U, int UseBits>
+ inline U lerp_table_lookup_int_shift(U data[(1<<IntBits)+1], unsigned int shift) {
+ unsigned int pos = (uipart() + shift) & ((1 << IntBits) - 1);
+ return lerp_by_fract_int<U, UseBits>(data[pos], data[pos+1]);
+ }
+
template<class U>
inline U lerp_table_lookup_float(U data[(1<<IntBits)+1]) {
unsigned int pos = uipart();
diff --git a/src/calf/modules_dev.h b/src/calf/modules_dev.h
index b27adc5..e144e7f 100644
--- a/src/calf/modules_dev.h
+++ b/src/calf/modules_dev.h
@@ -85,8 +85,8 @@ public:
float *ins[in_count];
float *outs[out_count];
float *params[param_count];
- float phase_h, dphase_h;
- float phase_l, dphase_l;
+ double phase_l, dphase_l, phase_h, dphase_h;
+ int cos_l, sin_l, cos_h, sin_h;
dsp::simple_delay<4096, float> delay;
dsp::biquad<float> crossover1l, crossover1r, crossover2l, crossover2r;
dsp::simple_delay<8, float> phaseshift;
@@ -134,22 +134,44 @@ public:
speed = (speed < 0.5f) ? 0 : 1;
float speed_h = 48 + (400-48) * speed;
float speed_l = 40 + (342-40) * speed;
- dphase_h = 2 * PI * speed_h / (60 * srate);
- dphase_l = 2 * PI * speed_l / (60 * srate);
+ dphase_h = speed_h / (60 * srate);
+ dphase_l = speed_l / (60 * srate);
+ update_speed();
}
+ void update_speed()
+ {
+ cos_h = 16384*16384*cos(dphase_h * 2 * PI);
+ sin_h = 16384*16384*sin(dphase_h * 2 * PI);
+ cos_l = 16384*16384*cos(dphase_l * 2 * PI);
+ sin_l = 16384*16384*sin(dphase_l * 2 * PI);
+ }
+ static inline void update_euler(long long int &x, long long int &y, int dx, int dy)
+ {
+ long long int nx = (x * dx - y * dy) >> 28;
+ long long int ny = (x * dy + y * dx) >> 28;
+ x = nx;
+ y = ny;
+ }
uint32_t process(uint32_t offset, uint32_t nsamples, uint32_t inputs_mask, uint32_t outputs_mask)
{
if (vibrato_mode)
{
+ long long int xl0 = 10000*16384*cos(phase_l * 2 * PI);
+ long long int yl0 = 10000*16384*sin(phase_l * 2 * PI);
+ long long int xh0 = 10000*16384*cos(phase_h * 2 * PI);
+ long long int yh0 = 10000*16384*sin(phase_h * 2 * PI);
+ // printf("xl=%d yl=%d dx=%d dy=%d\n", (int)(xl0>>14), (int)(yl0 >> 14), cos_l, sin_l);
for (unsigned int i = 0; i < nsamples; i++) {
float in_l = ins[0][i + offset], in_r = ins[1][i + offset];
float in_mono = 0.5f * (in_l + in_r);
- // XXXKF this is of course criminal, but I'm working on sound, not performance at this stage
- int xl = (int)(10000 * cos(phase_l)), yl = (int)(10000 * sin(phase_l));
- int xh = (int)(10000 * cos(phase_h)), yh = (int)(10000 * sin(phase_h));
- phase_l += dphase_l;
- phase_h += dphase_h;
+ // int xl = (int)(10000 * cos(phase_l)), yl = (int)(10000 * sin(phase_l));
+ //int xh = (int)(10000 * cos(phase_h)), yh = (int)(10000 * sin(phase_h));
+ update_euler(xl0, yl0, cos_l, sin_l);
+ int xl = xl0 >> 14, yl = yl0 >> 14;
+ int xh = xh0 >> 14, yh = yh0 >> 14;
+ // printf("xl=%d yl=%d xl'=%f yl'=%f\n", xl, yl, 16384*cos((phase_l + dphase_l * i) * 2 * PI), 16384*sin((phase_l + dphase_l * i) * 2 * PI));
+ update_euler(xh0, yh0, cos_h, sin_h);
float out_hi_l = delay.get_interp_1616(500000 + 40 * xh) + 0.0001 * xh * delay.get_interp_1616(500000 - 40 * yh) - delay.get_interp_1616(800000 - 60 * xh);
float out_hi_r = delay.get_interp_1616(550000 - 48 * yh) - 0.0001 * yh * delay.get_interp_1616(700000 + 46 * xh) - delay.get_interp_1616(1000000 + 76 * yh);
@@ -157,22 +179,27 @@ public:
float out_lo_l = 0.5f * in_mono + delay.get_interp_1616(400000 + 34 * xl) + delay.get_interp_1616(600000 - 18 * yl);
float out_lo_r = 0.5f * in_mono + delay.get_interp_1616(600000 - 50 * xl) - delay.get_interp_1616(900000 + 15 * yl);
- out_hi_l = crossover2l.process_d2(out_hi_l);
- out_hi_r = crossover2r.process_d2(out_hi_r);
- out_lo_l = crossover1l.process_d2(out_lo_l);
- out_lo_r = crossover1r.process_d2(out_lo_r);
+ out_hi_l = crossover2l.process_d2(out_hi_l); // sanitize(out_hi_l);
+ out_hi_r = crossover2r.process_d2(out_hi_r); // sanitize(out_hi_r);
+ out_lo_l = crossover1l.process_d2(out_lo_l); // sanitize(out_lo_l);
+ out_lo_r = crossover1r.process_d2(out_lo_r); // sanitize(out_lo_r);
float out_l = out_hi_l + out_lo_l;
float out_r = out_hi_r + out_lo_r;
in_mono += 0.06f * (out_l + out_r);
+ sanitize(in_mono);
outs[0][i + offset] = out_l;
outs[1][i + offset] = out_r;
delay.put(in_mono);
}
- phase_l = fmod(phase_l, (float)(2 * PI));
- phase_h = fmod(phase_h, (float)(2 * PI));
+ crossover1l.sanitize_d2();
+ crossover1r.sanitize_d2();
+ crossover2l.sanitize_d2();
+ crossover2r.sanitize_d2();
+ phase_l = fmod(phase_l + nsamples * dphase_l, 1.0);
+ phase_h = fmod(phase_h + nsamples * dphase_h, 1.0);
} else
{
memcpy(outs[0] + offset, ins[0] + offset, sizeof(float) * nsamples);
--
calf audio plugins packaging
More information about the pkg-multimedia-commits
mailing list