Skip to content
Snippets Groups Projects
Unverified Commit d18a0bb1 authored by mirabilos's avatar mirabilos Committed by mirabilos
Browse files

fix MML normalisation if accidentals make pitches cross octaves

parent 3a9c9227
No related branches found
No related tags found
No related merge requests found
...@@ -242,12 +242,16 @@ def mml(macro, _nplay=None, _barline=None, _mmltrk=None): ...@@ -242,12 +242,16 @@ def mml(macro, _nplay=None, _barline=None, _mmltrk=None):
note += 1 note += 1
acc = u'' acc = u''
bnote = _MML_STEP2NAME_IS[note % 12] bnote = _MML_STEP2NAME_IS[note % 12]
if bnote == 'C':
normml[0] += ">"
macro.pop(0) macro.pop(0)
elif macro and macro[0] == "-": elif macro and macro[0] == "-":
if note > 0: if note > 0:
note -= 1 note -= 1
acc = u'' acc = u''
bnote = _MML_STEP2NAME_ES[note % 12] bnote = _MML_STEP2NAME_ES[note % 12]
if bnote == 'B':
normml[0] += "<"
macro.pop(0) macro.pop(0)
# octave tracking implementation # octave tracking implementation
...@@ -339,5 +343,5 @@ def mml(macro, _nplay=None, _barline=None, _mmltrk=None): ...@@ -339,5 +343,5 @@ def mml(macro, _nplay=None, _barline=None, _mmltrk=None):
macro.pop(0) macro.pop(0)
if _mmltrk is not None: if _mmltrk is not None:
_mmltrk(normml[0].strip()) _mmltrk(normml[0].replace('<>', '').replace('><', '').strip())
return res return res
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment