Hi guys.
I am experiencing some problem with latency in my setup. Maybe some of you guys can spot the problem and point me in the right direction?
The setup is as follows.
I am sending usbMidiNoteOn to teensy 3.2 running the merge of Fastled and Pauls WS2812Serial to lit the leds respectively. On the midiNoteOff i am trying to make the leds fade out with nScale8 at a value i set with a midi cc message. Everything works fine when the fade out is instant. But when i make the fade longer i experience some kind of latency. Its like the noteOn/noteOffs stack up and get executed later when the leds have updated in the while loop and i experience a latency like the noteOn/off gets executed several seconds after i stopped sending notes.
At first i thought this could be due to how the usb stacks get sent but because i dont get the same problem when the fade out is instant i think its rather something with the while loop on the fade out off the leds thats gets in the way.
My idea then was to try and make some code that stops to execute the while loop when a new usbMidiNoteOn arrives to not stack them up. hence the Booleans noteOff1Active etc. But i doesnt seem to work. I get the same Time of the previous fade out even when i new noteOn arrives which makes me think something wrong with the code.
Hope anyone of you guys can enlighten me.
Best regards Niklas
I am experiencing some problem with latency in my setup. Maybe some of you guys can spot the problem and point me in the right direction?
The setup is as follows.
I am sending usbMidiNoteOn to teensy 3.2 running the merge of Fastled and Pauls WS2812Serial to lit the leds respectively. On the midiNoteOff i am trying to make the leds fade out with nScale8 at a value i set with a midi cc message. Everything works fine when the fade out is instant. But when i make the fade longer i experience some kind of latency. Its like the noteOn/noteOffs stack up and get executed later when the leds have updated in the while loop and i experience a latency like the noteOn/off gets executed several seconds after i stopped sending notes.
At first i thought this could be due to how the usb stacks get sent but because i dont get the same problem when the fade out is instant i think its rather something with the while loop on the fade out off the leds thats gets in the way.
My idea then was to try and make some code that stops to execute the while loop when a new usbMidiNoteOn arrives to not stack them up. hence the Booleans noteOff1Active etc. But i doesnt seem to work. I get the same Time of the previous fade out even when i new noteOn arrives which makes me think something wrong with the code.
Hope anyone of you guys can enlighten me.
Best regards Niklas