Change needed to the LUA displayNotes formatter

It’s early days yet in my leearning process, @martin , so I’m trying out all the lua preset examples to get an understanding of the specificities of this language.

One of the things I’ve tried out is the [Lua] Value formatting preset. What I noticed was that if I limited the Midi Range of parameter 4 (NOTE-fader) to only 24 values, I wasn’t getting 2 octaves, but slightly more. Rather unexpected, but then I noticed the A# notes were missing.

Could it be the following is to be changed to the Lua script:

  • the notes array only has 11 values and should have 12: missing element = number 11 “A%d#”
  • the string format in the displayNotes function should use all 12 elements:
    return (string.format(notes[math.fmod(value, 12) + 1], value // 12))
    instead of
    return (string.format(notes[math.fmod(value, 11) + 1], value // 12))