Thanks Michael. I am using Teensy 4.0 with Audio shield rev.D and it was actually working with SPI.setMOSI(7) and SPI.setSCK(14), but presumably that was just ignored by the compiler because as you...
Type: Posts; User: rvh
Thanks Michael. I am using Teensy 4.0 with Audio shield rev.D and it was actually working with SPI.setMOSI(7) and SPI.setSCK(14), but presumably that was just ignored by the compiler because as you...
I have my SD card working, but to do so had to avoid the use of pin 13 as an output to drive the led. I'm not sure why that is because according to the SD card examples I looked at in the library,...
Here is an update of the new full-model filter_ladder2, which corrects a few minor issues, and adds linear interpolation as an option in the same way as the existing ladder filter.
...
Thanks all, it sounds like using the audio shield's SD is the simplest solution for now. For saving/recalling synth patches, speed is irrelevant, and losing the patches each time I change the synth...
I have a midi-controller driving a teensy-4.0 based synth and would like to store patch parameters that comprise on the order of 100 bytes per patch in non-volatile memory. I would like to be able to...
Hi Florian, good to hear you're enjoying the filter. On my system, I get 7% for POLY_FIR, and 5% for LINEAR. To reduce it further I suggest going to 2x oversampling. However, that requires a...
Attached is an audio comparison of how the two filter methods sound for a highly resonant sweep patch. First one is the simplified model, second the full model. For lower resonance settings, they...
Here is the revised .cpp file that allows inputDrive 1-3, and also makes a small change to a time constant.
/* Audio Library for Teensy, Ladder Filter
* Copyright (c) 2021, Richard van Hoesel...
I have changed my mind about this parameter for this second filter. I'm finding now that allowing it to range between 1-3 seems to be a good way to 'fatten' the sound without altering the character...
Here is v1.01 (already....). Rather than dialing back resonance parameter to try to reduce self oscillation loudness, which has the disadvantage of often cutting out the self oscillation...
Here is the new full-model filter, which for now I've called AudioFilterLadder2. It's based on Huovilainen's full model, presented at DAFX 2004. Below are the filter_ladder2.cpp and .h files if you...
Thanks for the suggestions. I've managed to get a 2x over-sampled version of the new model (which I'll describe in the next post) sounding as good as a 4x over-sampled version for all intents and...
On a related note, what are people's views on CPU demands versus performance with these filters? Currently the simplified model version uses between 6-7% at 4x oversampling. I think I can get a 4x...
For those of you who are interested in this sort of thing, here is a comparison of the current filter based on Huovilainen's simplified model with his full model. Input is a very low level 70Hz saw,...
Thanks for doing that Paul. I agree that it needs to be simplified. We probably have more parameters than we need at the moment. Having used the filter for a bit, the input_drive doesn't sound very...
Hi Paul,
I'm totally fine with you making alterations as you see fit to make the code more compliant with the rest of the framework.
Thanks for the offer.
Cheers,
Richard
Hi Paul,
Yes, your suggested change is a good idea. It should make no difference to the processing as long as the blocks contain enough samples for the interpolation filter. At the moment that...
I tried a few designs using Parks McClellan, and decided in the end to let the filter be just marginally longer. This one is 36 taps, derived from a 40-tap specification that had very small end...
Thanks for the suggestion. I had to find out how first...
/* Audio Library for Teensy, Ladder Filter
* Copyright (c) 2021, Richard van Hoesel
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and...
/* Audio Library for Teensy, Ladder Filter
* Copyright (c) 2021, Richard van Hoesel
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and...
Below is version 1.5 for people to try out. By default it uses a 32-tap polyphase FIR interpolator/decimator now. That adds around 1.5% to the CPU load (per filter) compared to simple linear...
Thanks Mark, the trade-off here off course is stopband suppression versus potentially audible HF rolloff in the passband within the constraint of no more than 32 points.
I have tried a few more...
After further tsts, my current thoughts are to use 32 taps in the FIR after all. The CPU load goes up to ~7%, compared to ~5% for linear interpolation.
Below is the LPF I'm currently trying out...
Paul, I'm still working on the FIR LPF for the polyphase approach, but hope to have it ready soon. At this stage I'm not thinking of making that filter minimum phase, and in a mock up polysynth I...
I moved the state array and instance declarations into the .h file as private, and I think that's sorted the problem out.
Thanks for your reply. Yes, I know the 16-tap filter is not great, but it's a whole lot better than linear interpolation. The 32-tap filter certainly is significantly better again, but it uses up...
I think 16 taps will be a good compromise between performance and CPU demands, and it sounds much better than linear interpolation at high frequencies.
However, I can't seem to run more than one...
I now have both a polyphase FIR interpolator and decimator up and running. CPU use for the filter on teensy 4 is still not bad at 7% for a 32-tap FIR. I'll do a bunch of listening tests for the...
Even allowing for the fact that I meant to use the decimate rather than interpolate functon, this turns out to be incorrect anyway. It looks like I need to create a separate structure for the...
OK, so I think I have the upsampling side up and running. I decided for now to just try an external design software (using the Iowa Hills link you sent) and it produced coefficients that were more...
@Frank, thanks very much for your offer. I plan to give it a go this weekend, and will contact you if I run into problems. One question - when I did a test run of the coefficient generating code for...
Yes, a polysynth is easily possible. I have a preliminary 8-note polyphonic synth running with two bandwidth-limited audio oscillators, two envelope generators (vca/vcf), and one of these filters...
Clicks appear to be gone now that I check on every sample for overflow. I'm sure Paul can code this more efficiently than what I'm doing here, but the principle works fine. Below is the cpp code of...
I have a preliminary modified version of the envelope object up and running that doesn't reset the envelope to zero at NoteOn, and just continues from the last value instead. I've removed the delay...
/* Audio Library for Teensy, Ladder Filter
* Copyright (c) 2021, Richard van Hoesel
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and...
/* Audio Library for Teensy, Ladder Filter
* Copyright (c) 2021, Richard van Hoesel
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and...
Thanks Paul,
I took that code and added simple linear interpolation of the input data in the version I show below. It extends the freq range before aliasing becomes audible with a bandlimited...
Excellent. Thanks very much indeed.
@Frank, thanks very much. I'll take a look at your example.
-edit - Not really being a programmer, and after having had a quick look, it might take me a while to sort through your example. So if...
Do you know of any c++ code I could use to implement a polyphase FIR filter (ideally ready to go with coefficients for 4x oversampling) to see whether it offers any significant advantage in this...
@Tomas, thanks for your ongoing comments in this thread. I am reviewing some of them again today, including this one. Interestingly, when I tried dropping the output averaging when down-sampling on...
When playing the tuned resonant filter with a musical keyboard, you can produce fairly large sudden Fc changes that produce abrupt 'attacks'. Should we include a way of smoothing those changes using...
I coded up a simple 'midi synth' with bandlimited sawtooth oscillator running into this filter, and set the filter in self oscillation at Q of about 1.2, and cutoff tracking the keyboard notes. When...
Thanks. How is it ensured that -32768 doesn't overflow the 16 bit integer range of the dac?
One last minor adjustment. In compute_coeffs(float c), can we please increase the lower cutoff limit to 5Hz, rather than 1Hz?
Thanks,
Richard.
One other thought. The filter structure apparently also allows high-pass and band-pass outputs by combining different weighting of the four LPF stages. However, I haven't tested that yet. Is there...
Thanks Paul. I was trying various settings on the non-modulated inputs to decide on final default values for the .h file.
I'm inclined to set the default passband gain, determined by the variable...
When I look at the Github code, the compute_coeffs routine has errors and redundancies. The 4x frequency error is because the line:
float wc = c * (float)(2.0f * MOOG_PI / AUDIO_SAMPLE_RATE_EXACT);...
(edited after I had my morning coffee :)) The tanh won't work if the input isn't scaled down appropriately. And the reason I used 32767 as output scaler was to to stay within the 16bit limit for the...