Line 21 is the scale.length in the "matrix_2A_harp"
My way is from "variable_harpScale".
IMPORT{add_scale_v2.json}
to the "menu_2A_harp_scale" widget to set "scaleJSON".
var harpScale = get('variable_harpScale')
setVar ("matrix_2A_harp","scaleJSON",harpScale.scale[s].scale)
to the "matrix_2A_harp" widget with the "scale.length" (This is the 21 error)
var scale = VAR{scaleJSON}
var octave = 12 * Math.floor($ / scale.length)
I think that one is a timing problem: Here I have the session. You only have to open the "HARP_v2.json" file, but the "add_scale_v2.json" file has to be in the same folder.
HarpV2.zip (4.7 KB)
Maybe I built it too complicated.
I need a little bit fresh air in my brain.
many thanks @Mike1
I'm not quite done yet, still need to work on a few timing problems.
I had to decide if with pedals I was bound with 7 strings per octave or if I wanted to be free. Now it can be "Eqyptian" with 5 or bebob with 8 strings. Also the "add_scale_v2.json" file with the scales is easier to understand and you can expand it yourself. See Picture the green column.
Wow, you did it! It's really great! Very practical the range slider.Thanks for sharing.
I had started to look at this idea from your previous harp file but I'm not good enough with script.
Eventually some proposals for improvement:
have a keyboard widget that updates according to the notes in the chosen mode and offers the possibility to add notes in the mode by clicking on the keyboard.
to have a matrix slider (which updates according to the number of notes in the chosen mode) and which gives the possibility to change the order of notes in the matrix harp.
@denisspycherprops is not a scripting property, this warning doesn't apply and scripting functions are not available here.
I'm not sure to understand your second question, but it seems you're providing an empty array as fallback value for a variable that's supposed to be a number (I guess || [] should be || 0 here). Note that for simple (non-object) values you can provide a default value directly in the VAR syntax (VAR{name, default}).