 |
Latest musicdsp comments
Added to : Butterworth Optimized C++ Class Date : 23/04/13 By : scott[ AT ]mail[ DOT ]com Comment : Did anyone figure out how to get a high pass out of this?
Thanks!
Added to : 3 Band Equaliser Date : 07/04/13 By : noemail[ AT ]righthere[ DOT ]at Comment : It's all about WHERE you init you EQ. Try a little :) If you don't find out yourself, I'll help you.
Added to : Linear interpolation Date : 31/03/13 By : ffmusicdj[ AT ]gmail[ DOT ]com Comment : Never mind. I was calling the function from the wrong place. Works like a charm.
Thank you.
Added to : Linear interpolation Date : 31/03/13 By : ffmusicdj[ AT ]gmail[ DOT ]com Comment : I incorporated the 32x interpolator with something along this
void process32x(float const in_l, float const in_r, float *out_l, float *out_r)
{
float y_l = in_l-f_d1_l;
out_l[0] = f_d1_l + (1.0f/32.0f)*y_l; // interpolate
out_l[1] = f_d1_l + (2.0f/32.0f)*y_l;
out_l[2] = f_d1_l + (3.0f/32.0f)*y_l;
out_l[3] = f_d1_l + (4.0f/32.0f)*y_l;
out_l[4] = f_d1_l + (5.0f/32.0f)*y_l;
out_l[5] = f_d1_l + (6.0f/32.0f)*y_l;
out_l[6] = f_d1_l + (7.0f/32.0f)*y_l;
out_l[7] = f_d1_l + (8.0f/32.0f)*y_l;
out_l[8] = f_d1_l + (9.0f/32.0f)*y_l;
out_l[9] = f_d1_l + (10.0f/32.0f)*y_l;
out_l[10] = f_d1_l + (11.0f/32.0f)*y_l;
out_l[11] = f_d1_l + (12.0f/32.0f)*y_l;
out_l[12] = f_d1_l + (13.0f/32.0f)*y_l;
out_l[13] = f_d1_l + (14.0f/32.0f)*y_l;
out_l[14] = f_d1_l + (15.0f/32.0f)*y_l;
out_l[15] = f_d1_l + (16.0f/32.0f)*y_l;
out_l[16] = f_d1_l + (17.0f/32.0f)*y_l;
out_l[17] = f_d1_l + (18.0f/32.0f)*y_l;
out_l[18] = f_d1_l + (19.0f/32.0f)*y_l;
out_l[19] = f_d1_l + (20.0f/32.0f)*y_l;
out_l[20] = f_d1_l + (21.0f/32.0f)*y_l;
out_l[21] = f_d1_l + (22.0f/32.0f)*y_l;
out_l[22] = f_d1_l + (23.0f/32.0f)*y_l;
out_l[23] = f_d1_l + (24.0f/32.0f)*y_l;
out_l[24] = f_d1_l + (25.0f/32.0f)*y_l;
out_l[25] = f_d1_l + (26.0f/32.0f)*y_l;
out_l[26] = f_d1_l + (27.0f/32.0f)*y_l;
out_l[27] = f_d1_l + (28.0f/32.0f)*y_l;
out_l[28] = f_d1_l + (29.0f/32.0f)*y_l;
out_l[29] = f_d1_l + (30.0f/32.0f)*y_l;
out_l[30] = f_d1_l + (31.0f/32.0f)*y_l;
out_l[31] = in_l;
f_d1_l = in_l; // store delay_l
float y_r = in_r-f_d1_r;
out_r[0] = f_d1_r + (1.0f/32.0f)*y_r; // inrterpolate
out_r[1] = f_d1_r + (2.0f/32.0f)*y_r;
out_r[2] = f_d1_r + (3.0f/32.0f)*y_r;
out_r[3] = f_d1_r + (4.0f/32.0f)*y_r;
out_r[4] = f_d1_r + (5.0f/32.0f)*y_r;
out_r[5] = f_d1_r + (6.0f/32.0f)*y_r;
out_r[6] = f_d1_r + (7.0f/32.0f)*y_r;
out_r[7] = f_d1_r + (8.0f/32.0f)*y_r;
out_r[8] = f_d1_r + (9.0f/32.0f)*y_r;
out_r[9] = f_d1_r + (10.0f/32.0f)*y_r;
out_r[10] = f_d1_r + (11.0f/32.0f)*y_r;
out_r[11] = f_d1_r + (12.0f/32.0f)*y_r;
out_r[12] = f_d1_r + (13.0f/32.0f)*y_r;
out_r[13] = f_d1_r + (14.0f/32.0f)*y_r;
out_r[14] = f_d1_r + (15.0f/32.0f)*y_r;
out_r[15] = f_d1_r + (16.0f/32.0f)*y_r;
out_r[16] = f_d1_r + (17.0f/32.0f)*y_r;
out_r[17] = f_d1_r + (18.0f/32.0f)*y_r;
out_r[18] = f_d1_r + (19.0f/32.0f)*y_r;
out_r[19] = f_d1_r + (20.0f/32.0f)*y_r;
out_r[20] = f_d1_r + (21.0f/32.0f)*y_r;
out_r[21] = f_d1_r + (22.0f/32.0f)*y_r;
out_r[22] = f_d1_r + (23.0f/32.0f)*y_r;
out_r[23] = f_d1_r + (24.0f/32.0f)*y_r;
out_r[24] = f_d1_r + (25.0f/32.0f)*y_r;
out_r[25] = f_d1_r + (26.0f/32.0f)*y_r;
out_r[26] = f_d1_r + (27.0f/32.0f)*y_r;
out_r[27] = f_d1_r + (28.0f/32.0f)*y_r;
out_r[28] = f_d1_r + (29.0f/32.0f)*y_r;
out_r[29] = f_d1_r + (30.0f/32.0f)*y_r;
out_r[30] = f_d1_r + (31.0f/32.0f)*y_r;
out_r[31] = in_r;
f_d1_r = in_r; // store delay_r
}
Unfortunately, I am doing something crazy wrong. When I close my plug-in, my DAW freezes. I'm fairly new to programming and am not sure what I'm doing wrong.
I'm using your function to write to an audio buffer which is being set to a delay. This is what the call looks like.
process32x((fLeftAudioBuffer[i] * decay), (fRightAudioBuffer[i] * decay),
&fCircularLeftAudioBuffer[(fCircularBufferPosition + delayFrames)%kCircularBufferSize],
&fCircularRightAudioBuffer[(fCircularBufferPosition + delayFrames)%kCircularBufferSize]);
I would love to use this function because it's one line less than how I usually do it. It works great with no problems.
fCircularLeftAudioBuffer[(fCircularBufferPosition + delayFrames)%kCircularBufferSize] = fLeftAudioBuffer[jh] * decay;
fCircularRightAudioBuffer[(fCircularBufferPosition + delayFrames)%kCircularBufferSize] = fRightAudioBuffer[jh] * decay;
Everything seems simple, but I'm puzzled as to what may be wrong. Thanks.
Added to : Type : LPF 24dB/Oct Date : 13/02/13 By : dj_zef[ AT ]ngs[ DOT ]ru Comment : Your filter does not work! Arise overload in the calculation of coefficients A and B in the cutoff frequency of approximately 10 khz. At low frequencies, the coefficient of the gain increases proportional to the frequency cutoff, which causes congestion. I also noticed that the filter on this basis, the package of ASIO/DSP - DDspBesselFilter.pas does not work, although Butterworth (DDspButterworthFilter.pas) and Chebyshev (DDspChebyshevFilter.pas) work perfectly!
Added to : Vintage VU meters tutorial Date : 27/01/13 By : User[ AT ]host[ DOT ]com Comment : This tutorial has almost no DSP, mostly graphics. Also, the author doesn't seem to realize that abs(x) is not necessary when using sqr(x) because the square of any number is always positive, even if x is negative. I don't really trust a tutorial that is this sloppy.
Added to : Simple peak follower Date : 26/01/13 By : cafreamoroso[ AT ]gmail[ DOT ]com Comment : #ifndef VERY_SMALL_FLOAT
#define VERY_SMALL_FLOAT 1.0e-30F
#endif
Added to : Reverberation techniques Date : 17/01/13 By : superhotmuffin[ AT ]hotmail[ DOT ]com Comment : Hi, after trying a bunch of Schroeder/Moorer designs which never really sounded great, I stumbled upon a "loop" topology that I whipped up in a coffee-fueled coding frenzy at Starbuck's one night. It sounded great - like a real guitar amp reverb. Still uses delays/comb filters and the usual nonsense, but w/ a different topology. Drop me a line and I can send my source. It's fully commented, including "ASCII art" signal flow diagrams. Michael B.
Added to : Variable-hardness clipping function Date : 17/01/13 By : superhotmuffin[ AT ]hotmail[ DOT ]com Comment : sign (x) * pow (atan (pow (abs (x), k)), (1 / k));
OUCH! That's a lot of pow, atan and floating point division - probably kill most CPU's :) My experience has been that any sigmoid function will create decent distortion if oversampled and eq'ed properly. You can adjust the "hardness" of the clipping by simply changing a couple coefficients, or by increasing/decreasing the input gain: like so:
y = A * tanh(B * x)
Cascading a couple/few of these will give you bone-crushing, Megadeth/Slayer style grind while rolling back the gain gives a Fender Twin sound.
Two cascaded half-wave soft clippers gives duty-cycle modulation and a transfer curve similar to the 3/2 power curve of tubes. I came up w/ a model based on that solution after reading reading this: http://www.trueaudio.com/at_eetjlm.htm (orig. link at www.simulanalog.org)
Added to : Polynominal Waveshaper Date : 17/01/13 By : superhotmuffin[ AT ]hotmail[ DOT ]com Comment : If I'm correct, you're describing the same technique achievable by use of Chebyschev polynomials, i.e. generating any integral harmonic of the original signal. I've experimented with these, synthesizing only the second, third, fourth, etc. harmonics, but could never get a realistic sound, probably because overdiven tubes/transistors don't work this way and there's no intermodulation distortion, only the pure harmonics.
Added to : 2 Wave shaping things Date : 17/01/13 By : superhotmuffin[ AT ]hotmail[ DOT ]com Comment : Yeah, atan & tanh, and really any sigmoid function, can create decent overdrive sound if oversampled and eq'ed properly. I've used them in some of my modelers w/ good results. For a more realistic sound, two half-wave soft clippers in series will add duty-cycle modulation and a transfer curve similar to 3/2 tube power curve. Something like: if(x < 0) y = -A * tanh(B * x); followed immediately by: if(y >= 0) y = -A * tanh(B * y); Don't forget to invert each output (-A * tanh). Coefficients A & B are left to the designer. I got this technique after reading a paper discussing a hardware implementation of this type of circuit used in Carvin amps, here: http://www.trueaudio.com/at_eetjlm.htm (original link at www.simulanalog.org)
Added to : 3 Band Equaliser Date : 11/01/13 By : johan[ AT ]klevgrand[ DOT ]se Comment : Works fine for me on iOS. Maybe you feed a interleaved stereo signal with the same EQSTATE instance (you'll need one EQSTATE for each channel)?
Added to : Lookahead Limiter Date : 08/01/13 By : cshay892[ AT ]gmail[ DOT ]com Comment : Probably years after the fact, but thanks for this. I followed most of the pseudocode and it's sounding quite nice.
Added to : 4th order Linkwitz-Riley filters Date : 31/12/12 By : dave[ AT ]quikquak[ DOT ]com Comment : Or even 3.1415926535!
LOL.
Added to : randja compressor Date : 14/12/12 By : vmeserette[ AT ]gmail[ DOT ]com Comment : Hi randja,
I am trying to use your compressor.
Could you explain in what unity shall be given the values of threshold, ratio, release, attack and output ?
Have you a good set of values for these parameters to make it work ?
Thanks in advance
Added to : Karlsen Fast Ladder Date : 14/11/12 By : Generalized perfect digital "ladder" filter, with the desired aspects of analog[ DOT ] Comment : Hi, I have now generalized the ladder filter, into fast code, and with the desired aspects of analog, but retaining digital perfectness.
Please see my blog: http://paradoxuncreated.com/Blog/wordpress/?p=1360
Peace Be With You.
Added to : 5-point spline interpollation Date : 04/10/12 By : Josh Scholar Comment : By oversample I meant do a windowed sinc doubling oversample a couple times.
The point is that a 4 times oversample can be based on table values and only gives you points exactly 1/4, 1/2 and 3/4 between the samples.
Then the spline can be used to interpolate totally arbitrary points between those, say speeding up and slowing down as needed, at very high quality.
If you don't oversample first, you'll get an audible amount of aliasing, though not as much as a linear interpolation. Unless the source has a lot of roll off (which is equivalent to it being oversampled anyway).
Added to : Envelope detector Date : 04/09/12 By : bouzidom[ AT ]yahoo[ DOT ]com Comment : i have a signal and i need to extract the envelope usig this code, so what are the initial attack and release values?
thanks,
Added to : Butterworth Optimized C++ Class Date : 13/07/12 By : froese[ AT ]gemini-sites[ DOT ]de Comment : forget my previous comment, it works fine. thanx!
Added to : 3rd order Spline interpollation Date : 10/07/12 By : cdion[ AT ]quantum-music[ DOT ]ca Comment : About that thing you've said "5 point seems to be the sweet spot". Well, it might depends on the sampling rate.
|
|
 |
|