Peavey Vypyr VIP Amp Diy Midi Footswitch

Posted January 21, 2016

I have a Peavey Vypyr VIP 100 Guitar Amp. I really like the amp, but the Sanpera footswitch that I have for it is really limited. I’ve found that several things are really helpful when using a footswitch for an amp, and the Sanpera really doesn’t deliver on any of those things.


My requirements:
1. A way to toggle two fixed volume levels. I need one for rhythm and one to punch in for a lead volume.
2. Several presets directly accessible by a single switch press.
3. A switch for Reverb on/off
4. A switch for Delay on/off

I did some searching, and found that the Sanpera pedal/switch uses MIDI to communicate with the amp. I started looking for a programmable MIDI foot pedal, and all of them were expensive. I really couldn’t find anything that users said would work with the Vypyr amps. I also found that, using the Arduino micro controller board, you can create your own MIDI commands to control the amp. I decided this might be the best way to go.

I was having trouble finding any documentation about the MIDI commands specifically for the Vypyr amps. I finally found a list, someone had created, and posted to a forum website. With that info, I was good to go. I ordered some things from ebay:

1. The Arduino Uno (actually a clone for $12 including shipping)


2. MIDI cable. I figured I would just cut one end off and pin the wires directly. I was having trouble finding a reasonably priced MIDI connector socket. This cable was $6.99

3.Some switches. SPDT Momentary Stomp switches. I found these for $2.99 each, I ordered 6ea.

4. Prototyping breadboard to do some experimenting. This included a  lot of jumper wires. $7.99

5. I later ordered some breadboards, for the permanent version of this project. 10 of them for $2.79

After I got all this stuff, minus the last one, I started wiring something up. I found this article about wiring a MIDI output circuit.

http://www.notesandvolts.com/2015/03/midi-for-arduino-build-midi-output.html

That looked pretty easy. I was careful to get the pins correct on the MIDI cable.

Then, I found this code for controlling MIDI, to load to the Arduino.

http://playground.arduino.cc/Learning/MidiFootCode

This would prove to be the hard way to do this, at least for me.

I wired a pullup resistor and then was just going to manually jumper to ground, to simulate a switch.
I set my Arduino software to change what I thought was the Post Gain on the amp.
I couldn’t get it to work.

I eventually learned a few things about this:

You should make sure the Arduino development software is configured to use the correct com port. It is USB, so you would think it would work, but no, you must change it. The pulldown menu will actually show which one the arduino is currently connected to when you select the port. Mine was 3.
I thought I was programming the Arduino succesfully, but the timeout is like a minute, before you get an error. I wasn’t paying attention to the program that long.

The MIDI library really isn’t necessary to load in your program. I found this great article about MIDI for programmers that helped me a lot.
http://www.roguescience.org/wordpress/building-a-midi-out-controller/part-7-add-a-midi-port/exercise-13/
MIDI is a serial bus that runs at 31250 baud. All you have to do is configure the Arduino serial for that speed, then send the commands.

The original list of Peavy Vypyr MIDI commands where incorrect. I finally found a forum where someone put a MIDI logger on the Sanpera foot pedal, and made a list of what actually came out of it. This proved to be succesful.
http://www.vguitarforums.com/smf/index.php?topic=3119.0

I finally got my breadboard version to actually change something on the amp! Now to make it complete.
I decided to make the switchboard out of hardboard and wood. Here is what I ended up with.



I started wiring the switches up. I haven’t received the perf boards yet, so I wired it up as best I could, point to point. I wanted to work on the programming when using more switches.

 

 

It was kind of messy, but it worked.

I spent a lot of time trying to figure out how to get the Reverb to turn off, and on with a switch.
I finally figured it out after a week of trial and error.

The Reverb on/off is controlled by a note on/off command, not a CC command as the volume was.
The Reverb on/off isn’t active unless you change the mode to, what they call, Manual mode.
Manual mode is activated with a note on/off command as well.

To use the note on/off command, you must send the note on, then the note off. This toggles the mode you are controlling. If it was on, it will turn off. If it was off, it will turn on.

So, to get the Reverb to turn off, you must:

 

