[JW Lua] Reading MIDI values

Jan Angermüller jan at angermueller.com
Wed Jan 15 16:50:04 CET 2014


Hi Jari,
> JW Lua beta 0.13 is now available for download, and the following code 
> should insert a MIDI controller event at the start of the first 
> measure on the staff with ID 1:
Thanks a lot for the MIDI integration !

Just two questions:
1.) Is it also possible to READ existing continuous MIDI data from a 
measure/staff ?
I am not sure about the syntax. I tried:

local cell = finale.FCCell(1,1)
me:ConnectCell(cell)
me:SetUseController()    -- required ? I only want to get controller 
values ?
me.MeasurePos = 0
me.ControllerNumber=52
if me:GetController () then    --returns true only when I use 
SetUseController before
    print("MIDI Controller:", me.ControllerNumber)   --always prints 52 
(of course, as set before)
    print("MIDI value:", me.ControllerValue)                --always 
prints 0, although in Finale the value x is stored
end

No matter if the controller 52 is set in Finale or not, GetController 
only returns true, when I use SetUseController before. GetController 
seems to check SetUseController only and not the real controllers set in 
the Finale measure/staff.
No matter which controller number I select, the ControllerValue always 
returns 0.
Seems to me like the Get functionality is not implemented yet.

2.) The "Finale MIDI tool" also allows viewing and setting of other 
continuous MIDI data besides
the controller data: Patch Changes, Channel Pressure and Pitch Wheel.
Are they also covered by FCMidiExpression ?
In MIDI message code: controller data is $b0 in the first message byte,
patch changes $c0, channel pressure $d0 and pitch wheel $e0.
If not, maybe add a variable (MIDI_CONTROLLER, MIDI_PATCHCHANGES, ...) 
to FCMidiExpression for selecting the type of MIDI data ?

Thanks a lot !

Jan




More information about the JWLua mailing list