<div dir="ltr">I'm glad it worked. Diatonic transposition is easy. Chromatic is a bit messier and requires mathing <shudder>. :-)<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 21, 2020 at 4:37 AM Martin Marris <<a href="mailto:mmarris@notecraft.com">mmarris@notecraft.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;" lang="EN-US"><div class="gmail-m_7907516891772321267WordSection1"><p class="MsoNormal">Hi Robert,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">It works, and is very simple. I had noticed that FCNote property but because of its name, had assumed it had something to do with the horizontal displacement of noteheads in a chord, so had not bothered to read the definition.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Thank you!<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Martin<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><div style="border-color:rgb(225,225,225) currentcolor currentcolor;border-style:solid none none;border-width:1pt medium medium;padding:3pt 0in 0in"><p class="MsoNormal"><b>From:</b> JWLua <<a href="mailto:jwlua-bounces@jwmusic.nu" target="_blank">jwlua-bounces@jwmusic.nu</a>> <b>On Behalf Of </b>Robert Patterson<br><b>Sent:</b> Sunday, December 20, 2020 22:54<br><b>To:</b> The JW Lua script plug-in. <<a href="mailto:jwlua@jwmusic.nu" target="_blank">jwlua@jwmusic.nu</a>><br><b>Subject:</b> Re: [JW Lua] Octave Transposition<u></u><u></u></p></div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">Octave transposition, along with any diatonic transposition, is simple. Just add or subtract the number of diatonic steps to/from FCNote::Displacement. For octaves it is 7 diatonic steps.<u></u><u></u></p></div><p class="MsoNormal"><u></u> <u></u></p><div><div><p class="MsoNormal">On Sun, Dec 20, 2020 at 4:42 PM Martin Marris <<a href="mailto:mmarris@notecraft.com" target="_blank">mmarris@notecraft.com</a>> wrote:<u></u><u></u></p></div><blockquote style="border-color:currentcolor currentcolor currentcolor rgb(204,204,204);border-style:none none none solid;border-width:medium medium medium 1pt;padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in"><div><div><p class="MsoNormal">Quick correction:<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">>>…. using note:SetPitch().<<<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">I meant “SetString()” of course.<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">Martin<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><div><div style="border-style:solid none none;border-width:1pt medium medium;padding:3pt 0in 0in;border-color:currentcolor"><p class="MsoNormal"><b>From:</b> JWLua <<a href="mailto:jwlua-bounces@jwmusic.nu" target="_blank">jwlua-bounces@jwmusic.nu</a>> <b>On Behalf Of </b>Martin Marris<br><b>Sent:</b> Sunday, December 20, 2020 21:34<br><b>To:</b> <a href="mailto:jwlua@jwmusic.nu" target="_blank">jwlua@jwmusic.nu</a><br><b>Subject:</b> [JW Lua] Octave Transposition<u></u><u></u></p></div></div><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">After copy/pasting stuff I sometimes need to transpose the results by an octave, up or down.<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">I assumed this would be easy but several hours later I am stuck.<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">I tried three approaches:<u></u><u></u></p><ul type="disc"><li class="gmail-m_7907516891772321267gmail-m-5074131461834042477msolistparagraph">Using the scripts kindly provided by Nick Mazuk at <a href="https://github.com/Nick-Mazuk/jw-lua-scripts" target="_blank">https://github.com/Nick-Mazuk/jw-lua-scripts</a>. But even after incorporating all of the “transposition” library functions directly into my script I could not get this to work. I always got an error message that “note” was a nil object even though I had directly assigned a value to “note.”<u></u><u></u></li><li class="gmail-m_7907516891772321267gmail-m-5074131461834042477msolistparagraph">A crude approach using MIDIKey, adding or subtracting 12. This did result in the correct pitches, but the wrong spellings: C ended up at B-sharp for example. (These errors happened only on transposing instruments.)<u></u><u></u></li><li class="gmail-m_7907516891772321267gmail-m-5074131461834042477msolistparagraph">Finally I tried an approach that parsed the note String and changed it. So for example, Bb4 would be programmatically changed to Bb3 or Bb5 and then set using note:SetPitch(). This worked OK on “C” instruments but yielded spectacularly wrong results on transposing instruments (off by a couple of octaves in some cases). I messed around with the “written pitch” parameter (the third property in the SetPitch method) but go nowhere.<u></u><u></u></li></ul><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">Hmm.<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">Martin<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p></div></div><p class="MsoNormal">_______________________________________________<br>JWLua mailing list<br><a href="mailto:JWLua@jwmusic.nu" target="_blank">JWLua@jwmusic.nu</a><br><a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu" target="_blank">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a><u></u><u></u></p></blockquote></div></div></div>_______________________________________________<br>
JWLua mailing list<br>
<a href="mailto:JWLua@jwmusic.nu" target="_blank">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>
</blockquote></div>