Add a track to the composition. Raise an UnexpectedObjectError if the argument is not a mingus.containers.Track object.
(self, track)
| 55 | self.set_author() |
| 56 | |
| 57 | def add_track(self, track): |
| 58 | """Add a track to the composition. |
| 59 | |
| 60 | Raise an UnexpectedObjectError if the argument is not a |
| 61 | mingus.containers.Track object. |
| 62 | """ |
| 63 | if not hasattr(track, "bars"): |
| 64 | raise UnexpectedObjectError( |
| 65 | "Unexpected object '%s', " |
| 66 | "expecting a mingus.containers.Track object" % track |
| 67 | ) |
| 68 | self.tracks.append(track) |
| 69 | self.selected_tracks = [len(self.tracks) - 1] |
| 70 | |
| 71 | def add_note(self, note): |
| 72 | """Add a note to the selected tracks. |