Calling two Effects methods after each other, not working

Using POD MultiEffect works ok of course with a single method call for each mode as below

void AudioCallback(float *in, float *out, size_t size)
{
    float outl, outr, inl, inr;
    Controls();
    //audio
    for (size_t i = 0; i < size; i += 2)
    {
        inl = in[i];
        inr = in[i + 1];
        switch (mode)
       {
            case REV:
              GetReverbSample(outl, outr, inl, inr);
              break;
           case DEL:
             GetDelaySample(outl, outr, inl, inr);
             break;
           case CRU:
            GetCrushSample(outl, outr, inl, inr);
            break;
         default:
            outl = outr = 0;
    }
    // left out
    out[i] = outl;
    // right out
    out[i+1] = outr;
    }
}

But if I add a second method call , so as to chain two effect together it doesn’t work., see code example below.
You can see I’ve added GetCrushSample after GetReverbSample. for case REV

void AudioCallback(float *in, float *out, size_t size)
{
    float outl, outr, inl, inr;
    Controls();
    //audio
    for (size_t i = 0; i < size; i += 2)
    {
        inl = in[i];
        inr = in[i + 1];
        switch (mode)
       {
            case REV:
              GetReverbSample(outl, outr, inl, inr);
              GetCrushSample(outl, outr, inl, inr);
              break;
           case DEL:
             GetDelaySample(outl, outr, inl, inr);
             break;
           case CRU:
            GetCrushSample(outl, outr, inl, inr);
            break;
         default:
            outl = outr = 0;
    }
    // left out
    out[i] = outl;
    // right out
    out[i+1] = outr;
    }
}

Can some one please correct me and tell me why I can’t get this to work ?
Is there any documentation about “chaining” methods ?
Do I need another callback or something ?
I feel I’m doing something very stupid :slight_smile:

Cheers

  1. The standard way to use first inputs, then outputs in function parameters. Otherwise it’s just painful to read
  2. The actual problem is that you’re just using the same inputs as parameters for different functions. Should probably be something like this:
GetReverbSample(tmpl, tmpr, inl, inr);
GetCrushSample(outl, outr, tmpl, tmpr);
1 Like

Thanks, as I thought, something stupid I was doing, it’s been a long day here in the UK.