Jump to content

Encoders as faders on MotorMix emulation


jeroddumas
 Share

Recommended Posts

all I can provide is this code:


void ENC_NotifyChange(unsigned char encoder, char incrementer) __wparam
{
  unsigned int value;

  // encoder number 0, 2, 4, 6, 8, 10, 12, 14: VPOT
  // encoder number 1, 3, 5, 7, 9, 11, 13, 15: Fader replacement
  if( encoder < 16 ) {
    if( !(encoder & 1) )
      MM_VPOT_SendENCEvent(encoder >> 1, incrementer);
    else {
      // add incrementer to absolute value
      value = MM_MF_FaderPosGet(encoder >> 1);
      if( MIOS_HLP_16bitAddSaturate(incrementer, &value, 0x3ff) ) {
        // send fader event
        MM_MF_FaderEvent(encoder >> 1, value);
      }
    }
  }
  // encoder number 16: datawheel
  else if( encoder == 16 )
    MM_VPOT_SendJogWheelEvent(incrementer);
  else {
    // here you could handle additional encoders
  }
}
[/code]

Best Regards, Thorsten.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...