Assigning array to array. Problem

int melody[]={};

When you don't specify a value in the [], the compiler counts the number of initializers provided to determine how big the array needs to be. If you want the array to be non-zero, you must either provide a size or more than 0 initializers.

  if(digitalRead(button2)==HIGH){
    delay(200);
    _position--;
      if(_position<0) _position=0;

position starts at 0. Decrementing it, and constraining the lower limit to be 0 don't seem like useful things to do.

Names like button2 don't convey any information. You don't really have a button connected to the Arduino, do you? If so, you really might get better results with a switch.

If you do have switches, and you are going to build an enclosure for the device, and want to sell millions of them, labeling the switches 1, 2, and 3 isn't really going to cut it.

Anyway, the biggest problem with that code is that you need to tell the compiler how big melody is to be, rather than expecting it to guess.