bbloomf / jgabc

http://bbloomf.github.io/jgabc/
The Unlicense
100 stars 48 forks source link

Outdated version of exsurge causing issue with flats #39

Closed nate-g closed 5 years ago

nate-g commented 5 years ago

With the current version of exsurge in use, flats are (at least sometimes) carried over quarter bars. Take the following gabc:

(c4) Dó(ixjhi)mi(gf)ne.(fhg___) (,) (jkijh./fhg/hggf.) (::)

The flat is correctly canceled by a quarter bar when createMappingsFromSource is called, but when updateMappingsFromSource is called the value is no longer correct. To reproduce, you can run the following code:

var gabc = "(c4) Dó(ixjhi)mi(gf)ne.(fhg___) (,) (jkijh./fhg/hggf.) (::)";
var ctxt = new exsurge.ChantContext();
var mappings = exsurge.Gabc.createMappingsFromSource(ctxt, gabc);
var score = new exsurge.ChantScore(ctxt, mappings);
console.dir(score.mappings[3].notations[0].notes[2].pitch)
// { step: 11, octave: 1 }
exsurge.Gabc.updateMappingsFromSource(ctxt, score.mappings, gabc);
console.dir(score.mappings[3].notations[0].notes[2].pitch)
// { step: 10, octave: 1 }

I've tested this same code with the latest version of exsurge and verified that this does not occur there.