mingus.containers.bar

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]
__len__(self)[source]

Enable the len() method for Bars.

__repr__(self)[source]

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(self)[source]

Augment the NoteContainers in Bar.

bar

Attribute of type: list []

change_note_duration(self, at, to)[source]

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

current_beat

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(self)[source]

Diminish the NoteContainers in Bar.

empty(self)[source]

Empty the Bar, remove all the NoteContainers.

get_note_names(self)[source]

Return a list of unique note names in the Bar.

get_range(self)[source]

Return the highest and the lowest note in a tuple.

is_full(self)[source]

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

key

Attribute of type: str 'C'

length

Attribute of type: float 0.0

meter

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_last_entry(self)[source]

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.

space_left(self)[source]

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.

value_left(self)[source]

Return the value left on the Bar.


Back to Index