Sustain via midi

Have you read the MIDI implementation document for the Yamaha keyboard you're trying to control? While CC 64 might be universal, I found that Korg and Yamaha's implementation of it is significantly different on some models.

For example to get the PSRs950 to SUSTAIN, I had to setup the 950's MIDI IN section first to dedicate a MIDI channel for the upper, lower, rhythms, drums, extras, etc. Otherwise sending it on channel 1 sustain only affected the upper keyboard.

I was controlling it with a MIDI pedal from an FCB1010 and it was sending out CC#27, thus, when I got a CC#27 from the FCB1010 I'd then send out a CC64:

void transPose(byte ccNumber, byte theValue) {
 for (int theChannel=0 ; theChannel < 14 ; theChannel++) {
   MIDI.sendControlChange(ccNumber, theValue, theChannel);
 }
}

MIDI is very easy, the various companies implementation of it usually isn't. Takes a lot of trial and error to figure it out. It's never been as easy as simply sending out a CC and having something happen. Except for a Casio I was working on once a long time ago.

On the microkorg-xl, you'll have to set up the MIDI routing, the the Global and/or MIDI Filter section, the channel so it's not MIDI input deaf, and then probably the Control Change section. Once all that's done correctly, you transmit CC#64,0 DAMPER OFF, CC#64, 127 DAMPER ON.

Plan on spending lots of time with the User Manual and perhaps the MIDI implementation document.