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
Sporadic sysEx msg broadcast/capture #71
Comments
Just read this on the "callbacks section". One of the ID's block is quite detailed & also aCTUALLY sends another sysex msg request from within it. |
Aplogies not too clued up on callbacks. But does the callback run in parallel to the main Loop() code? |
Is there a detailed explanation of how the midi.read() & callback works anywhere pls. Struggling to understand how this works to be able to trouble shoot my issue. ie |
Here are a few pointers:
|
thanks - I'm obviously not an experienced/knowledgable programmer by my questions :) - but what difference does it make as to whether teh callback code runs long or the loop processes that code - if nothing is running in parallel |
Nothing from your code runs in parallel, but the MIDI stream does not stop, and thus slowing down the loop will make the parsing slower, therefore lead to latency between the actual reception of the byte in the Arduino RX buffer and the action in your code. It's like a toll booth, if you want traffic to be fluid, you need incoming cars to exit as fast as possible to make space for the next incoming cars. Obviously, this kind of reasoning assumes a continuous flow of MIDI data, if your application only uses event-based communications (sending/receiving messages when a discrete event happens every now and then), then this is much less of a constraint. |
Thanks again for your explanation. At this point, I'm only looking to read msgs after I send a request out to receive one, either:
|
Sorry for more questions. So is only one msg availble to be read at any one time? |
Yes, the last one received.
Yes.
Not until they've been parsed and therefore passed onto your program through callbacks or direct access.
Yes. Suppose that you have a callback for NoteOn, and the RX buffer contains two NoteOn messages. The first message will be parsed, recognized as NoteOn, the callback will be fired with this data, then |
Thanks again Franky. This has helped me understand things a little better. I've also added some code to wait for each returned msg before sending the next change/request.
It seems to be working alot better & more consistantly now. I am however noticing one particular msg seems seems to take longer to "broadcast" (and thus read) than the others. Anything obvious on this one pls? |
You have try increase Sysex buff size? struct MySettings : public midi::DefaultSettings{ Seem Arduino has many problems in dialog with peripherial (and bad isolation from external power: i have destroy a China Nano after 1 hour that work with a external powered servo), and also if i made a good midi interface with a good octopuler and square signal, is no way to receive all data transmitted from midi keyboard when i send all banks/patches/rithms (that normally work with a pseudo Sound Blaster with drives for Win7 64, also if is not certified and i need start Win without driver certified for use midi keyboard). |
ProgramChange messages are inherently shorter than SysEx, but still for your use case it should not matter, unless you plan to send a large amount of SysEx data to your AxeFX2. Also using the Serial port for debugging slows the loop down, it's not an issue for sending data as there is no parallelism involved there, but if you find the reception on your controller to be lagging, that could be a cause. |
Hi
I have a self built midi foot controller for my AxefX2 guitar processor.
It's Teensy 3.6 based & has both midi IN & OUT circuits.
One particular switch triggers the preset to increment by 1 via the following commands:
I call MIDI.read at the end of my void_Loop().
In turn my TFT display gets updated with PSet number, Bank Number, PSet name and all the Effect blocks in the Pset.
On the whole it works fine - but now and again I notice that the PSet name does not get up dated on the TFT - even though everything esle does.
I've noted the following whilst trouble shooting:
1- the CC cmd if sent on its own triggeres NO sysex msgs
2- the PC cmd if sent on its own triggeres the AFX to broadcast PSET NUMBER & PSET NAME
3- the EffectID_Sysex cmd if sent on its own triggeres the AFX to broadcast IA, Set SCENE & PARMAETR ID sysex msgs.
When all this happens - everything gets updated OK.
Occasionally when the name is not updated - it corresponds with the PSET name msg not being sent.
That makes sense I guess - but what I don't get is what would prevent this msg being recieved.
I'm not specifically requesting this msg - it's getting automatcially broadcast after I send the Program Change cmd.
I even tried adding a request sysex for the PSET name - but again only works sporadically.
Any ideas why this would be.
Dont know enough about sysex msgs to know if its a timing issue or whether by their nature they are flakey anyway OR whether its just bad code on my behalf.
The text was updated successfully, but these errors were encountered: