Structure

This module provides objects and methods that allows to create and analyze the structure parts of symbolic music.

The basic structure elements are:

  • Piece: The whole piece or MIDI file that contains lists of instruments, bars, notes…

It can also contain harmonic attributes like Key, Chord Progressions, etc, depending if we do want to predict or generate them.

  • Instruments: A list of bars or directly, notes (depending if we want to distrubte the notes in

bars or not).

  • Bar: List of notes (it can also contain a list of Chords).

  • Notes: The basic element in music in both time and harmonic axes.

Notes

AccidentalsNames(value)

An enumeration.

AccidentalsValues(value)

The number of semitones that are added to a note if the accidental is present.

NoteClassNames(value)

This class contains all the possible notes with their names

NoteClassBase(value)

The Tuples have 3 values:

NoteValue(pitch)

This class allows to instantiate a note object by just giving the pitch value or the name of the note in the MIDI format.

NoteTiming(pitch, start, end[, bpm, resolution])

Note(pitch, start, end, velocity[, ...])

A note even with its relevant attributes.

Instruments

InstrumentMidiPrograms(value)

An enumeration.

InstrumentMidiFamilies(value)

Value 1: List of Midi instrument program number Value 2: Color (for plot purposes) Value 3: Pitch range?

Instrument([program, name, family, is_drum, ...])

Bars

Bar([start, end, time_sig, bpm, resolution, ...])

Defines a class to group notes in bars.