Array Issue

This is the error:

Arduino: 1.6.5 (Windows 8.1), Board: “Arduino/Genuino Uno”

toneMultiple.ino: In function ‘void setup()’:
toneMultiple:23: error: invalid types ‘int[int]’ for array subscript
invalid types ‘int[int]’ for array subscript

This report would have more information with
“Show verbose output during compilation”
enabled in File > Preferences.

This is my code:
#include"pitches.h"
int ledPin1 = 10;
int ledPin2 = 9;
int ledPin3 = 8;

int melody = {
NOTE_C1, NOTE_FS1, NOTE_A1, NOTE_G1, NOTE_C2, NOTE_FS1, NOTE_D1, NOTE_B0
};

int noteDurations = {
8, 8, 4, 8, 4, 4, 4, 8
};

void setup() {
//this is the setup for the rgb light
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);

//this is the setup for the buzzer
for (int thisNote = 0; thisNote < 8; thisNote++)
{
int noteDuration = 1000 / noteDuration[thisNote];
tone(8, melody[thisNote], noteDuration);
int pauseBetweenNotes = noteDuration * 1.30;
delay(pauseBetweenNotes);
noTone( 8 );
}
}

void loop () {
setColor(255, 0, 0); //red
delay(1000);
setColor(0, 255, 0); //blue
delay(1000);
setColor(0, 0, 255); //green
delay(1000);
setColor(255, 255, 0); //yellow
delay(1000);
setColor(80, 0, 80); //purple
delay(1000);
setColor(0, 255, 255); //light blue
delay(1000);
}

void setColor (int red, int blue, int green) {
analogWrite(ledPin1, 255 - red);
analogWrite(ledPin2, 255 - blue);
analogWrite(ledPin3, 255 - green);
}

Hi

int noteDuration = 1000 / noteDuration[thisNote];

You are declaring new a local variable with the same name as your global array variable. This makes a hole in the scope of the global variable, so you can't access it from within setup(). Change the name of the local variable.

AND... EDIT YOUR ORIGINAL POST AND PUT IN CODE TAGS PLEASE!

PaulRB: Hi

int noteDuration = 1000 / noteDuration[thisNote];

You are declaring new a local variable with the same name as your global array variable. This makes a hole in the scope of the global variable, so you can't access it from within setup(). Change the name of the local variable.

AND... EDIT YOUR ORIGINAL POST AND PUT IN CODE TAGS PLEASE!

No, the global array variable has a different name.

aarg: No, the global array variable has a different name.

aarg... arrg! You're right. Th line should be

int noteDuration = 1000 / noteDurations[thisNote];

aarg: No, the global array variable has a different name.

Indeed. It's easy to miss. But that comment shows you what the error is on line 23.