[JW Lua] Percussion midi map

Jari Williamsson jari.williamsson at mailbox.swipnet.se
Mon Jan 20 09:16:57 CET 2014


Although percussion and instrument mapping in JW Lua is at a development 
phase right now, the functionality you're seeking is actually 
implemented in the beta you're using.

Here's some skeleton code to get the percussion midi map for a 
percussion staff.

Since FCInstrumentDef:CreatePercussionMapNotes() will parse the XML file 
information for the percussion MIDI map, make sure to put it outside any 
loops for performance.

---
local staff = finale.FCStaff()
staff:Load(1) -- Or whatever staff ID with percussion

local instrumentdef = staff:CreateInstrumentDef()

local mapnotes = instrumentdef:CreatePercussionMapNotes()
for mapnote in each(mapnotes) do
     print (mapnote.NoteType, "= MIDI", mapnote.MidiNote)
end
---

Best regards,

Jari Williamsson


On 2014-01-19 20:09, Jan Angermüller wrote:
> Hi Jari,
>
> I am now working on a remapping plugin for
> drum staves that were imported from MIDI files
> and that need remapping.
> E.g. if MIDI bass drum 35 needs to become MIDI
> bass drum 36 for correct playback on a certain drum sampl map.
>
> What works fine so far:
> reading the percussion staves, reassiging the new note pitch,
> reading the percussion layouts and matching the note types
> from FCPercussionNoteMod and FCPercussionLayoutNote.
>
> Only one final thing does not work yet:
> How do I get the note type for a certain MIDI note ?
> So that I can assign the correct note type for the new pitch.
> Probably it has to do with FCPercussionMapNote which has the
> properties MidiNote and NoteType. But it isn't implemented yet, is it ?
>
> Would be great to have that class !
> And very happy if the plugin is finally working.
> That saves hours and hours when importing MIDI.
>
> I must say again - JW Lua is really fun to program with. Great job !
>
> Thanks a lot,
> Jan
>
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
>






More information about the JWLua mailing list