Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Patch/Nimbus: Midi Support #200

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

baumgartnerniels
Copy link
Contributor

Hi

I'm working on a feature to control all the parameters in the Nimbus Firmware with midi.

I'm marking this as Work in Progress, as the midi handling in the current libdaisy is a bit buggy.
Never the less, here is a first working draft. It will work as long as there are no Midi RealTime (clock) messages coming in. Otherwise (and that is usually the case when connecting a midi sequencer) the Midi parser in libdaisy has to be patched to ignore the buggy clock messages.
I saw a bit too late that there is a PR electro-smith/libDaisy#350 fixing the Midi parser. I think it makes sense to change this to use the new parser as soon as the mentioned PR is merged.

If you want to test this out in the meantime, here is the midi parser patch:

diff --git a/src/hid/midi.cpp b/src/hid/midi.cpp
index 1df5860..7cb4ec4 100644
--- a/src/hid/midi.cpp
+++ b/src/hid/midi.cpp
@@ -77,8 +77,10 @@ void MidiHandler::Parse(uint8_t byte)
     switch(pstate_)
     {
         case ParserEmpty:
+            // ignore single-byte realtime (Clock) messages
+            if (byte == kRealTimeMask) {}
             // check byte for valid Status Byte
-            if(byte & kStatusByteMask)
+            else if(byte & kStatusByteMask)
             {
                 // Get MessageType, and Channel
                 incoming_message_.channel = byte & kChannelMask;

@stephenhensley stephenhensley marked this pull request as draft June 10, 2021 23:54
@stephenhensley
Copy link
Collaborator

just marked as a draft since you have it marked as WIP. Feel free to mark it as ready to review when it's ready 😄

@stephenhensley
Copy link
Collaborator

Also, we'll be reviewing, and getting the MidiHandler updates merged into libdaisy (and the examples here) sometime next week. Since I know this is semi-dependent on that, that I'd give you an update since that PRs been sitting for a little.

@stephenhensley
Copy link
Collaborator

@baumgartnerniels It's been a little bit, but I just wanted to ping you to see if you had any interest in picking this back up?

All the MIDI stuff you were initially waiting on should be resolved (this could actually work with UART and/or USB MIDI now as well).

@baumgartnerniels
Copy link
Contributor Author

Hi @stephenhensley
Right! Sorry, I kind of forgot about this as i just quickly patched the missing bits back then and flashed it to my unit. I'm in the middle of an exam period atm. But I could probably clean this up sometime in january/february.

@stephenhensley
Copy link
Collaborator

@baumgartnerniels sounds good!

No worries. I just wanted to ping since the PR has been sitting for a while, and it is certainly a very cool feature!

Thanks!

@pagarreton
Copy link

hello, did anyone try to add midi support to Nimbus?

hyrfilm pushed a commit to hyrfilm/DaisyExamples that referenced this pull request Aug 15, 2024
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.

3 participants