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