mingus.containers.note¶
-
class
mingus.containers.note.
Note
[source]¶ -
-
__int__
(self)[source]¶ Return the current octave multiplied by twelve and add notes.note_to_int to it.
This means a C-0 returns 0, C-1 returns 12, etc. This method allows you to use int() on Notes.
-
__lt__
(self, other)[source]¶ Enable the comparing operators on Notes (>, <, ==, !=, >= and <=).
So we can sort() Intervals, etc.
Examples:
>>> Note('C', 4) < Note('B', 4) True >>> Note('C', 4) > Note('B', 4) False
-
dynamics
¶ Attribute of type: dict
{}
-
from_hertz
(self, hertz, standard_pitch=440)[source]¶ Set the Note name and pitch, calculated from the hertz value.
The standard_pitch argument can be used to set the pitch of A-4, from which the rest is calculated.
-
from_int
(self, integer)[source]¶ Set the Note corresponding to the integer.
0 is a C on octave 0, 12 is a C on octave 1, etc.
Example:
>>> Note().from_int(12) 'C-1'
-
from_shorthand
(self, shorthand)[source]¶ Convert from traditional Helmhotz pitch notation.
Examples:
>>> Note().from_shorthand("C,,") 'C-0' >>> Note().from_shorthand("C") 'C-2' >>> Note().from_shorthand("c'") 'C-4'
-
measure
(self, other)[source]¶ Return the number of semitones between this Note and the other.
Examples:
>>> Note('C').measure(Note('D')) 2 >>> Note('D').measure(Note('C')) -2
-
name
¶ Attribute of type: str
'C'
-
octave
¶ Attribute of type: int
4
-
remove_redundant_accidentals
(self)[source]¶ Call notes.remove_redundant_accidentals on this note’s name.
-
set_note
(self, name=C, octave=4, dynamics={})[source]¶ Set the note to name in octave with dynamics.
Return the objects if it succeeded, raise an NoteFormatError otherwise.
-
to_hertz
(self, standard_pitch=440)[source]¶ Return the Note in Hz.
The standard_pitch argument can be used to set the pitch of A-4, from which the rest is calculated.
-