A method I am using in Tone.js requires strings as it's arguments. Is there a way to assign the variables up top and then keep them in their quote marks?
This is the notation that works:
var chain = new Tone.CtrlMarkov({
"D2": "D4",
"D4": ["D2","D3"],
"D3":"D2"
});
This is what I want to do (and I've tried all combinations of using quotes, vs not, or using the val1.toString() method
var val1 = "D2"; //trying using quotes
var val2 = D4; //trying not using quotes
var val3 = D3;
var chain = new Tone.CtrlMarkov({
val1: val2,
val2: [val1,val3],
val3.toString(): val1 //trying toString method
});
Thx! The documentation of the library is here and my jsfiddle is here