NoteList class

class NoteList(*args)

Base class that other note lists (e.g. Chord or Sequence) inherit from.

Parameters:

*args – An iterable or nested iterable up to max_depth of either Note objects or ints representing MIDI numbers. Can also take a NoteList as a constructor, mainly intended for use by child classes.

Raises:
  • ValueError – If the max_depth is exceeded but no valid objects are found.
  • TypeError – If a non-iterable is passed to the constructor.
max_depth

Default is 5. Class attribute for how deep the constructor searches for valid variables.

notes

This attribute is a property. Returns a sorted tuple of Note objects. When setting this attribute, it expects an iterable of Note objects, that it will then sort and store as a tuple.

classmethod from_ascii(note_string)
Parameters:note_string (str) – Space or comma-space separated ASCII notes
Returns:NoteList or child class with the Notes.
Return type:NoteList or child class
classmethod from_midi_list(midi_list)
Parameters:midi_list (list) – List of integers representing MIDI note codes.
Returns:NoteList or child class with the Notes.
Return type:NoteList or child class