class mingus.containers.bar.Bar[source]
__add__(self, note_container)[source]

Enable the ‘+’ operator on Bars.

__eq__(self, other)[source]

Enable the ‘==’ operator for Bars.

__getitem__(self, index)[source]

Enable the ‘[]’ notation on Bars to get the item at the index.

__init__(self, key=C, meter=(4, 4))[source]

Enable the len() method for Bars.


Enable str() and repr() for Bars.

__setitem__(self, index, value)[source]

Enable the use of [] = notation on Bars.

The value should be a NoteContainer, or a string/list/Note understood by the NoteContainer.


Augment the NoteContainers in Bar.


Attribute of type: list []

change_note_duration(self, at, to)[source]

Change the note duration at the given index to the given duration.


Attribute of type: float 0.0

determine_chords(self, shorthand=False)[source]

Return a list of lists [place_in_beat, possible_chords].

determine_progression(self, shorthand=False)[source]

Return a list of lists [place_in_beat, possible_progressions].


Diminish the NoteContainers in Bar.


Empty the Bar, remove all the NoteContainers.


Return a list of unique note names in the Bar.


Return the highest and the lowest note in a tuple.


Return False if there is room in this Bar for another NoteContainer, True otherwise.


Attribute of type: str 'C'


Attribute of type: float 0.0


Attribute of type: tuple (4, 4)

place_notes(self, notes, duration)[source]

Place the notes on the current_beat.

Notes can be strings, Notes, list of strings, list of Notes or a NoteContainer.

Raise a MeterFormatError if the duration is not valid.

Return True if succesful, False otherwise (ie. the Bar hasn’t got enough room for a note of that duration).

place_notes_at(self, notes, at)[source]

Place notes at the given index.

place_rest(self, duration)[source]

Place a rest of given duration on the current_beat.

The same as place_notes(None, duration).


Remove the last NoteContainer in the Bar.

set_meter(self, meter)[source]

Set the meter of this bar.

Meters in mingus are represented by a single tuple.

If the format of the meter is not recognised, a MeterFormatError will be raised.


Return the space left on the Bar.

transpose(self, interval, up=True)[source]

Transpose the notes in the bar up or down the interval.

Call transpose() on all NoteContainers in the bar.


Return the value left on the Bar.

Back to Index