mingus.core.notes

Basic module for notes.

This module is the foundation of the music theory package.

It handles conversions from integers to notes and vice versa and thus enables simple calculations.


mingus.core.notes.fifths

Attribute of type: list ['F', 'C', 'G', 'D', 'A', 'E', 'B']


mingus.core.notes.augment(note)[source]

Augment a given note.

Examples:

>>> augment('C')
'C#'
>>> augment('Cb')
'C'

mingus.core.notes.diminish(note)[source]

Diminish a given note.

Examples:

>>> diminish('C')
'Cb'
>>> diminish('C#')
'C'

mingus.core.notes.int_to_note(note_int, accidentals=#)[source]

Convert integers in the range of 0-11 to notes in the form of C or C# or Db.

Throw a RangeError exception if the note_int is not in the range 0-11.

If not specified, sharps will be used.

Examples:

>>> int_to_note(0)
'C'
>>> int_to_note(3)
'D#'
>>> int_to_note(3, 'b')
'Eb'

mingus.core.notes.is_enharmonic(note1, note2)[source]

Test whether note1 and note2 are enharmonic, i.e. they sound the same.


mingus.core.notes.is_valid_note(note)[source]

Return True if note is in a recognised format. False if not.


mingus.core.notes.note_to_int(note)[source]

Convert notes in the form of C, C#, Cb, C##, etc. to an integer in the range of 0-11.

Throw a NoteFormatError exception if the note format is not recognised.


mingus.core.notes.reduce_accidentals(note)[source]

Reduce any extra accidentals to proper notes.

Example:

>>> reduce_accidentals('C####')
'E'

mingus.core.notes.remove_redundant_accidentals(note)[source]

Remove redundant sharps and flats from the given note.

Examples:

>>> remove_redundant_accidentals('C##b')
'C#'
>>> remove_redundant_accidentals('Eb##b')
'E'

Back to Index