Add new functionalities

This commit is contained in:
Bartłomiej Pluta
2019-06-29 12:54:47 +02:00
parent 9a3936a202
commit db3419af01
3 changed files with 72 additions and 36 deletions

11
Note.py
View File

@@ -38,7 +38,7 @@ class NotePitch(Enum):
aValue = a.value
bValue = b.value
return [note for note in NotePitch.__members__.items() if note[1].value >= aValue and note[1].value <= bValue]
return [note[1] for note in NotePitch.__members__.items() if note[1].value >= aValue and note[1].value <= bValue]
class Note:
def __init__(self, note, octave, duration):
@@ -47,7 +47,8 @@ class Note:
else:
self.note = note
self.octave = octave
self.duration = duration
def __str__(self):
return self.note.name
self.duration = duration
@staticmethod
def range(a, b):
return [Note(note, 1, 1) for note in NotePitch.range(a.note, b.note)]