EasyMIDI.Chord

class EasyMIDI.Chord(noteList=[])

The Chord is a simple class that contains lists of Notes.

Initializes a Chord object.

Parameters:noteList (list of Note) – A list of Notes that should form a chord.
__init__(noteList=[])

Initializes a Chord object.

Parameters:noteList (list of Note) – A list of Notes that should form a chord.

Methods

__init__([noteList]) Initializes a Chord object.
addNote(note) Adds a note to the Chord.
getDuration() Returns the duration of the longest Chord note.
getNotes() Gets the Notes of the chord.
getVolume() Returns the volume of the loudest Chord note.
removeNote(note) Removes a note from the Chord.
setDuration(duration) Sets the duration of the note to duration.
setNotes(noteList) Sets the Chord notes to the Notes in noteList.
setOctave(octave) Sets the octave of the note to octave.
setVolume(volume) Sets the volume of the note to volume.
addNote(note)

Adds a note to the Chord.

Parameters:
  • note – The note to add.
  • typeNote
getDuration()

Returns the duration of the longest Chord note.

Returns:The duration.
Return type:float or int
getNotes()

Gets the Notes of the chord.

Returns:The list of Notes of the Chord.
Return type:list of Note
getVolume()

Returns the volume of the loudest Chord note.

Returns:The volume.
Return type:int
removeNote(note)

Removes a note from the Chord.

Parameters:
  • note – The note to remove.
  • typeNote
setDuration(duration)

Sets the duration of the note to duration.

Parameters:duration (float or int) – The new duration (ex. 1/4).
setNotes(noteList)

Sets the Chord notes to the Notes in noteList.

Parameters:noteList – A list of notes that should form a chord.
setOctave(octave)

Sets the octave of the note to octave.

Parameters:octave (int) – The new octave (1-7).
setVolume(volume)

Sets the volume of the note to volume.

Parameters:volume (int) – The new volume (0-100).