[JW Lua] Adding MIDI controller messages with Lua

Jari Williamsson jari.williamsson at mailbox.swipnet.se
Tue Jan 14 14:26:47 CET 2014


On 2014-01-13 18:14, Jan Angermüller wrote:
> is it possible with Lua to add MIDI controller messages
> at the beginning of each staff (e.g. in the first measure) ?
>
> For example:
> The flute staff is set to VST bank 3, channel 14.
> Then add a midi controller message on the flute staff
> sending "CC#20" with value 127 (or just any MIDI message ...).
> This would be the MIDI message $bc $14 $7f
> ($bc: CC message (=$b) on channel 14 ($c) for controller 20 (=$14)
> with value 127 (=$7f)).

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:

local cell = finale.FCCell(1,1)
local me = finale.FCMidiExpression()
me:ConnectCell(cell)
me:SetUseController()
me.MeasurePos = 0
me.ControllerNumber = 20
me.ControllerValue = 127
me:SaveNew()


Best regards,

Jari Williamsson





More information about the JWLua mailing list