Skip to content

Commit

Permalink
Updated AccidentalUtils to version 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
looptailG committed Oct 12, 2024
1 parent 2c887ba commit 45dc1c0
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions source/libs/AccidentalUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

const VERSION = "1.0.0";
const VERSION = "1.0.1";

// TODO: Check which accidentals are actually handled by the tpc property.
const ACCIDENTAL_DATA = {
"NONE":
{
Expand Down Expand Up @@ -532,12 +531,12 @@ const ACCIDENTAL_DATA = {
},
"SIX_TWELFTH_FLAT":
{
"TPC": false,
"TPC": true,
"DEFAULT_OFFSET": 0,
},
"SIX_TWELFTH_SHARP":
{
"TPC": false,
"TPC": true,
"DEFAULT_OFFSET": 0,
},
"SEVEN_TWELFTH_FLAT":
Expand Down Expand Up @@ -711,14 +710,6 @@ function getAccidentalName(note)
// corresponding to the enum value. Parsing it as int is needed to properly
// compare it with the enum values in a switch statement.
var accidentalType = parseInt("" + note.accidentalType);
// TODO: Check if it's still necessary for MS 4.4 and later.
// In Musescore3 the accidentalType property is a signed integer, while the
// Accidentals enum values are always positive. If it's negative, convert
// it to an unsigned 8 bit integer by shifting it by 256.
if (accidentalType < 0)
{
accidentalType += 256;
}
if ((accidentalType < 0) || (accidentalType >= 256))
{
throw "Out of bound accidental type: " + accidentalType;
Expand Down Expand Up @@ -1135,6 +1126,6 @@ function getAccidentalName(note)
return "SAGITTAL_SHARP";

default:
throw "Unrecognised accidental: " + note.accidentalType;
throw "Unrecognised accidental type: " + note.accidentalType;
}
}

0 comments on commit 45dc1c0

Please sign in to comment.