Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checking that the input length is equal to 3 is my band-aid to deal with timing + sensing commands from the keyboard.
Fixes #42, #28
This PR conflicts with #29. However, I would recommend NOT merging that PR for two reasons:
midly
integration for comprehensive message parsing #35 handles only two messages properly:note is on
andnote is off
. While handling other messages is most likely a future directive of this crate, I believe that the current crate structure should not, and cannot account for other statuses withoutmidly
or a significant structural change.cargo run --release --example input
givingResult::unwrap()
on anErr
value: PoisonError { .. } #28, You will see that the data-less messages passed are the same status ofactive sensing
. This crate in a vacuum, however, doesn't have the capability, nor should be capable of handling that case until comprehensive message parsing is resolved.Obviously then, there's a pitfall of this PR as well. ONLY status types with 2 data bytes are available in the Resource. This means that the publicity of the message is incomplete. I'd argue this is okay, for now, but providing invalid zeroed data to a status without those bytes is far more deceptive when implementing logic. Of course, I'm assuming most dependents use the
is_note_on
andis_note_off
methods exclusively, and parse the provided bytes afterwards.Maybe then, the
MidiMessage
struct should be changed toOr even better:
Or, I can just help implement
midly
for this crate, as correct parsing of statuses will be important to me soon. Thanks for your consideration!!