sacreYoubeurt
Member
Hi there,
First I would like to thank Paul for his work on Teensy and the Arduino environment in general and thank in advance the community for the time it will spend on this thread.
I and 2 other guys are working on a project of MIDI modular controller.
The principle is :
A master unit communicates thru MIDI usb with midi software on computer.
Slave units handles the actual controlling parts (knobs, encoders, faders etc.) and communicates in I2C (half duplex) with master unit.
When master request values from slave, this one send back to him the changing values thru I2C.
Master then passes it to usbMIDI.
When master receives MIDI data from computer, he sends values back to slave thru I2C.
Configuration :
* Master Teensy 4
* Slave Teensy 4 with 6 encoders multiplexed with 74HC165 shift registers using EncoderTool library from luni64 (slightly modified, use the attached one)
* I2C library is Richard-Gemmell Teensy4_i2C https://github.com/Richard-Gemmell/teensy4_i2c
* Teensyduino native usbMIDI library
* Macintosh OS 10.15.7 with Ableton Live as MIDI software
In principle, things are working almost okay.
I mean we manage to control Ableton Live with slave encoders.
When we send MIDI back, the encoders values are well set, i.e. if we move again one of the encoder, it will restart from the updated value.
The issue we're facing is with a lot of MIDI feedback values.
When Ableton Live sends let's say 12 or more continuously changing CC values, the MIDI data entering in Ableton becomes inacurrate, and it goes worth as we increase the amount of MIDI feedback.
Given that usbMIDI is much faster (I read at least 12Mbits minimum) than I2C, we feel like master is certainly saturating I2C bus in the feedback operation.
Yet for the purpose of the project, I2C, or any hot swappable capable protocol, is required to communicate between master and slave units.
So we thought solution could be :
- first, increase the speed of the I2C bus
In this perspective, we tried to set I2C clock to the higher clock frequency available in the library, i.e. 1 Mbits, without any obvious improvement.
We asked Richard Gemmel on GitHub if higher speed modes would be implemented in a near future.
- second, slow usbMIDI in order to not saturate I2C bus
We don't have a clue about how to do this.
So our questions are :
Do you think it looks like the good way to improve I2C flow ?
If yes, do you have any idea to reduce usbMIDI speed ?
Given that our codes are quite long and use miscellaneous libraries, we thought it was better to join all in a .zip folder rather than copy code in this post.
Thank you in advance for your replies.
Best regards,
View attachment ModullarController_i2cSaturIssue_PJRC_210223.zip
First I would like to thank Paul for his work on Teensy and the Arduino environment in general and thank in advance the community for the time it will spend on this thread.
I and 2 other guys are working on a project of MIDI modular controller.
The principle is :
A master unit communicates thru MIDI usb with midi software on computer.
Slave units handles the actual controlling parts (knobs, encoders, faders etc.) and communicates in I2C (half duplex) with master unit.
When master request values from slave, this one send back to him the changing values thru I2C.
Master then passes it to usbMIDI.
When master receives MIDI data from computer, he sends values back to slave thru I2C.
Configuration :
* Master Teensy 4
* Slave Teensy 4 with 6 encoders multiplexed with 74HC165 shift registers using EncoderTool library from luni64 (slightly modified, use the attached one)
* I2C library is Richard-Gemmell Teensy4_i2C https://github.com/Richard-Gemmell/teensy4_i2c
* Teensyduino native usbMIDI library
* Macintosh OS 10.15.7 with Ableton Live as MIDI software
In principle, things are working almost okay.
I mean we manage to control Ableton Live with slave encoders.
When we send MIDI back, the encoders values are well set, i.e. if we move again one of the encoder, it will restart from the updated value.
The issue we're facing is with a lot of MIDI feedback values.
When Ableton Live sends let's say 12 or more continuously changing CC values, the MIDI data entering in Ableton becomes inacurrate, and it goes worth as we increase the amount of MIDI feedback.
Given that usbMIDI is much faster (I read at least 12Mbits minimum) than I2C, we feel like master is certainly saturating I2C bus in the feedback operation.
Yet for the purpose of the project, I2C, or any hot swappable capable protocol, is required to communicate between master and slave units.
So we thought solution could be :
- first, increase the speed of the I2C bus
In this perspective, we tried to set I2C clock to the higher clock frequency available in the library, i.e. 1 Mbits, without any obvious improvement.
We asked Richard Gemmel on GitHub if higher speed modes would be implemented in a near future.
- second, slow usbMIDI in order to not saturate I2C bus
We don't have a clue about how to do this.
So our questions are :
Do you think it looks like the good way to improve I2C flow ?
If yes, do you have any idea to reduce usbMIDI speed ?
Given that our codes are quite long and use miscellaneous libraries, we thought it was better to join all in a .zip folder rather than copy code in this post.
Thank you in advance for your replies.
Best regards,
View attachment ModullarController_i2cSaturIssue_PJRC_210223.zip