midiMessage for NoteOn/NoteOff not as stated in the manual

The manual states:

> For example, a Control Change message can be access either as:
> 
> 
> midiMessage = {
>     channel = 1,
>     type = CONTROL_CHANGE,
>     data1 = 1,
>     data2 = 127
> }
> 
> or
> 
> 
> midiMessage = {
>     channel = 1,
>     type = CONTROL_CHANGE,
>     controllerNumber = 1,
>     value = 127
> }

However this do not work on NoteOn/Off

midiMessage = {
   channel = 1,
   type = NOTE_ON,
    data1 = 60,
    data2 = 100
}
midi.sendMessage (PORT_1, midiMessage)

Returns error: bad argument #-2 to ‘sendMessage’ (number expected, got nil) because it does require the variables noteNumber and velocity.

you can use the midi.sendNoteOn and midi.sendNoteOff functions for this.

Or try (haven’t done it myself) replacing ‘data1’ by ‘noteNumber’ and ‘data2’ by ‘velocity’

Yes, both workarounds are available, but it is still a bug. And that’s why I reported it.