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

accidental sign comes b̲e̲f̲o̲r̲e̲ octave tracking

parent 756dc9a5
No related branches found
No related tags found
No related merge requests found
......@@ -233,7 +233,23 @@ def mml(macro, _nplay=None, _barline=None, _mmltrk=None):
if char in _MML_NAME2STEP.keys():
# base note
bnote = char
note = 12 * octave + _MML_NAME2STEP[char]
acc = u''
# accidental sign
if macro and macro[0] in ("#", "+"):
if note < 83:
note += 1
acc = u''
bnote = _MML_STEP2NAME_IS[note % 12]
macro.pop(0)
elif macro and macro[0] == "-":
if note > 0:
note -= 1
acc = u''
bnote = _MML_STEP2NAME_ES[note % 12]
macro.pop(0)
# octave tracking implementation
if octave_tracking and not octave_tracking_onhold:
if (octave < 6) and (abs(note - octave_tracking_last_note) >
......@@ -248,25 +264,9 @@ def mml(macro, _nplay=None, _barline=None, _mmltrk=None):
note -= 12
octave_tracking_onhold = False
octave_tracking_last_note = note
# base note information
extra = (octave, char, u'')
bnote = char
# accidental sign
if macro and macro[0] in ("#", "+"):
if note < 83:
note += 1
extra = (octave, char, u'')
bnote = _MML_STEP2NAME_IS[note % 12]
macro.pop(0)
elif macro and macro[0] == "-":
if note > 0:
note -= 1
extra = (octave, char, u'')
bnote = _MML_STEP2NAME_ES[note % 12]
macro.pop(0)
# base note and accidental
# final calculated pitch
extra = (octave, char, acc)
normml[0] += bnote
# length
......
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