I decided to use the left most switch to change modes for the foot pedal. The four inside switches will change modes:
Mode 1 for preset mode. Each switch changes to another preset number. The far right switch will always be boost, and the far left switch will be the mode switch.
Mode 2 for on/off mode. This will be for Reverb on/off, Delay on/off, Stomp on/off, and Effect on/off.

Here is what I have so far, minus the LED’s.

 

On to the finished product, well almost.
Here is the schematic diagram of what I hope to end up with.

 

Here is the current (working) state of the project. I need to paint it, put a bottom on it, and make some better labels.

 

 

 

Here is the code that finally works!

/*
 * 7.1 Midi OUT controller
 * roguescience.org
 *
 * digital pin 11 (OUTPUT/PWM) --> LED
 * digital pin 2 (INPUT) <-- button
 * analog pin 0 <-- pot
 * tx1 <-- pin 5 (5 PIN DIN aka MIDI jack)
 *
 * Send a MIDI note when the button is pressed and sends MIDI
 * CC data when a potentiometer is turned.
 */

int ledPin = 11;                //choose the pin for the LED - needs to be (3,5,6,9,10, or 11)
int buttonPin2 = 2;               //choose the input pin for a pushbutton
int buttonPin3 = 3;               //choose the input pin for a pushbutton
int buttonPin4 = 4;               //choose the input pin for a pushbutton
int buttonPin5 = 5;               //choose the input pin for a pushbutton
int buttonPin6 = 6;               //choose the input pin for a pushbutton
int buttonPin7 = 7;               //choose the input pin for a pushbutton
int buttonPin8 = 8;               //choose the input pin for a pushbutton
int buttonPin9 = 9;               //choose the input pin for a pushbutton
int buttonPin10 = 10;               //choose the input pin for a pushbutton
int buttonPin11 = 11;               //choose the input pin for a pushbutton
int buttonPin12 = 12;               //choose the input pin for a pushbutton
int buttonPin13 = 13;               //choose the input pin for a pushbutton
int potPin = 0;                  //choose the input pin for a potentometer
int buttonVal2 = 0;                    //variable for reading the button status
int buttonVal3 = 0;                    //variable for reading the button status
int buttonVal4 = 0;                    //variable for reading the button status
int buttonVal5 = 0;                    //variable for reading the button status
int buttonVal6 = 0;                    //variable for reading the button status
int buttonVal7 = 0;                    //variable for reading the button status
int buttonState2 = 0;            //variable to hold the buttons current state
int buttonState3 = 0;            //variable to hold the buttons current state
int buttonState4 = 0;            //variable to hold the buttons current state
int buttonState5 = 0;            //variable to hold the buttons current state
int buttonState6 = 0;            //variable to hold the buttons current state
int buttonState7 = 0;            //variable to hold the buttons current state
int bounceCheck2 = 0;            //variable for debouncing
int bounceCheck3 = 0;            //variable for debouncing
int bounceCheck4 = 0;            //variable for debouncing
int bounceCheck5 = 0;            //variable for debouncing
int bounceCheck6 = 0;            //variable for debouncing
int bounceCheck7 = 0;            //variable for debouncing
int delaymode = 1;               //variable for current delay on/off 1 = on
int reverbmode = 1;
int stompmode = 0;
int effectmode = 0;
int potVal = 0;                //variable for reading potentiometer value
int mappedPotVal = 0;          //variable for holding remapped pot value
int prevPotVal = 0;               //variable for storing our prev pot value
int THRESHOLD = 2;            //threshold amount
int current_vol = 0;        // variable to hold current volume for toggling
int current_reverb = 1;
int button_mode = 0;

void setup() {
  //pinMode(ledPin, OUTPUT);      //declare LED as output
  pinMode(buttonPin2, INPUT);     //declare pushbutton as input
  pinMode(buttonPin3, INPUT);     //declare pushbutton as input
  pinMode(buttonPin4, INPUT);     //declare pushbutton as input
  pinMode(buttonPin5, INPUT);     //declare pushbutton as input
  pinMode(buttonPin6, INPUT);     //declare pushbutton as input
  pinMode(buttonPin7, INPUT);     //declare pushbutton as input
  pinMode(buttonPin8, OUTPUT);     //declare pushbutton as input
  pinMode(buttonPin9, OUTPUT);     //declare pushbutton as input
  pinMode(buttonPin10, OUTPUT);     //declare pushbutton as input
  pinMode(buttonPin11, OUTPUT);     //declare pushbutton as input
  pinMode(buttonPin12, OUTPUT);     //declare pushbutton as input
  pinMode(buttonPin13, OUTPUT);     //declare pushbutton as input
  pinMode(A0, OUTPUT);
  pinMode(A1, OUTPUT);
  pinMode(A2, OUTPUT);
  pinMode(A3, OUTPUT);
  pinMode(A4, OUTPUT);
  
  digitalWrite(8, LOW);
  digitalWrite(9, HIGH);
  digitalWrite(10,LOW);
  digitalWrite(11,HIGH);
  digitalWrite(12,LOW);
  digitalWrite(13,HIGH);
  digitalWrite(A0,HIGH);
  digitalWrite(A1,HIGH);
  digitalWrite(A2,HIGH);
  digitalWrite(A3,LOW);
  digitalWrite(A4,HIGH);
  Serial.begin(31250);            //MIDI communicates at 31250 baud

  // set volume to low
  Serial.write(0xB0); //CC
  Serial.write(0x24); //volume pedal
  Serial.write(0x3C); //60
  current_vol = 0;
  // Set program 00
  Serial.write(0xC0); // Program change
  Serial.write(0x00); //  00
  
  
}

void loop(){

  buttonVal2 = digitalRead(buttonPin2);     //read input value from button
  buttonVal3 = digitalRead(buttonPin3);     //read input value from button
  buttonVal4 = digitalRead(buttonPin4);     //read input value from button
  buttonVal5 = digitalRead(buttonPin5);     //read input value from button
  buttonVal6 = digitalRead(buttonPin6);     //read input value from button
  buttonVal7 = digitalRead(buttonPin7);     //read input value from button
  delay(10);                              //wait 10ms
  bounceCheck2 = digitalRead(buttonPin2);   //check again
  bounceCheck3 = digitalRead(buttonPin3);   //check again
  bounceCheck4 = digitalRead(buttonPin4);   //check again
  bounceCheck5 = digitalRead(buttonPin5);   //check again
  bounceCheck6 = digitalRead(buttonPin6);   //check again
  bounceCheck7 = digitalRead(buttonPin7);   //check again

  // Boost ----------------------------------------------------------------------------------------------
  if(buttonVal2 == bounceCheck2){           //if val is the same then not a bounce
    
    if(buttonVal2 == LOW && buttonState2 == 0){
      if(current_vol == 0){
        
        Serial.write(0xB0); //CC
        Serial.write(0x24); //volume pedal
        Serial.write(0x7F); //127
        buttonState2 = 1;
        current_vol = 1;
        digitalWrite(A4,LOW);
      }
      else {
        
        Serial.write(0xB0); //CC
        Serial.write(0x24); //volume pedal
        Serial.write(0x3C); //60
        buttonState2 = 1;
        current_vol = 0;
        digitalWrite(A4,HIGH);
      }
           
    }
    if (buttonVal2 == HIGH && buttonState2 == 1) {   //check if the input is HIGH
      buttonState2 = 0;
     }
  }
   // 6534 - Effect onoff------------------------------------------------------------------------------------------------
  if(buttonVal3 == bounceCheck3){           //if val is the same then not a bounce
    
    if(buttonVal3 == LOW && buttonState3 == 0){
      if(button_mode == 0){
          Serial.write(0xC0); // Program change
          Serial.write(0x00); //  00
          buttonState3 = 1;
          digitalWrite(13, HIGH);
          digitalWrite(A1, HIGH);
          
          digitalWrite(A3, LOW);
      }
      else{
          //Effect on/off
        Serial.write(0x90); //Note 
        Serial.write(0x0C); //Manual 
        Serial.write(0x7F); //127 (on)
        Serial.write(0x90); //Note 
        Serial.write(0x0C); //Manual 
        Serial.write(0x00); 
        
        Serial.write(0x90); //Note 
        Serial.write(0x04); //Effect 
        Serial.write(0x7F); //127 (on)
        Serial.write(0x90); //Note
        Serial.write(0x04); //Effect
        Serial.write(0x00);

        Serial.write(0x90); //Note 
        Serial.write(0x0C); //Manual 
        Serial.write(0x7F); //127 (on)
        Serial.write(0x90); //Note 
        Serial.write(0x0C); //Manual 
        Serial.write(0x00);

                if(effectmode == 1){
                      digitalWrite(A2, HIGH);
                      effectmode = 0;
                  }
                  else{
                      digitalWrite(A2, LOW);
                      effectmode = 1;
                  }
      }
        
      
      buttonState3 = 1;
    }
    if (buttonVal3 == HIGH && buttonState3 == 1) {   //check if the input is HIGH
      buttonState3 = 0;
     }
  }
  // clean - stomp ------------------------------------------------------------------------------------
  if(buttonVal4 == bounceCheck4){           //if val is the same then not a bounce
    
    if(buttonVal4 == LOW && buttonState4 == 0){
      if(button_mode == 0){
          Serial.write(0xC0);  // Program change
          Serial.write(0x02); // 02
          digitalWrite(A3, HIGH);
          digitalWrite(13, HIGH);
          digitalWrite(A1, LOW);
          digitalWrite(12, LOW);
          digitalWrite(10, LOW);
      }
      else{
        //stomp on/off
        Serial.write(0x90); //Note 
        Serial.write(0x0C); //Manual 
        Serial.write(0x7F); //127 (on)
        Serial.write(0x90); //Note 
        Serial.write(0x0C); //Manual 
        Serial.write(0x00); 
        
        Serial.write(0x90); //Note 
        Serial.write(0x05); //Stomp 
        Serial.write(0x7F); //127 (on)
        Serial.write(0x90); //Note
        Serial.write(0x05); //Stomp
        Serial.write(0x00);

        Serial.write(0x90); //Note 
        Serial.write(0x0C); //Manual 
        Serial.write(0x7F); //127 (on)
        Serial.write(0x90); //Note 
        Serial.write(0x0C); //Manual 
        Serial.write(0x00);

                if(stompmode == 1){
                      digitalWrite(A0, HIGH);
                      stompmode = 0;
                  }
                  else{
                      digitalWrite(A0, LOW);
                      stompmode = 1;
                  }
      }
      buttonState4 = 1;
    }
    if (buttonVal4 == HIGH && buttonState4 == 1) {   //check if the input is HIGH
      buttonState4 = 0;
     }
  }
  // B-4 Skynyrd---------------------------------------------------------------------------------------
  if(buttonVal5 == bounceCheck5){           //if val is the same then not a bounce
    
    if(buttonVal5 == LOW && buttonState5 == 0){
          if (button_mode == 0){
              // change to skynyrd
              Serial.write(0xC0);  // Program change
              Serial.write(0x07); // 07
              clearallpresets();
              digitalWrite(13,LOW);
          }
          else {
              //Delay on off
              Serial.write(0x90); //Note 
              Serial.write(0x0C); //Manual 
              Serial.write(0x7F); //127 (on)
              Serial.write(0x90); //Note 
              Serial.write(0x0C); //Manual 
              Serial.write(0x00); 
              
              Serial.write(0x90); //Note 
              Serial.write(0x09); //Delay 
              Serial.write(0x7F); //127 (on)
              Serial.write(0x90); //Note
              Serial.write(0x09); //Delay
              Serial.write(0x00);
    
              Serial.write(0x90); //Note 
              Serial.write(0x0C); //Manual 
              Serial.write(0x7F); //127 (on)
              Serial.write(0x90); //Note 
              Serial.write(0x0C); //Manual 
              Serial.write(0x00); 

                  if(delaymode == 1){
                      digitalWrite(12, HIGH);
                      delaymode = 0;
                  }
                  else{
                      digitalWrite(12, LOW);
                      delaymode = 1;
                  }
              }
          
      buttonState5 = 1;
      }
      
    
    if (buttonVal5 == HIGH && buttonState5 == 1) {   //check if the input is HIGH
      buttonState5 = 0;
     }
  }

// Reverb-------------------------------------------------------------------------------------
  if(buttonVal6 == bounceCheck6){           //if val is the same then not a bounce
    if(buttonVal6 == LOW && buttonState6 == 0){
        if (button_mode == 0){
          // clean
          Serial.write(0xC0);  // Program change
          Serial.write(0x02); // 02
          clearallpresets();
          digitalWrite(A1,LOW);
        }
        else{
          //reverb on off
          Serial.write(0x90); //Note 
          Serial.write(0x0C); //Manual 
          Serial.write(0x7F); //127 (on)
          Serial.write(0x90); //Note 
          Serial.write(0x0C); //Manual 
          Serial.write(0x00); 
          
          Serial.write(0x90); //Note 
          Serial.write(0x07); //Reverb 
          Serial.write(0x7F); //127 (on)
          Serial.write(0x90); //Note
          Serial.write(0x07); //Reverb
          Serial.write(0x00);

          Serial.write(0x90); //Note 
          Serial.write(0x0C); //Manual 
          Serial.write(0x7F); //127 (on)
          Serial.write(0x90); //Note 
          Serial.write(0x0C); //Manual 
          Serial.write(0x00); 

          if(reverbmode == 1){
                      digitalWrite(10, HIGH);
                      reverbmode = 0;
                  }
                  else{
                      digitalWrite(10, LOW);
                      reverbmode = 1;
                  }
        }          
        buttonState6 = 1;
    }
    
    if (buttonVal6 == HIGH && buttonState6 == 1) {   //check if the input is HIGH
      buttonState6 = 0;
     }
  }
  
  //Button mode switch--------------------------------------------------------------------------------
  if(buttonVal7 == bounceCheck7){           //if val is the same then not a bounce
    if(buttonVal7 == LOW && buttonState7 == 0){
          if(button_mode == 0){
              button_mode = 1;
              digitalWrite(9, LOW);
              digitalWrite(8, HIGH);
              
          }
          
          else{
            button_mode = 0; 
            digitalWrite(8, LOW);
            digitalWrite(9, HIGH);
          }
                    
          buttonState7 = 1;
    }
    
    if (buttonVal7 == HIGH && buttonState7 == 1) {   //check if the input is HIGH
      buttonState7 = 0;
     }
  }
   

}
int clearallpresets(){
    digitalWrite(13,HIGH);
    digitalWrite(A1,HIGH);
    digitalWrite(A3,HIGH);
}

I decided to change a few things:

Here is what I think the labels should be, progressively more distorted presets, from left to right.
I made a sketchup file of the layout, with the pin assignments of each switch and led next to each of them.

 

Posted on January 21st, 2016 by Clayton

Posted in Around the House, Band stuff

9 Comments

9 Comments

  • Doru says:

    Great job man! I am trying to do something like this following your experience and some other info on the web. I hope i get it right. Did you finish it?

  • KegRaider says:

    Now that is RAD! I have been looking at getting a pedal board for my VIP1 AMP, but the cost is mental!

    Thank you ever so much for sharing, I shall attempt to get cracking with one of my spare arduinos for this.

  • Ionel Munteanu says:

    Firstly, nicely done!

    When i’ll get the mechanical components i’ll try it myself!

    Do you also happen to know what is the expression pedal sending on the serial? From what I imagine there is a command send via the toe switch which activates the feature and some sort of pwm on some remaining pin which reflects an analog input on the microcontroller. Unfortunately I don’t have a Sanpera or an oscilloscope to find out. It would be amazing to unlock that feature as well.

    Cheers!

  • Roberto Sonzogni says:

    Hello and thank you for sharing your project.
    How did you connect the 5 pin midi to 8 pin midi of Vypyr ?
    Tnx
    Roberto

  • Clayton says:

    If I remember right, the outside pins were only for power and ground. The 5 pin will go into an 8 pin socket.

  • JOHN says:

    Finally tried out my midi mate pedal w viper vip 2 amp yesterday. It works but it will only work on the “British” amp. It only works in “bank” and “instant” mode and the top buttons will control different effects/delay. I cant figure out how to switch the controls to make it switch to the amps i want (XXX,6505). dont want to spend more money on a sanpera if the midimate will work. anyone know if i have to program something.

  • Joseph Holmes says:

    Hello, this is a great project and it’s great that you have got it working the way you want it. I too have created a midi controller/looper, I am now in the process of adding led’s. I am wanting the led’s to light up different colours depending on button states. I’m not very skilled when it comes to Arduino programming. So I was wondering if you could possibly help me and maybe give a bit of guidance? Thank you

  • Bob McMaster says:

    well Clayton, your project looked like it may be something i gotta try.
    Well done Bro! I’ll get back to and let you know how i did. thanks for posting it on the web.

    Bob

Leave a Reply