Help with MIDI data transmission

Hi !

I’m working to make a MIDI pedal with an Arduino Uno and the Sparckfun MIDI Shield. The first thing I try to program is a Rotator (Like Michael Brecker with the EWI (Electric Wind Instrument) in “Original Rays”). So i made the code and It work fine but i can only transmit the note with the velocity. I would like to send pitch bend and after touch in parallel. So here’s the code :

#define WAIT 0

int n;
int i;
int previousn;

byte note;
byte velocity;
byte previousNote;
byte previousVelocity;
byte previousNote2;

int action=WAIT;

void setup() {
  Serial.begin(31250);     
}

void loop () {
 
  if (Serial.available() > 0) {
       
    // read the incoming byte:
    byte incomingByte = Serial.read();
    
    if (incomingByte == B10010000) //Note on Channel 1
    { 
      action = 1;  
    }
    else if (note==0 && action != WAIT) //Wait for note value
    { 
      note=incomingByte;
      
    }
    else if (note!=0 && action != WAIT)  //Velocity
    { 
      velocity=incomingByte;
      
      if(action == 1)
      {
        if(velocity == 0x00 && previousNote != note)
        {
          i--;
          if(i==-1) i=3;
        }
        if(i==0) n=-10;
        if(i==1) n=-5;
        if(i==2) n=-7;
        if(i==3) n=-2;
        Midi_Send(0x90, note, velocity);
        Midi_Send(0x90, note + 7, velocity);
        Midi_Send(0x90, note + n, velocity);
        if(velocity > 0x00 && previousVelocity > 0x00)
        {
          Midi_Send(0x90, previousNote + previousn, 0x00);
        }
        if(velocity == 0x00 && previousNote != note)
        {
          i++;
          if(i==4) i=0;
          i++;
          if(i==4) i=0;
        }
        if(velocity == 0x00 && previousNote == note)
        {
          i++;
          if(i==4) i=0;
        }
      }
      previousNote2=previousNote;
      previousNote=note;
      previousVelocity=velocity;
      previousn=n;
      note=0;
      velocity=0;
      action=WAIT;
    }
    else{}
   } 
}

void Midi_Send(byte cmd, byte data1, byte data2) {
  Serial.print(cmd, BYTE);
  Serial.print(data1, BYTE);
  Serial.print(data2, BYTE);
}

I hope someone have a solution for my problem !

Bye !

Hi

I am also very interesting in this project http://youtu.be/4kBpxBJkknY but there seems to be no existing info on how to go about making it work as in the video.

Have you any progress in your development on the rotator yet ?

Cheers / Tobie