LCD and MIDI foot controller?

Hello everyone I'm working on a Arduino midi foot controller, its real simple just two button that scrolls up and down, and has an expression pedal input, and runs through serial.

I would like to add a LCD that would display the patch name and or number from the FX Unit that it will be controlling. If I need to add a midi in port that shouldn't be a problem.

Any ideas? I searched but couldn't find any examples of what I'm trying to achieve. This is my current code sorry if its a bit sloppy its all borrowed code. It compiled fine and works good! :wink:

#include <MIDI.h>
MIDI_CREATE_DEFAULT_INSTANCE();

#define expPin A0

int currentVal = 0;
int lastVal = 0;
int progNo = 0;
int upLastTime, downLastTime, upNow, downNow;

void setup() {
MIDI.begin();
MIDI.setInputChannel(1);
pinMode(2, INPUT);
pinMode(3, INPUT);
digitalWrite(2, HIGH); // enable pull up
digitalWrite(3, HIGH); // enable pull up
upLastTime = digitalRead(2);
downLastTime = digitalRead(3);
}

void loop(){
currentVal = analogRead(expPin);
currentVal = map(currentVal, 150, 700, 0, 127);
currentVal = constrain(currentVal, 0, 127);

if(abs(currentVal-lastVal) > 1)
{
MIDI.sendControlChange(1, currentVal, 1);
}

lastVal = currentVal;
delay(1);
upNow = digitalRead(2);
downNow = digitalRead(3);

if (upNow == HIGH && upLastTime == LOW) {
progNo++; // increment program change
if(progNo > 95) progNo = 0; // stop it going too high
MIDI.sendProgramChange(byte(progNo), 1);
delay(20); // bit of debounce delay
}

if (downNow == HIGH && downLastTime == LOW) {
progNo--; // decrement program change
if(progNo < 0) progNo = 95; // stop it going too low
MIDI.sendProgramChange(byte(progNo), 1);
delay(20); // bit of debounce delay
}

upLastTime = upNow;
downLastTime = downNow;
delay(50);
}

Displaying your patch number wouldn't very difficult because it's the information you send to your FX unit.
Displaying your patch could be a bit harder. You'll have to send your FX unit a sysex MIDI message requiring this information and then wait your FX unit to answer with its own sysex MIDI message wich you'll have to decode to extract patch name.
To know which message to send and the structure of the FX answer, you have to read the detailed MIDI implementation of your FX unit. Look for something named Data Request and Data Set. :wink:

PS : If you use [ CODE ] tags inside your posts, it will make your message much more readable...

Hi, thanks for your reply, I apologize for taking so long to respond. I believe your right it maybe almost impossible to receive the patch info.

The FX unit is a original VOX tonelab.

When I plug the tonelab into a midi interface I used the program MIDI-OX and monitored. Pressing patch buttons or using the tonelab software midi-OX didn't receive any sysex messages It just didn't pickup any message at all. MIDI-OX picked up my arduino midi foot controller and the tonelab responds to midi commands. I believe the tonelab may send messages that aren't PC, CC, or sysex messages or like you mentioned are encrypted.

I think my best bet would be to add something like this.

Question is how do I make it store the patch number when I turn the foot controller on and off?