Is the value really correct when printing the content of message?

After having some more problems of my own I just tried out the “[Lua] Message API” preset to see if I’m hallucinating. Nope, I am still wondering if the message:print() function is showing the correct value? I think the log snippet below is quite self explanatory. Bug / feature / both / none / me = the problem?

15:08:48.363 –[Message]--------------------------------
15:08:48.367 address: 0x90188e5c
15:08:48.370 deviceId: 1
15:08:48.373 type: cc7 (1)
15:08:48.376 parameterNumber: 1
15:08:48.380 min: 0
15:08:48.383 max: 127
15:08:48.385 value: 16537
15:08:48.388 signMode: 4
15:08:48.391 lsbFirst: 0
15:08:48.397 bitWidth: 7
15:08:48.402 relative: 0
15:08:48.406 relativeMode: 1
15:08:48.409 accelerated: 0
15:08:48.414 lua: message on value=127
15:08:54.203 lua: message current value=69

Thanks for pointing that out. What you print is the configuration of the message, ie. what was parsed from the preset JSON and when you modify with the Lua. The value here is the value that one could initially pass from the JSON. Which is not used. The runtime MIDI value associated with the message lives in the parameterMap and the link exists between the two (message object and the parameterMap). The magic number 16537 send for MIDI_VALUE_NOT_SET. meaning the JSON did not provide that.

now, calling message.setValue() and message:getValue() interact with the parameterMap behind the scenes. I will adjust the print return whats the in the parameterMap() and will update the docs.

2 Likes