CAN ANYONE HELP

We want our program to play 3 different songs. When you press one button it plays the song that is assigned. THANK YOU SO MUCH and ill post the errors at the bottom

void setup () {

int  buttons[72];
int tempo[72];
int press[56];
int pace[56];
int song[74];
int speed[74];

{int buttons}
{int tempo}
{int press}
{int pace}
{int song}
{int speed}

// set up an array with 6 integers

// give the first element of the array the value 2
 int buttons {N_E4, N_D4, N_C4, N_D4, N_E4, N_F4, N_G4, N_A4, N_B4, N_C5, N_B4, N_A4,
  N_G4, N_A4, N_B4, N_C5, N_B4, N_A4, N_G4, N_A4, N_B4, N_C5, N_G4, N_F4,
  N_E4, N_E4, N_D4, N_C4, N_D4, N_E4, N_F4, N_G4, N_A4, N_B4, N_C5, N_B4, N_A4,
  N_G4, N_A4, N_B4, N_C5, N_B4, N_A4, N_G4, N_A4, N_B4, N_C5, N_G4, N_F4,
  N_E4, N_E4, N_D4, N_C4, N_D4, N_E4, N_F4, N_G4, N_C5, N_B4, N_A4, N_A4,
  N_G4, N_C5, N_B4, N_A4, N_G4, N_A4, N_B4, N_C5, N_G4, N_F4, N_E4};
  
  int tempo { 6, 4, 2, 8, 2, 2 , 4, 2, 4, 2, 12,
   4, 2, 4, 2, 6, 4, 2, 6, 4, 2, 24,
   6, 4, 2, 8, 2, 2 , 4, 2, 4, 2, 12,
   4, 2, 4, 2, 6, 4, 2, 6, 4, 2, 20, 2, 2,
   6, 6, 6, 6, 4, 2, 4, 2, 6, 4, 2, 6, 6,
   6, 6, 4, 2, 4, 2, 12, 12, 6, 4, 2,
   12, 8, 2, 2, 12, 4, 2, 4, 2, 12,
   8, 2, 2, 12, 8, 2, 2, 12, 6, 4, 2,
   12, 4, 2, 4, 2, 12, 6, 6, 12,
   6, 6, 12, 6, 6, 12, 6, 4, 2,
   24 };
  
  
   
   int press { NOTE_C4, NOTE_C5, NOTE_A3, NOTE_A4,
  NOTE_AS3, NOTE_AS4, 0,
  0,
  NOTE_C4, NOTE_C5, NOTE_A3, NOTE_A4,
  NOTE_AS3, NOTE_AS4, 0,
  0,
  NOTE_F3, NOTE_F4, NOTE_D3, NOTE_D4,
  NOTE_DS3, NOTE_DS4, 0,
  0,
  NOTE_F3, NOTE_F4, NOTE_D3, NOTE_D4,
  NOTE_DS3, NOTE_DS4, 0,
  0, NOTE_DS4, NOTE_CS4, NOTE_D4,
  NOTE_CS4, NOTE_DS4,
  NOTE_DS4, NOTE_GS3,
  NOTE_G3, NOTE_CS4,
  NOTE_C4, NOTE_FS4, NOTE_F4, NOTE_E3, NOTE_AS4, NOTE_A4,
  NOTE_GS4, NOTE_DS4, NOTE_B3,
  NOTE_AS3, NOTE_A3, NOTE_GS3,
  0, 0, 0};
  
  int pace {  12, 12, 12, 12, 
  12, 12, 6,
  3,
  12, 12, 12, 12, 
  12, 12, 6,
  3,
  12, 12, 12, 12, 
  12, 12, 6,
  3,
  12, 12, 12, 12, 
  12, 12, 6,
  6, 18, 18, 18,
  6, 6,
  6, 6,
  6, 6,
  18, 18, 18,18, 18, 18,
  10, 10, 10,
  10, 10, 10,
  3, 3, 3};

  int song {0, NOTE_C7, NOTE_E7, 0,
  NOTE_G7, 0, 0,  0,
  NOTE_G6, 0, 0, 0,
 
  NOTE_C7, 0, 0, NOTE_G6,
  0, 0, NOTE_E6, 0,
  0, NOTE_A6, 0, NOTE_B6,
  0, NOTE_AS6, NOTE_A6, 0,
 
  NOTE_G6, NOTE_E7, NOTE_G7,
  NOTE_A7, 0, NOTE_F7, NOTE_G7,
  0, NOTE_E7, 0, NOTE_C7,
  NOTE_D7, NOTE_B6, 0, 0,
 
  NOTE_C7, 0, 0, NOTE_G6,
  0, 0, NOTE_E6, 0,
  0, NOTE_A6, 0, NOTE_B6,
  0, NOTE_AS6, NOTE_A6, 0,
 
  NOTE_G6, NOTE_E7, NOTE_G7,
  NOTE_A7, 0, NOTE_F7, NOTE_G7,
  0, NOTE_E7, 0, NOTE_C7,
  NOTE_D7, NOTE_B6, 0, 0, };

int speed {6, 4, 2, 8, 2, 2 , 4, 2, 4, 2, 12,
   4, 2, 4, 2, 6, 4, 2, 6, 4, 2, 24,
   6, 4, 2, 8, 2, 2 , 4, 2, 4, 2, 12,
   4, 2, 4, 2, 6, 4, 2, 6, 4, 2, 20, 2, 2,
   6, 6, 6, 6, 4, 2, 4, 2, 6, 4, 2, 6, 6,
   6, 6, 4, 2, 4, 2, 12, 12, 6, 4, 2,
   12, 8, 2, 2, 12, 4, 2, 4, 2, 12,
   8, 2, 2, 12, 8, 2, 2, 12, 6, 4, 2,
   12, 4, 2, 4, 2, 12, 6, 6, 12,
   6, 6, 12, 6, 6, 12, 6, 4, 2,
   24 };


void loop() {
  
  int keyVal = analogRead(A0);
  Serial.println(keyVal);
 
  if(keyVal == 1023)
   int [] = {buttons, tempo};
  
                                                 
else if(keyVal >= 990 && keyVal <= 1010){
 
 int [] = {press, pace};



else if(keyVal >= 5&& keyVal <=515){
  {song, speed};
 


else if(keyVal >=5 && keyVal <= 10){
  tone (0, notes[0]);
}

}

This report would have more information with
“Show verbose output during compilation”
enabled in File > Preferences.
Arduino: 1.0.6 (Windows 7), Board: “Arduino Uno”
sketch_may07a.ino: In function ‘void setup()’:
sketch_may07a:10: error: expected initializer before ‘}’ token
sketch_may07a:11: error: expected initializer before ‘}’ token
sketch_may07a:12: error: expected initializer before ‘}’ token
sketch_may07a:13: error: expected initializer before ‘}’ token
sketch_may07a:14: error: expected initializer before ‘}’ token
sketch_may07a:15: error: expected initializer before ‘}’ token
sketch_may07a:20: error: a function-definition is not allowed here before ‘{’ token
sketch_may07a:27: error: a function-definition is not allowed here before ‘{’ token
sketch_may07a:41: error: a function-definition is not allowed here before ‘{’ token
sketch_may07a:61: error: a function-definition is not allowed here before ‘{’ token
sketch_may07a:81: error: a function-definition is not allowed here before ‘{’ token
sketch_may07a:105: error: a function-definition is not allowed here before ‘{’ token
sketch_may07a:118: error: a function-definition is not allowed here before ‘{’ token
sketch_may07a:142: error: expected `}’ at end of input

moderator: added code tags and removed many blank lines

How to post code properly

Pete

You need to readup on how to use arrays and basic code structure. Look at the example sketches provided with the arduino software under File → Examples → 01 and go down from there.

http://www.arduino.cc/en/Reference/Array

Once you have done that, post your code again and this time use the </> button just under where is says Message Icon, above.

{int buttons}
{int tempo}
{int press}
{int pace}
{int song}
{int speed}

What is this crap? (The compiler is asking the same question, in a more diplomatic fashion).

Hi, we are brand new with using the arduino and we are kind of clueless right now. Much help would be appreciated thank you.

Much help would be appreciated

You need to start with a clear set of requirements. If you have something you expect us to help you with, you need to share it.

You should start every program by writing the comments first. Then, when you butcher the job of writing the code, we could see what you meant to do.

princessandpeasant: Hi, we are brand new with using the arduino and we are kind of clueless right now. Much help would be appreciated thank you.

So you should probably start by working through some of the examples and learning how the code is structured and written. Then you can delve into more complicated things like this. Trying to write a big project before you understand the basics is an exercise in frustration for you and us.

Moderator:
can you please choose another title which explains your problem?
That will attract more people that can help.

We want our program to play 3 different songs. When you press one button it plays the song that is assigned. THANK YOU SO MUCH and ill post the errors at the bottom

An example of very basic arduino button code.

//zoomkat servo button test 12-29-2011
// Powering a servo from the arduino usually *DOES NOT WORK*.

#include <Servo.h>
int button1 = 4; //button pin, connect to ground to move servo
int press1 = 0;
int button2 = 5; //button pin, connect to ground to move servo
int press2 = 0;
Servo servo1;

void setup()
{
  pinMode(button1, INPUT);
  pinMode(button2, INPUT);
  servo1.attach(7);
  digitalWrite(4, HIGH); //enable pullups to make pin high
  digitalWrite(5, HIGH); //enable pullups to make pin high
}

void loop()
{
  press1 = digitalRead(button1);
  if (press1 == LOW)
  {
    servo1.write(170);
  }    
  
  press2 = digitalRead(button2);
  if (press2 == LOW)
  {
    servo1.write(10);
  }
}

[/quote]

princessandpeasant:
Hi, we are brand new with using the arduino and we are kind of clueless right now. Much help would be appreciated thank you.

There is actually a lot of help available under the “help” tab in the IDE. Look at “reference”.