Wireless MIDI (with arduino mega, teensy 2.0, 2x nRF24L01 and the RF24 library)

Hi,

First I would like to thank Maniacbug for making the RF24 library, awesome work! Without it I wouldn't have considered using the nRF24l01 and with the price of the Xbee radios this project would never get off the ground.

Im working on a project where Im using 12 LDR sensors to wirelessly send midi data through arduino mega ->nRF24l01->teensy 2.0->ableton live. Im really excited by the possibilities and Im hoping this thread can help others to build a similar setup(wireless midi performance controller anyone?).

The first hurdle was to find the correct SPI pins on both the mega and the teensy2.0. Here is how I have it connected and working with the pingpair example sketch:
arduino mega:
Vcc - 3.3V
CE - 8
CSN - 9
SCK - 52
MOSI - 51
MISO - 50
IRQ - NC

teensy 2.0:
Vcc - 3.3V from LM317 voltage regulator
CE - 8
CSN - 9
SCK - 1
MOSI - 2
MISO - 3
IRQ - NC
rolepin 7 connected to gnd.

So far so good, Im on the air! I then tried the led remote example and with some tweaking of the pin numbers got that working.

Im still pretty new to writing code and Im really struggling with sending the data array over the RF link.
I have a working code for reading the LDR's on the mega:

#define inputs 8
#define e 1        // this is the delta needed in
                   // currentPot[i] to send a message
                   
int currentPot[8] = {0,0,0,0,0,0,0,0};    
int pot[8] = {0,0,0,0,0,0,0,0};
int channel[8] = {1,2,3,4,5,6,7,8}; 

void loop() 
{
  for(int i=0; i<inputs; i++) {
    currentPot[i] = analogRead(i) / 8;    
    if(abs(currentPot[i]-pot[i]) > e) {
      sendMidi(channel[i], currentPot[i]);
      pot[i] = currentPot[i];
    }
  }
}

I've already tried several times at integrating this code with the led remote example but Im really struggling with the send and receive part. Basically I would like the mega to send the package when it has scanned all the LDR's and the teensy to recognize a change and send out a midi cc message.

Any help would be highly appreciated.

Hi! My names Steve. I have just got my NRF24l01s (x2) working using a duemilanove and a mega250 board being able to press a button on one board with an LED lighting up on the other. I am wondering if you managed to get your LDR transmitting MIDI messages via wireless? I know this is an old post but am interested to know .
I want to make some kind of DATA logger that sends its info over the NRF24l01 radios converting the DATA to MIDI....

any news on this?

Hi! My name is Lin from Taiwan,thanks for this info,I'm creating a midi wind controller,does someone can share some simple code of rf24? I just don't know the payload must set one byte or wait the 3 byte then send to another rf24 :roll_eyes: thx!