Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some minor fixes (though two of them are breaking) #36

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions mingus/containers/bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -133,15 +133,16 @@ 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
self.current_beat -= diff

def get_range(self):
"""Return the highest and the lowest note in a tuple."""
Expand Down