I own an Akai APC 20 Midi controller, it has a 8*5 grid with soft buttons and 3 colour leds beneath them. I use it in software like Ableton and Traktor, but I'm having an issue with it, that's why I started making a patch in PD.
The problem basicly is that whenever I wanted to light up a certain amount of LEDs (for example cue points when a deck loads), it causes distortion on the sound. It's an issue that a lot of people experienced that use these types of controllers (for example the Launchpad also has this problem).
One solution is to delay the midi signals coming from the software to the controller, that way the LEDs won't light up at the same time and the problem would be solved. We're talking about milli seconds by the way, so it if works, it's fine.
Anyway, the grid is made up out of 8 columns and 5 rows. Each column works on a different midi channel, but the buttons have the same notes. So it looks like this:
Delaying those channels wasn't a big problem. The Midi In Device is Midi Yoke 1 (which Traktor outputs) and the Midi Out Device is my APC 20 controller. I made a [notein] for each channel and delayed the [noteout] for each channel with different [pipe] values, like this:
That works just fine and it also has improved the distortion of the sound. But my ultimate goal is to delay each led seperately, but I've tried so many different things that I don't really know what I need to do now.
One thing that came to mind was to use an IF condition on the note number. So if [== 53] would for example cause a delay of 100ms, [==54] would cause a delay of 200ms, etc... But I couldn't get that to work.
Another thing I thought of was to use [random] and feed it different values for every note it picked it up, but again... it wouldn't work.
I was also wondering if it would be possible to not only listen to a certain channel, but also listen to a certain note. I couldn't really find anything about that in the documentation, so that's why I ended up here
I added the patch I created as an attachment, so if anyone has any ideas about how I should proceed, that would be wonderful.
Thanks in advance!
Greets