def __init__(self, old_key, key, clef): Engraver.__init__(self) self.m_old_key = old_key self.m_key = key self.m_clef = clef self.m_old_accidentals = mpdutils.key_to_accidentals(old_key) self.m_accidentals = mpdutils.key_to_accidentals(key)
def refill_accidentals_info(self, key): """Fill the .m_accidentals_info dict with the accidentals that exist in the key signature `key`. """ self.m_accidentals_info = {} for step in range(MusicalPitch.LOWEST_STEPS, MusicalPitch.HIGHEST_STEPS+1): self.m_accidentals_info[step] = 0 for a in mpdutils.key_to_accidentals(key): n = MusicalPitch.new_from_notename(a) for oct in range(-4, 7): n.m_octave_i = oct if n.semitone_pitch() < 128: if a[-4:] == 'eses': self.m_accidentals_info[n.steps()] = -2 elif a[-2:] == 'es': self.m_accidentals_info[n.steps()] = -1 elif a[-4:] == 'isis': self.m_accidentals_info[n.steps()] = 2 else: self.m_accidentals_info[n.steps()] = 1
def refill_accidentals_info(self, key): """Fill the .m_accidentals_info dict with the accidentals that exist in the key signature `key`. """ self.m_accidentals_info = {} for step in range(MusicalPitch.LOWEST_STEPS, MusicalPitch.HIGHEST_STEPS + 1): self.m_accidentals_info[step] = 0 for a in mpdutils.key_to_accidentals(key): n = MusicalPitch.new_from_notename(a) for octave in range(-4, 7): n.m_octave_i = octave if n.semitone_pitch() < 128: if a[-4:] == 'eses': self.m_accidentals_info[n.steps()] = -2 elif a[-2:] == 'es': self.m_accidentals_info[n.steps()] = -1 elif a[-4:] == 'isis': self.m_accidentals_info[n.steps()] = 2 else: self.m_accidentals_info[n.steps()] = 1
def __init__(self, old_key, key, clef): Engraver.__init__(self) self.m_clef = clef self.m_old_accidentals = mpdutils.key_to_accidentals(old_key) self.m_accidentals = mpdutils.key_to_accidentals(key)