@blackbneard You're almost there, the only thing you did wrong was using more function arguments than necesssary. setParameter() always requires a single argument that contains the parameter value and all the branching is done with the template constant like you assumed.

template <int P> void setParameter(double value) { if(P == 0) thresh = (float)value; if(P == 1) attack = (float)value; if(P == 2) release = (float)value; }