Skip to content

Parse MSB and LSB from pitch bend and song position messages when using midilib gem#5

Open
mike-bourgeous wants to merge 3 commits into
arirusso:mainfrom
mike-bourgeous:mb-20230129-fix-midilib-pitch-bend
Open

Parse MSB and LSB from pitch bend and song position messages when using midilib gem#5
mike-bourgeous wants to merge 3 commits into
arirusso:mainfrom
mike-bourgeous:mb-20230129-fix-midilib-pitch-bend

Conversation

@mike-bourgeous
Copy link
Copy Markdown

@mike-bourgeous mike-bourgeous commented Jan 29, 2023

This change computes the full value parameter using both MSB and LSB for the MIDI::PitchBend and MIDI::SongPointer message types from the midilib gem. I updated the specs to match.

I used multiplication and addition rather than bitwise operations (shift and or) because * and + benchmarked much faster than << and |.

Thanks for writing nibbler!

@mike-bourgeous
Copy link
Copy Markdown
Author

mike-bourgeous commented Jan 29, 2023

I also verified this change produces the right output in my own code:

Before:

image

After:

image

@mike-bourgeous mike-bourgeous changed the title Parse MSB and LSB from pitch bend messages when using midilib gem Parse MSB and LSB from pitch bend and song position messages when using midilib gem Feb 5, 2023
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.

1 participant