Really sorry to bother you about this @jean-emmanuel but I think something is not working anymore.
I went back to your initial props to try it again and followed what you said:
I removed //
before send()
also changed whatever
to my config but I'm getting errors:
Here is the initial props you wrote which should normally be working but it is not functioning on my side:
JS{
var props = {}
var labels = 'ABCDEFG'
props.snap = true
props.range = {min:0, max:127}
props.html = labels[$]
props.script = if (touch !== undefined) { setTimeout(()=>{ var v = touch == 1 ? get('this') : 0 console.log(v) send('midi:whatever', '/control', 1, $, v) }) }
return props
}
However when I'm replacing
$
to
#{$}+'note value'
It is working.
But you said I don't need to write this way as I'm already in a JS{}
block
So what is wrong?
Because of that, I can't go on to work on the additional var
you wrote:
var scale = [0, 2, 4, 5, 7, 9, 11]
var note = 60 + scale[$ % scale.length]
// 8 % 8 = 0, 9 % 8 = 1 -> loop over scale
var octave = 12 * Math.floor($ / scale.length)
note = note + octave
// now use note instead of $
Here is the session with everything included if you could please have a look at it:
fader_buttons_test_2.json (2.8 KB)
@Greenman Thanks for your suggestion but the array also didn't work for me.
Sorry for my huge incompetence
Swayrian