It has been hard to find a title that could summarize my doubts.
First of all, hello everyone, I'm a newbie (but enthusiastic) Arduino user.
I'm trying to make an installation with leds, programmed via Ableton Live using midi signals generated on this DAW (sequencer). In my research, I quickly came across Maxuino, a fantastic combination of Arduino and MaxMSP that just do that. You can play a midi keyboard or play a midi loop, and it gives 0s and 1s on Arduino's digital ports, where you can place some leds and have fun.
I don't know if the MaxMSP patch is relevant, but here it is:
(I'm not embedding it because it deforms the layout)
This works as a plugin on Ableton, since Ableton features Max4Live, which allows users to add plugins made with MaxMSP. I can't edit this patch though, because I just have the Max4Live and the Max5 Runtime, not the full version.
And this is the code running on the Arduino, it's from Firmdata, the StandardFirmdata:
Ok, so now, with this, I can have let's say 8 leds going on and off with the information taken from a midi keyboard or midi loop from Ableton. That alone is very cool, but I'd like to go deeper.
I thought ok, this is just putting 0s and 1s on the Arduino's digital outs, so I could use those 0s and 1s and use them to decode something bigger. That would be having 8 bits which could give me 2^8=256 combinations, if I use decoders.
For this, at first, I started looking on "conventional" decoders, that would take this 8 bits and activate 1 led. It would be a bit crazy because of the combination of decoders that would be needed, but could be possible. Then I realized a decoder can activate just one output at a time, and that would be useless. Why bother having 256 leds if you can't light all of them, or combinations?
So, the next thought was about multiplexing, tricking the eye, you know, there would be just one led on at any time, but so fast it would look like there were more. Sorry for my english, really sometimes it's hard to write on this topics. Problem with multiplexing was that people seems to say that multiplexing and leds are not very friends, leds loose intensity with multiplexing. I need leds to be 100%.
And then, the TLC5940 appeared. This IC has been talked around here, it's, as TI says, a "a 16 channel, constant current sink LED driver". Basically as I see it, it's a decoder with the multiplexing integrated in an easy way, capable of maintaining the intensity on its ports. The only problem about this? It receives the data via serial. Well, this is a problem because it adds more steps to the chain.
Anyway, I found the 74HC165, a component which, if I'm not mistaken, could transform parallel data into serial data, so at first sight, the serial feature on the TLC5940 wouldn't be a problem.
So far, at this point, it would be great if someone could tell me if I'm missing something, or if this seems reliable, feasible, because the next thoughts are maybe not possible.
And now, the next step. Thinking and researching about this serial feature was something that also opened my mind to a world of possibilities.
Do you think it would be possible to catch the bits from Ableton before they reach the actual ports, virtually convert them into serial and then taking them out trough a single digital output via serial?
In a more schematic way, the first approach was this:
Midi generation in Ableton -> Conversion of Midi data into output ports information -> Put this information on output ports.
And the second approach would be:
Midi generation in Ableton -> Conversion of Midi data into output ports information -> Convert output ports information into serial information -> Put this serial information on one output port.
Why this second approach? Well, this would give the chance to upgrade the installation greatly and easily, since with 8 bits I had 256 combinations, and now I would have that on each port, that would be more than 2000 leads! At this moment I'm not ready to have that much leads...but I'd love to have something that I could upgrade easily in the future.
I've been looking at the Firmdata code but I'm a retard, I'm not sure about which part could be modified for this, I'm not sure even if this is possible (that's why I'm here, mostly). The function that seems closest for this is void digitalWriteCallback(byte port, int value).
But there's also a Serial communication going on, that I don't fully understand (I'm specially bad with Serial communications) called void sysexCallback(byte command, byte argc, byte *argv).
And a function for the I2C bus, that correct me if I'm wrong, but could be the way the midi is taken from one place to another? Called void enableI2CPins().
So, sorry for the long, long post...hopefully there will be someone patient enough to read this, and will understand something, I know I'm not the best explaining myself. Also, sorry if there's information about this out there...I haven't been for days or weeks, researching, but I didn't find something I understood, sorry if the problem is I'm retarded. If the second approach complicates too much things I'd be happy with the first one (if I'm doing it right), but I'd hate to research and get into the second one and having to change things at an electronic level...I don't have much money for this things, neither time.
Thank you so much for your time.
Regards.