Skip to content

fix(control): decouple i2c from MIDI and fix NRPN change detection#520

Merged
chmanie merged 2 commits into
mainfrom
fix/control-separate-midi-i2c-thresholds
May 16, 2026
Merged

fix(control): decouple i2c from MIDI and fix NRPN change detection#520
chmanie merged 2 commits into
mainfrom
fix/control-separate-midi-i2c-thresholds

Conversation

@ArthurGibert
Copy link
Copy Markdown
Member

@ArthurGibert ArthurGibert commented May 13, 2026

Summary

  • NRPN outputs were using the 7-bit scaled value for change detection, causing missed updates when the full 12-bit value changed but the scaled one didn't
  • i2c operates at full 12-bit resolution and was incorrectly gated behind the 7-bit MIDI change check, causing it to drop updates
  • i2c now has its own threshold and sends the attenuated fader value (no curve) independently of MIDI
  • Fix i2c bug where the i2c value was not updated when un-muting

@ArthurGibert ArthurGibert force-pushed the fix/control-separate-midi-i2c-thresholds branch from 57aba3e to 1fd0a11 Compare May 13, 2026 14:10
@ArthurGibert ArthurGibert linked an issue May 14, 2026 that may be closed by this pull request
@chmanie chmanie force-pushed the fix/control-separate-midi-i2c-thresholds branch 2 times, most recently from f02a985 to f554cfb Compare May 16, 2026 10:31
Copy link
Copy Markdown
Member

@chmanie chmanie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix!

ArthurGibert and others added 2 commits May 16, 2026 12:43
Previously the MIDI send threshold always used the 7-bit scaled value
(midi_out * 127 / 4095), causing NRPN outputs to skip updates when the
full-resolution value changed but the scaled value did not.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
i2c was only firing when the MIDI value changed, causing i2c output to
be silently dropped on NRPN or range changes where MIDI didn't update.
Now tracked independently with its own last_i2c threshold.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@chmanie chmanie force-pushed the fix/control-separate-midi-i2c-thresholds branch from f554cfb to 32b7ec2 Compare May 16, 2026 10:44
@chmanie chmanie merged commit 2c39ce2 into main May 16, 2026
3 checks passed
@chmanie chmanie deleted the fix/control-separate-midi-i2c-thresholds branch May 16, 2026 10:48
chmanie pushed a commit that referenced this pull request May 16, 2026
…detection (#520)

* fix(control): use full 12-bit value for NRPN change detection

Previously the MIDI send threshold always used the 7-bit scaled value
(midi_out * 127 / 4095), causing NRPN outputs to skip updates when the
full-resolution value changed but the scaled value did not.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(control): decouple i2c send from MIDI change detection

i2c was only firing when the MIDI value changed, causing i2c output to
be silently dropped on NRPN or range changes where MIDI didn't update.
Now tracked independently with its own last_i2c threshold.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: in control i2c mute only works one way

2 participants