[JW Lua] JWLua Digest, Vol 34, Issue 16
Robert Wildling
robertwildling at gmail.com
Sat May 14 12:45:54 CEST 2016
Thank you for sharing!!! Looking forward to using it!
*Robert M Wildling*
*composer | pianist | music engraver | progammer*
Göllnergasse 19/30 || A-1030 Vienna
ph: +43 676 6089613
@: robertwildling at gmail.com
2016-05-14 12:00 GMT+02:00 <jwlua-request at jwmusic.nu>:
> Send JWLua mailing list submissions to
> jwlua at jwmusic.nu
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
> or, via email, send a message with subject or body 'help' to
> jwlua-request at jwmusic.nu
>
> You can reach the person managing the list at
> jwlua-owner at jwmusic.nu
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of JWLua digest..."
>
>
> Today's Topics:
>
> 1. Vocal compass (Mr.Pat)
> 2. Suggestion for the iterator: smartshape filter (Jan Angerm?ller)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 13 May 2016 10:34:19 -0700
> From: "Mr.Pat" <Mr.Pat at pdreditions.com>
> To: <jwlua at jwmusic.nu>
> Subject: [JW Lua] Vocal compass
> Message-ID: <000901d1ad3d$aed3a010$0c7ae030$@pdreditions.com>
> Content-Type: text/plain; charset="us-ascii"
>
> Here's my first attempt. My work is with choral music so this plugin
> applies
> to choral scores. It scans the selected region to find the highest, lowest,
> and mean notes in the selected staves. It then displays them in the first
> measure of the staff. It assumes that there is at least one note in the
> first measure already. All of my templates are set up like that. The plugin
> works as it is, but I think there is a more efficient way to get the notes
> placed in the first measure. Suggestions welcomed.
>
> Pat
>
>
>
> function plugindef()
>
> -- This function and the 'finaleplugin' namespace
>
> -- are both reserved for the plug-in definition.
>
> finaleplugin.RequireScore = true
>
> finaleplugin.RequireSelection = true
>
> finaleplugin.MinFinaleVersion = "2012"
>
> finaleplugin.MinJWLuaVersion = "0.45"
>
> finaleplugin.Author = "PDR Editions"
>
> finaleplugin.Copyright = "2016"
>
> finaleplugin.Version = "1.0"
>
> finaleplugin.Date = "5/11/2016"
>
> finaleplugin.AuthorURL = "www.pdreditions.com"
>
> finaleplugin.AuthorEmail = "Mr.Pat at pdreditions.com"
>
> finaleplugin.CategoryTags = "Chord, Measure, MIDI, Note, Pitch, Region,
> Staff"
>
> return "Find Ranges", "Find Range", "Finds highest, lowest, and median
> range"
>
> end
>
> -- Use sounding pitch
>
> local written_pitch = false
>
>
>
> -- Table MIDI notes for each staff
>
> local lowestnotes = {}
>
> local highestnotes = {}
>
> local midnotes = {}
>
> local notecount = {}
>
> local staff = {}
>
>
>
> local region = finenv.Region()
>
> for slot = region.StartSlot, region.EndSlot do
>
> staff[region:CalcStaffNumber(slot)] = slot
>
> end
>
>
>
> for entry in eachentry(region) do
>
> if entry:IsNote() then
>
> -- Get the staff number where the entry is placed
>
> local staffnumber = entry.Staff
>
> -- skip the first measure
>
> if entry.Measure >1 then
>
> -- Parse through all notes in the note entry (=chord)
>
> for note in each(entry) do
>
> -- Use the enharmonic MIDI note to check the pitch
>
> local midikeynumber = note:CalcMIDIKey()
>
> -- See if the note is lowest on the staff
>
> if not lowestnotes[staffnumber] or lowestnotes[staffnumber] >
> midikeynumber then
>
> lowestnotes[staffnumber] = midikeynumber
>
> end
>
> -- See if the note is the highest on the staff
>
> if not highestnotes[staffnumber] or highestnotes[staffnumber] <
> midikeynumber then
>
> highestnotes[staffnumber] = midikeynumber
>
> end
>
> -- Add the note to midnotes
>
> if not midnotes[staffnumber] then
>
> midnotes[staffnumber] = midikeynumber
>
> else
>
> midnotes[staffnumber] = midnotes[staffnumber] +
> midikeynumber
>
> end
>
> if not notecount[staffnumber] then
>
> notecount[staffnumber] = 1
>
> else
>
> notecount[staffnumber] = notecount[staffnumber] + 1
>
> end
>
> end
>
> end
>
> end
>
> end
>
>
>
>
>
> -- Add new notes to each staff as needed. Assume at least one existing note
>
> local staffnum
>
> local slotnum
>
> for staffnum, slotnum in pairs(staff) do
>
> noteentrycell = finale.FCNoteEntryCell(region.StartMeasure, staffnum)
>
> noteentrycell:Load()
>
> for noteentry in each(noteentrycell) do
>
> for i = noteentry.Count, 2, 1 do
>
> noteentry:AddNewNote()
>
> end
>
> end
>
> noteentrycell:Save()
>
> end
>
>
>
> -- Set the values for each note
>
>
>
> for staffnum, slotnum in pairs(staff) do
>
> noteentrycell = finale.FCNoteEntryCell(region.StartMeasure, staffnum)
>
> noteentrycell:Load()
>
> local noteentry = noteentrycell:GetItemAt(0)
>
> local note = noteentry:GetItemAt(0)
>
> note:SetMIDIKey(math.floor(midnotes[staffnum]/notecount[staffnum] + .5))
>
> note.Playback = false
>
> note = noteentry:GetItemAt(1)
>
> note:SetMIDIKey(highestnotes[staffnum])
>
> note.Playback = false
>
> note = noteentry:GetItemAt(2)
>
> note:SetMIDIKey(lowestnotes[staffnum])
>
> note.Playback = false
>
> noteentry.CheckAccidentals = true
>
> noteentrycell:Save()
>
> end
>
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20160513/1dd15dab/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 2
> Date: Sat, 14 May 2016 11:54:00 +0200
> From: Jan Angerm?ller <jan at angermueller.com>
> To: "The JW Lua script plug-in." <jwlua at jwmusic.nu>
> Subject: [JW Lua] Suggestion for the iterator: smartshape filter
> Message-ID: <4645e8af-fcdd-39e0-d2ab-d08bc6221b76 at angermueller.com>
> Content-Type: text/plain; charset=utf-8; format=flowed
>
> Jari,
>
> here's a suggestion for the smartshape iterator:
> instead of browsing all smartshapes, I would a prefer a filter for
> hairpins, slurs, customlines, etc. that also implements the logical
> method as used in the other filters. Something like:
> AddSmartShapeFilter(int filter, int logicmode)
>
> Best,
> Jan
>
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
>
> ------------------------------
>
> End of JWLua Digest, Vol 34, Issue 16
> *************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20160514/3fb0533f/attachment.htm>
More information about the JWLua
mailing list