Applying multiple effects to an input signal

I have been working on modifying examples and writing my own
Arduino files from the DaisySP as a way of learning how to program the Daisy with Arduino.
So far it has worked pretty well and I’m making some progress, but I’m having difficulty with one bit.

How do I combine and add more than one effect to an input?

The delay example shows how to apply a lowpass filter after the delay effect, but how do I do it the other way around for example?

How many effects can I stack on top of eachother?
Could I add a Lowpass filter, then controll the volume of the signal with an envelope controlled compressor triggered by an external source and then a reverb effect on top of that?

I would certainly hope you can combine many effect before the processor screams enough :slight_smile:
Many audio development systems keep a timer running in the background and read it before and after all processing has been finished in the loop block. These numbers allow you to monitor what percentage of the processing you have used and what is left, and also if the number is jerking around then to look at cleaning up your code. I expect the Daisy people will add this in due course.

Yeah, I figured it would be possible to add a bunch of effects to a signal running through the Daisy, I just have no idea how to actually do it with code.
I can’t really find anything useful in the documentation or examples I’ve found.
At least, not for doing it with Arduino.

The one example I’ve found that shows this is the example for the delay where a lowpass filter is applied after the delay effect, but I can’t even find how to change the order of those two.

I’d guess you could do something like

float input, filter1, filter2; filter1 = flt1.process(input); filter2 = flt2.process(filter1); out[0][i] = filter2;

Can you give me the link to the example you mean and I’ll check

I can’t seem to find it now. I might have gotten mixed up there, but I’ll link one I’ve written myself that does the same thing. It’s a mono delay with a lowpass filter applied, but I’d like to apply it to the input signal before it goes to the delay and I can’t seem to work it out.

And here’s one where I’m trying to apply an SvF filter to an input signal and then a reverb, but I can’t seem to get it to work.

the first one is commented pretty well, but the second one is not as yet because I’m still playing around with it.

forgot the link to the second one

I wanted to look at the code, but I don’t want to sign up for Dropbox.
You can just post your code here.

You don’t need to sign up for Dropbox to access the files.

The delay can be modified like this (not tested, I haven’t setup the Arduino environment):

    float clean, dry, wet, filtered;

    // Read Dry from I/O
    clean = in[0][i];

    // Take the dry signal from here
    dry = clean;

    // LP filter
    filtered = flt.Process(clean);

    // Read Wet from Delay Lines
    wet = del_left.Read();

    //Write to Delay with some feedback
    del_left.Write((wet * fback) + filtered);

    //mix wet and dry
    delayed = wet * 0.707 + dry * 0.707;

    out[0][i] = delayed;

I don’t know if you want to take the dry from the filtered or from the clean input, but the modification should be quite simple now anyway. The reverb can be modified like this:

    float dry, wet_l, wet_r, wet, filtered;
    dry = in[0][i];

    filtered = flt.Low();
    verb.Process(filtered, filtered, &wet_l, &wet_r);
    wet = (wet_l + wet_r) * 0.5f;
    out[0][i] = (dry * (1.0 - reverbAmt)) + (wet * reverbAmt);

ReverbSc is a stereo processor, so if you want mono input and output, you should send the same input (filtered) to both channels then mix back the output after processing.

1 Like

Thank you!
This really helped. I think I understand a bit better now.

I’m really pleased with how the Reverb is sounding with the applied SvF LP filter.

I thought it was complaining about the TYPE of variable I was feeding it and I was really scratching my head on that one.

The reason I’m doing everything in Mono is because my modular is all mono.

I think the next thing I want to do is to be able to switch between SvF filter types, at least between LP and HP.
I did a quick test with a Switch Case, but changing filter type just introduced a bunch of static and weirdness.