Trying to control the pitch coming out of speaker using an IR remote

I am having trouble controlling the pitch (frequency) coming out of a speaker. I can use a pot to control it but I want to use an IR controller to do the same thing.

What I'm trying to accomplish is to have the speaker output the range of 100 Hz to 1200 Hz and every time I push a button on the controller it would step up the frequency by 50 Hz. I have mapped the HEX code for my controller and input that into my code.

My problem is I think I have the right code but it won't compile for my Mega 2560 board. I will post my code below. Could anyone please help?

#include <IRremote.h>

int RECV_PIN = 11;
int speakerPin=0;
IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
  irrecv.enableIRIn(); // Start the receiver

void translateIR()
  int sensorValue=digitalRead(results.value);
  int frequency=map(sensorValue, 0, 1023, 100, 1200);
  tone(speakerPin, frequency);

      case 0xFF629D:      //Volume up Button
      if (sensorValue==0){
        Serial.println("Tone Up");
        for(int i=100;i<=1200;i+50){
          digitalWrite(speakerPin, i);
      case 0xFFA857:              //Volume Down Button
      if (sensorValue==0){
        Serial.println("Tone Down");
        for (int i=1200;i>=100;i-50){
      Serial.println("Button not Mapped");
void loop() {
  if (irrecv.decode(&results)) {
    irrecv.resume(); // Receive the next value

IRremote and tone() use the same timer. You need to go into the IRremote library and modify the IRremoteInt.h file to use a different timer.