<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Jari,<br>
<br>
when looking at FCCellFrameHold.ClefIndex in a measure that<br>
holds a regular AND a mid measure-clef (see attached test file),<br>
the FCCellFrameHold.ClefIndex may return a wrong result<br>
(in the test case below it returns the clef index from the next (!)
measure).<br>
<br>
If you run the code below on the attached document,<br>
FCCellFrameHold.ClefIndex in measure 2 will return 3 (bass clef),<br>
although the bass clef starts in measure 3 and not 2.<br>
The correct value for FCCellFrameHold .ClefIndex would be the first
value<br>
from the mid measure-clefs collection (FCCreateCellClefChanges) from
measure 2, <br>
i.e. in the code below: midclefs:GetItemAt(0).ClefIndex<br>
<br>
Or in other words:<br>
in a measure that hold a regular and a mid measure-clef, <br>
don't use CellFrameHold.ClefIndex as it holds the value from<br>
a different (!) measure. I don't if it's always the value from the<br>
measure that follows, at least it's not value from the current
measure.<br>
<br>
(Don't worry about the notation from the file,<br>
it's a file for test purposes only and probably makes no sense in
the real world).<br>
<br>
Best regards,<br>
Jan<br>
<br>
function PrintClefs(staff,startmeasure,endmeasure)<br>
local region=finale.FCMusicRegion()<br>
region.StartStaff=staff<br>
region.EndStaff=staff<br>
region.StartMeasure=startmeasure<br>
region.EndMeasure=endmeasure<br>
region:SetStartMeasurePosLeft()<br>
region:SetEndMeasurePosRight()<br>
for i,j in eachcell(region) do<br>
local cell=finale.FCCell(i,j)<br>
local CellFrameHold=finale.FCCellFrameHold()<br>
CellFrameHold:ConnectCell(cell)<br>
if CellFrameHold:Load() then <br>
print("Measure",i,"Regular
Clef",CellFrameHold.ClefIndex)<br>
local midclefs=CellFrameHold:CreateCellClefChanges()<br>
if midclefs~= nil then<br>
for m in each(midclefs) do<br>
print("Measure",i,"MidClef",m.ClefIndex)<br>
end<br>
end<br>
end<br>
end<br>
end<br>
<br>
local region=finale.FCMusicRegion()<br>
region:SetFullDocument()<br>
PrintClefs(region.StartStaff,region.StartMeasure,region.EndMeasure)<br>
<br>
Running [Unnamed Script] ======><br>
Measure 1 Regular Clef 12<br>
Measure 2 Regular Clef 3 <b> (This should be 0 ! The value
3 is from the next measure)</b><br>
Measure 2 MidClef 0<br>
Measure 2 MidClef 12<br>
Measure 2 MidClef 0<br>
Measure 3 Regular Clef 3<br>
<======= [Unnamed Script] succeeded (Processing time: 0.000 s).<br>
<br>
</body>
</html>