mingus.containers.track¶
-
class
mingus.containers.track.
Track
[source]¶ -
__add__
(self, value)[source]¶ Enable the ‘+’ operator for Tracks.
Notes, notes as string, NoteContainers and Bars accepted.
-
__setitem__
(self, index, value)[source]¶ Enable the ‘[] =’ notation for Tracks.
Throw an UnexpectedObjectError if the value being set is not a mingus.containers.Bar object.
-
add_notes
(self, note, duration=None)[source]¶ Add a Note, note as string or NoteContainer to the last Bar.
If the Bar is full, a new one will automatically be created.
If the Bar is not full but the note can’t fit in, this method will return False. True otherwise.
An InstrumentRangeError exception will be raised if an Instrument is attached to the Track, but the note turns out not to be within the range of the Instrument.
-
bars
¶ Attribute of type: list
[]
-
from_chords
(self, chords, duration=1)[source]¶ Add chords to the Track.
The given chords should be a list of shorthand strings or list of list of shorthand strings, etc.
Each sublist divides the value by 2.
If a tuning is set, chords will be expanded so they have a proper fingering.
Example:
>>> t = Track().from_chords(['C', ['Am', 'Dm'], 'G7', 'C#'], 1)
-
get_tuning
(self)[source]¶ Return a StringTuning object.
If an instrument is set and has a tuning it will be returned. Otherwise the track’s one will be used.
-
instrument
¶ Attribute of type: NoneType
None
-
name
¶ Attribute of type: str
'Untitled'
-
set_tuning
(self, tuning)[source]¶ Set the tuning attribute on both the Track and its instrument (when available).
Tuning should be a StringTuning or derivative object.
-
transpose
(self, interval, up=True)[source]¶ Transpose all the notes in the track up or down the interval.
Call transpose() on every Bar.
-
tuning
¶ Attribute of type: NoneType
None
-