I'm making a jquery plugin to show piano scales.
I have a function called markScale(a, b) which will be used to highlight certain scales (the a parameter gives the pitch of the starting note, ie. how many semitones up from C, the default scale). That's no problem.
The problem comes with b, the type of scale or chord to display. I have defined which keys to use in the different types of scale as follows:
var majorScale=[12,14,16,17,19,21,23,24];
var nminorScale=[12,14,15,17,19,20,22,24];
var hminorScale=[12,14,15,17,19,20,23,24];
And so what I'm looking to do is the following:
for(i=0;i<8;i++){
$('#key-'+(b[i]+a)+'-marker').show();
}
markScale(0,"majorScale") doesn't work, because that's just a string and doesn't refer to the array variable that I need.
How do I refer to the array variable as a parameter of the function?
Thanks