<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle18
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link="#0563C1" vlink="#954F72" style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal>I am writing a large JW Lua script that, among other things, creates instrument staves. The playback needs to be correct on those staves. At the very least, the correct General MIDI sound needs to be applied.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Here is a snippet of the code I am using to create instrument staves:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'>local staffID = finale.FCStaves.Append()<o:p></o:p></span></p><p class=MsoNormal><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'>if staffID then<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#385723;mso-style-textfill-fill-color:#385723;mso-style-textfill-fill-alpha:100.0%'>-- Load the created staff</span><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'><o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'>local staff = finale.FCStaff()<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'>staff:Load(staffID)<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#385723;mso-style-textfill-fill-color:#385723;mso-style-textfill-fill-alpha:100.0%'>-- Set the virtual instrument (in the Score Manager)<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'>staff.InstrumentUUID = finale.FFUUID_CLARINETBFLAT<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#385723;mso-style-textfill-fill-color:#385723;mso-style-textfill-fill-alpha:100.0%'>--Set the instrument names<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'>local strName =finale.FCString()<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'>strName.LuaString="B_b Clarinet"<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'>staff:SaveNewFullNameString (strName)<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'>local strAbrev =finale.FCString()<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'>strAbrev.LuaString="Bb Cl."<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'>staff:SaveNewAbbreviatedNameString (strAbrev)<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'>-</span><span style='color:#385723;mso-style-textfill-fill-color:#385723;mso-style-textfill-fill-alpha:100.0%'>-Set the clef<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'>staff.DefaultClef = 0<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#385723;mso-style-textfill-fill-color:#385723;mso-style-textfill-fill-alpha:100.0%'>--Set the transposition<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'>staff.TransposeInterval = 1<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'>staff.TransposeAlteration = 2<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'>staff.TransposeSimplifyKey = true<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'>staff:Save() <o:p></o:p></span></p><p class=MsoNormal><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'>end</span><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The staves/instruments created by the above code look perfect in Score Manager, except for the playback sound, which defaults to Piano.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I have spent way too long, several hours, messing around with FCInstrumentPlaybackData but cannot figure it out, nor do I find a list of constants that I could apply for playback (the existing constants list has extensive instrument UUID listings but I don’t find playback constants).<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>How does it work?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks!<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Martin<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>