Skip to content

Commit

Permalink
Merge develop for bugfix release 2.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
th-we committed Jun 26, 2019
2 parents 7aee9ff + 188d4ad commit acd0cdc
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
9 changes: 5 additions & 4 deletions lib/libmei.plg
Original file line number Diff line number Diff line change
Expand Up @@ -1612,10 +1612,11 @@ GetTail "(element) {

meiDocumentToFile "(meidoc, filename) {
meiout = _exportMeiDocument(meidoc);
Sibelius.CreateTextFile(filename);
Sibelius.AppendTextFile(filename, meiout, 1);

return true;
if (Sibelius.CreateTextFile(filename)) {
return Sibelius.AppendTextFile(filename, meiout, 1);
} else {
return false;
}
}"

meiDocumentToString "(meidoc) {
Expand Down
7 changes: 6 additions & 1 deletion src/Utilities.mss
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ function GetNoteObjectAtEndPosition (bobj) {

staffObjectPositions = objectPositions[staff_num];
barObjectPositions = staffObjectPositions[bar_num];
if (null = barObjectPositions) {
// TODO: We have a line that continues into a 'future' bar. Track these
// lines and add IDs when we've reached the end NoteRest and know its ID
return null;
}
voiceObjectPositions = barObjectPositions[voice_num];

if (voiceObjectPositions = null)
Expand Down Expand Up @@ -235,7 +240,7 @@ function AddBarObjectInfoToElement (bobj, element) {
}
case('Slur')
{
// libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));
libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));
start_obj = GetNoteObjectAtPosition(bobj);
end_obj = GetNoteObjectAtEndPosition(bobj);
if (start_obj != null)
Expand Down
22 changes: 22 additions & 0 deletions test/sib-test/TestExportGenerators.mss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ function TestExportGenerators (suite) {
.Add('TestGenerateMusicWithLyrics')
.Add('TestGenerateMusicWithEndings')
.Add('TestGenerateStaffGroups')
.Add('TestGenerateLine')
;
} //$end

Expand Down Expand Up @@ -282,3 +283,24 @@ function TestGenerateStaffGroups (assert, plugin) {

libmei.destroy();
} //$end


function TestGenerateLine (assert, plugin) {
score = CreateEmptyTestScore(1, 2);
staff = score.NthStaff(1);
// Fill the bars with quarter notes
for barNumber = 1 to staff.BarCount + 1 {
bar = staff.NthBar(barNumber);
for noteNumber = 0 to 4 {
bar.AddNote(noteNumber * 256, 60, 256);
}
}

// A short slur
slur1 = staff.NthBar(1).AddLine(0, 512, 'line.staff.slur.down');
// A slur across bars
slur2 = staff.NthBar(1).AddLine(512, 1024, 'line.staff.slur.down');

sibmei2._property:ActiveScore = score;
sibmei2.GenerateMEIMusic();
} //$end

0 comments on commit acd0cdc

Please sign in to comment.