MCPcopy Create free account
hub / github.com/bspaans/python-mingus / add_track

Method add_track

mingus/containers/composition.py:57–69  ·  view source on GitHub ↗

Add a track to the composition. Raise an UnexpectedObjectError if the argument is not a mingus.containers.Track object.

(self, track)

Source from the content-addressed store, hash-verified

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.

Callers 4

from_BarFunction · 0.95
from_TrackFunction · 0.95
__add__Method · 0.95
setUpMethod · 0.80

Calls 1

Tested by 1

setUpMethod · 0.64