unexpected token: [ - Assigning an array
in
Programming Questions
•
2 years ago
Hello everyone!
First let me say I am very new to Processing and I am working on my first real project.
The only programming experience I have is with high level scripting languages like AutoIt and AHK.
So, I am getting the error "Unexpected token: [" when trying to set values to an array. I don't really know what i am doing wrong here. any suggestions?
First let me say I am very new to Processing and I am working on my first real project.
The only programming experience I have is with high level scripting languages like AutoIt and AHK.
So, I am getting the error "Unexpected token: [" when trying to set values to an array. I don't really know what i am doing wrong here. any suggestions?
- float[] color_to_freq = new float[255];
color_to_freq[0] = 220.00;
color_to_freq[10] = 233.08;
color_to_freq[20] = 246.94;
color_to_freq[30] = 261.63;
color_to_freq[40] = 277.18;
color_to_freq[50] = 293.66;
color_to_freq[60] = 311.13;
color_to_freq[70] = 329.63;
color_to_freq[80] = 349.23;
color_to_freq[90] = 369.99;
color_to_freq[100] = 392.00;
color_to_freq[110] = 415.30;
color_to_freq[120] = 440.00;
color_to_freq[130] = 466.16;
color_to_freq[140] = 493.88;
color_to_freq[150] = 523.25;
color_to_freq[160] = 554.37;
color_to_freq[170] = 587.33;
color_to_freq[180] = 622.25;
color_to_freq[190] = 659.26;
color_to_freq[200] = 698.46;
color_to_freq[210] = 739.99;
color_to_freq[220] = 783.99;
color_to_freq[230] = 830.61;
color_to_freq[240] = 880.00;
color_to_freq[250] = 932.33;
1
