Skip to content

Commit

Permalink
Fixed: Improper tie resolution
Browse files Browse the repository at this point in the history
This commit fixes a problem where ties would not be encoded correctly. It was fixed by adding an extra parameter to the tie resolution dictionary to further differentiate ties on different staves.

It also uses the concatenation operator instead of the addition operator. *facepalm*.
  • Loading branch information
ahankinson committed Jul 20, 2016
1 parent 00c1e8d commit a3e6501
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ExportGenerators.mss
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ function GenerateNote (nobj) {

// construct an index that will be used to open a tie, or check if a tie is open.
// this may be modified below if the tie extends to the next bar
tie_idx = parent_bar.BarNumber + '-' + nobj.ParentNoteRest.VoiceNumber + '-' + pnum;
tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;

if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)
{
Expand All @@ -982,7 +982,7 @@ function GenerateNote (nobj) {
assume that it stretches to this bar. Look backwards to see if this is the case
and set it as the end of the tie.
*/
prev_tie_idx = (parent_bar.BarNumber - 1) + '-' + nobj.ParentNoteRest.VoiceNumber + '-' + pnum;
prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;

if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)
{
Expand All @@ -1006,7 +1006,7 @@ function GenerateNote (nobj) {
// bar by one so that we can pick up on it later...
if (tie_dur >= parent_bar.Length)
{
tie_idx = (parent_bar.BarNumber + 1) + '-' + nobj.ParentNoteRest.VoiceNumber + '-' + pnum;
tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;
}

tie_resolver[tie_idx] = tie._id;
Expand Down

0 comments on commit a3e6501

Please sign in to comment.