iPlug2 Forum

ISender / ISenderData is setting params for desired control

Hi! I’m working on adding in an envelope viewer into my plugin and everything is function except that the ISender code in my ProcessBlock function is constantly updating the param kSustain. Here’s some clarity:

This is the custom IControl that uses an array (like XYPad) to pass in parameters.
pGraphics->AttachControl(new IADSR(IRECT(0, 350, 480, 600), { kAttack, kDecay, kSustain }), kEnvPlot);

This is my OnMsgFromDeleGate code to get where the the envelope stage is at.

void OnMsgFromDelegate(int msgTag, int dataSize, const void* pData) override {
if (!IsDisabled() && msgTag == ISender<>::kUpdateMessage) {
IByteStream stream(pData, dataSize);

  int pos = 0;
  ISenderData<MAXNC> d;
  pos = stream.Get(&d, pos);
  point = d.vals[0];


(It’s probably not the prettiest code).

Here’s the ISender code:
mEnvSender.PushData({ kEnvPlot, {float(adsr[0].getPoint())} });
where adsr[0].getPoint() is the current point on the envelope from 0 - 1.

I’ve narrowed the problem to the ISender code, but I can’t seem to figure out why kSustain is constantly getting set. Another important note is that if I set kSustain to kNoTag, kDecay would be the one constant set. And vise versa for kAttack if I set kDecay to kNoTag. I’ve been at this issues for a good 30 minutes now, so any help would be much appreciated :slight_smile:

maybe you dont want to trigger an action/parameter change when you set dirty…



1 Like

Yep, that was it. Thanks!