I2c Bus for USB MIDI

Hi there,

I am a bit new to Arduino so sorry if my questions aren't clear enough:

I am a musician using Max MSP (MAX 7). I bought a Leonardo in order to use it as a sensor - USB MIDI interface to provide MIDI Controllers IN for MAX.

My pressure sensor is analogic, and analogic inputs though serial to Max seems quite easy.
But What about formating MIDI messages and using my Leonardo as a MIDI interface ? would someone have an example ?

Then comes a harder question (for me):
I also have a digital accelerometer Grove - 3-Axis Digital Accelerometer(±1.5g) | Seeed Studio Wiki
connected on the I2c Leonardo Bus (though grove Base shield Base Shield V2 | Seeed Studio Wiki)

Then is the Wire library enough ? Would someone have an example of how to read the de-multiplexed 3 axis datas?
And how should I combine Wire.h with USB MIDi.h to get separated MIDI CC INs to Max ?

How someone can understand my questions and help.

Best!
d

The Arduino MidiDevice Tutorial. I suppose the pressure device value could be used in place of the fader value shown in the tutorial.

Hi gdsports and thank you !

Would you or anyone have some tips for the I2C accelerometer too ?

Best

@dragost The output of the 3D accelerometer are 3 numbers. You could map the numbers to MIDI CC messages. The following is a good summary of MIDI message format. There are lots more information if you google for "arduino midi".

MIDI message format