def _hashIntervalFromLastNote(self, e, thisChord=None): """ returns the interval between last note and current note, if extant known issues with first note of every measure in transposed pieces returns 0 if things don't work """ try: if (isinstance(e, note.Note) and e.previous('Note', flattenLocalSites=True) is not None): previousNote = e.previous('Note', flattenLocalSites=True) intFromLastNote = interval.Interval(noteStart=previousNote, noteEnd=e).intervalClass return interval.convertGeneric(interval.Interval(intFromLastNote).intervalClass) except TypeError: return 0
def _hashIntervalFromLastNote(self, e, thisChord=None): """ returns the interval between last note and current note, if extant known issues with first note of every measure in transposed pieces returns 0 if things don't work """ try: if (isinstance(e, note.Note) and e.previous( 'Note', flattenLocalSites=True) is not None): previousNote = e.previous('Note', flattenLocalSites=True) intFromLastNote = interval.Interval(noteStart=previousNote, noteEnd=e).intervalClass return interval.convertGeneric( interval.Interval(intFromLastNote).intervalClass) except TypeError: return 0