Van
Well-known member
Hi there;
I'm trying to control a 64 led matrix (on my push2) that is controlled simply via midi noteOn() massages.
I have this code :
this gives me pretty much exact 320ms per function call, or 5ms for a midi noteOn() call.
Can this be improved?
thanks and greets!
PS. a interesting readout about latency in MIDI: https://www.soundonsound.com/techniques/truth-about-latency-part-2
I'm trying to control a 64 led matrix (on my push2) that is controlled simply via midi noteOn() massages.
I have this code :
Code:
#include <Arduino.h>
#include "USBHost_t36.h"
USBHost myusb;
USBHub hub1(myusb);
USBHub hub2(myusb);
MIDIDevice_BigBuffer midi1(myusb);
bool led_state = false;
int row;
int column;
void performanceTest(){
elapsedMillis took_time;
led_state = !led_state;
row = 0;
while(row<8){
column = 0;
while(column<8){
midi1.sendNoteOn(36 + (row * 8) + column, led_state, 1);
column++;
}
row++;
}
Serial.print("took time_: ");
Serial.println(took_time);
}
void setup() {
while(!Serial);
Serial.begin(115200);
delay(1500);
Serial.println("USB Host InputFunctions example");
delay(10);
myusb.begin();
}
void loop() {
performanceTest();
}
this gives me pretty much exact 320ms per function call, or 5ms for a midi noteOn() call.
Can this be improved?
thanks and greets!
PS. a interesting readout about latency in MIDI: https://www.soundonsound.com/techniques/truth-about-latency-part-2
Last edited: