Show Posts
Pages: [1]
1  Using Arduino / Audio / Re: Midi Sustain pedal on: February 04, 2013, 06:32:41 pm
Yeah, it was not working for me. Perhaps I have to get the microkorg working on the other end.
2  Using Arduino / Audio / Re: Midi Sustain pedal on: February 04, 2013, 11:28:27 am
So I'm having a lot of trouble with the programming side of things, and I'm not sure I have my output wired correctly, but it's wired according to http://arduino.cc/en/Tutorial/Midi. I attached a picture of what my whole bread board looks like. and my code so far looks like this:
Code:
#include <MIDI.h>
/*
  Sustain pedal
 Reads a digital input on pin 4, chooses between sustain and sostenuto
 Reads a digital input on pin 2, outputs to midi information
 */

// declare inputs.
int toggleSwitch = 4;
int togglePedal = 2;
int midiOut = 1;

// the setup routine runs once when you press reset:
void setup() {
  // initialize midi
  MIDI.begin(1);
  // make the switch pins inputs:
  pinMode(toggleSwitch, INPUT);
  pinMode(togglePedal, INPUT);
  pinMode(midiOut, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input pins:
  int switchState = digitalRead(toggleSwitch);
  int pedalState = digitalRead(togglePedal);
 
  // output out the state of the pedal:
  if (pedalState == 0 && switchState == 0) //sustain off
  {MIDI.sendControlChange(64,0,1);}
 
  if (pedalState == 1 && switchState == 0) //sustain on
  MIDI.sendControlChange(64,127,1);}
 
  if (pedalState == 0 && switchState == 1) //sostenuto off
  {MIDI.sendControlChange(66,0,1);}
 
  if (pedalState == 1 && switchState == 1) //sostenuto on
  {MIDI.sendControlChange(66,127,1);}
 
  delay(1);        // delay in between reads for stability
}

I had it working when I outputted it to the serial monitor to debug, but I have no clue how to use the midi.
3  Using Arduino / Audio / Midi Sustain pedal on: January 28, 2013, 02:38:00 pm
Hi, I'm a complete novice to working with Arduino, but I'd like to be able to create something extremely useful for me. I want to be able to control the sustain of a MicroKorg XL with a standard sustain pedal. The MicroKorg doesn't have a sustain pedal input, but I was wondering if I could convert the signal from the 1/4" output of a sustain pedal into MIDI data using an Arduino. How would I go about doing this?
Pages: [1]