Go Down

Topic: Question about midi library, storing last received values (Read 1 time) previous topic - next topic

Allordacia1

I can't find a good answer to this via google-fu and I have not started building my project yet but this would determine what I would need to implement. Reading through the midi library documentation I noticed that it mentioned when using midi read it stores the last received value but it gets replaced upon receiving the next value. With that being the case, am I correct in assuming that I can store a received value as a variable to recall later? I would think that this is how sequencers work, but wasn't sure.

I am debating between using the music mkr board or a mega for a project that will involve a keyboard with 7 midi outputs that would be hard coded to different channels and could be switched between using a dial on the keyboard. Would the mega be the only way to go to accomplish this given its additional inputs and outputs? My other thought was to have a micro handle the midi output for each channel and use the mkr music to send the information to whichever channels micro that is currently selected but I am not sure whether or not latency would become problem or not.

Grumpy_Mike

Quote
Reading through the midi library documentation I noticed that it mentioned when using midi read it stores the last received value but it gets replaced upon receiving the next value.
Well not so much value but message, a MIDI message can be one, two or three bytes long.

Quote
With that being the case, am I correct in assuming that I can store a received value as a variable to recall later?
Yes.

Quote
I would think that this is how sequencers work,
No sequencers work by having data in the memory set by something and constantly outputting that in a loop. However, that is how automatic chord generators MIDI echo and arpeggiators work.

I think you are getting mixed up about MIDI channels. They are not hard coded and require only a single MIDI output stream for 16 MIDI channels. It is rare that you would want two separate MIDI streams out of a system. It can be done of course but each channel requires a separate MIDI input to connect into.

If you get an Arduino Leonardo or Arduino Micro, or Teensy then you can make it look like a USB HID MIDI interface.

Go Up