From 17348ad1c7dd9c381fffcfd4a7628e2a11169501 Mon Sep 17 00:00:00 2001 From: anton Date: Fri, 9 Sep 2016 09:12:29 +0200 Subject: [PATCH 1/2] fix errors in place_note_at and change_note_duration --- mingus/containers/bar.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mingus/containers/bar.py b/mingus/containers/bar.py index 3557b502..3050c7fe 100644 --- a/mingus/containers/bar.py +++ b/mingus/containers/bar.py @@ -104,7 +104,7 @@ def place_notes_at(self, notes, at): """Place notes at the given index.""" for x in self.bar: if x[0] == at: - x[0][2] += notes + x[2] += notes def place_rest(self, duration): """Place a rest of given duration on the current_beat. @@ -133,14 +133,14 @@ def is_full(self): def change_note_duration(self, at, to): """Change the note duration at the given index to the given duration.""" - if valid_beat_duration(to): + if _meter.valid_beat_duration(to): diff = 0 for x in self.bar: if diff != 0: - x[0][0] -= diff + x[0] -= diff if x[0] == at: - cur = x[0][1] - x[0][1] = to + cur = x[1] + x[1] = to diff = 1 / cur - 1 / to def get_range(self): From 88bae0d36d75af5eb32ad410cd5c136f0d608693 Mon Sep 17 00:00:00 2001 From: anton Date: Fri, 9 Sep 2016 09:21:44 +0200 Subject: [PATCH 2/2] change_note_duration now updates current_beat --- mingus/containers/bar.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mingus/containers/bar.py b/mingus/containers/bar.py index 3050c7fe..a48d5908 100644 --- a/mingus/containers/bar.py +++ b/mingus/containers/bar.py @@ -142,6 +142,7 @@ def change_note_duration(self, at, to): cur = x[1] x[1] = to diff = 1 / cur - 1 / to + self.current_beat -= diff def get_range(self): """Return the highest and the lowest note in a tuple."""