Open GoogleCodeExporter opened 9 years ago
There seem to be some other issues with the function too.
File "/Library/Python/2.7/site-packages/mingus/containers/Bar.py", line 141, in
change_note_duration
cur = x[0][1]
TypeError: 'float' object is not subscriptable
Original comment by OrtalisM...@gmail.com
on 23 Apr 2013 at 10:17
This fixes the issue:
def change_note_duration(self, at, to):
"""Changes the note duration at index `at` to duration `to`"""
if _meter.valid_beat_duration(to):
diff = 0
for x in self.bar:
if diff != 0:
x[0] -= diff
if x[0] == at:
cur = x[1]
x[1] = to
diff = 1/cur - 1/to
Original comment by OrtalisM...@gmail.com
on 23 Apr 2013 at 11:21
Attachments:
This seems more useful:
def change_note_duration(self, at, to):
"""Change the note duration at the given index to the given
duration."""
if _meter.valid_beat_duration(to):
diff = 0
for x in self.bar:
if diff != 0:
x[0] -= diff
if x[0] == at:
cur = x[1]
x[1] = to
diff = 1/cur - 1/to
return True
else:
return False
Original comment by OrtalisM...@gmail.com
on 1 May 2013 at 12:01
Attachments:
Original issue reported on code.google.com by
OrtalisM...@gmail.com
on 23 Apr 2013 at 9:57