@manuels said:
Yes, it's true, that I didn't care about consecutive non-zero samples.
Is there a rule not to have consecutive samples? If so, Nyquist is the limit
looking for velvet noise generator
@manuels said:
Yes, it's true, that I didn't care about consecutive non-zero samples.
Is there a rule not to have consecutive samples? If so, Nyquist is the limit
Ok, I changed the algorithm a bit and now I think I nailed it and solved it for frequencies up to Nyquist and above! I'm just randomly choosing any sample in the period, from first to last and I don't have if there are consecutive samples, like the last sample from the previous period and first sample from the current one.
for(int j = 0; j < x->x_nchans; j++){
for(int i = 0, n = x->x_n; i < n; i++){
double hz = in1[j*n + i];
double step = hz * x->x_sr_rec; // phase step
step = step > 1 ? 1 : step < 0 ? 0 : step; // clip step
t_float imp = 0;
t_float r = x->x_rand[j]; // - step;
if(phase[j] >= r && ((lastphase[j] < r) || (x->x_1st[j])))
imp = velvet_random(x) > 0.5 ? 1 : -1;
out[j*n + i] = imp;
x->x_1st[j] = 0;
if(phase[j] >= 1.){
x->x_1st[j] = 1;
x->x_rand[j] = velvet_random(x);
while(phase[j] >= 1.)
phase[j] -= 1; // wrap phase
}
lastphase[j] = phase[j];
phase[j] += step;
}
}```
ok, just implemented bias and regularity as well... which was really a no brainer, cool! I like how I can turn this into an impulse oscilator if I set the regularity to maximum and bias to a single polarity. Then we can just introduce a little bit of randomness in both cases.
Wow, this is a pretty cool object and random noise generator. Thanks everyone who participated
I will announce when I officially include this object, I might squeeze this one in for the next upcoming release in a week or so
having the object at full sample rate frequency and then adjusting the bias to a low value, just so a few of the samples are of an inverse polarity, also creates a nice texture!
Done!
Now for the big question, where are the Reverb algorithms based on velvet noise?
here's the code, object should be in the next release any time now, just need Tim to help me compile a few things... https://github.com/porres/pd-else/blob/master/Code_source/Compiled/audio/velvet~.c
thanks again
So here's the fixed version: velvet-noise-fixed.pd
It wasn't just the issue with small floating point numbers, but more importantly it now didn't work with integer periods. In this case, of course, the period must never be reduced by one sample!
Oops! Looks like something went wrong!