Module: Constants (src.constants)

Module: constants.py

This Python script contains a set of constants to be used in the Interactive Music Analysis Tool (I-MaT) application.

The constants defined in this module include a list of musical keys, a list of musical notes, a list of rhythmic values, a dictionary mapping integers to pitch class names, a dictionary of example scores, and a title text for the application.

The musical keys and notes are represented in two formats: full name and abbreviation. The rhythmic values are represented as a float or a string (in case of triplets). The pitch class integers map to pitch class names according to music theory.

The example scores dictionary contains information about example scores, including the title, URL, and subcorpus. The title text for the application includes the name and version of the application, associated project and institution, license information, and copyright statement.

CONSTANTS:

TITLE_TEXT is a string that contains the title text for the application. It includes the name and version of the application, the associated project and institution, the license information, and the copyright statement. This text is used to display a title or header in the application’s user interface.

KEYS_LIST is a list of musical keys in the format [“Key-Name”, “Abbreviation”]. It includes major and minor keys in different pitches. This list is used to represent and validate keys that are input or output by the system. The “Abbreviation” part of each list item is used for displaying or inputting keys in a compact way.

NOTES_LIST is a list of musical notes in the format [“Note-Name”, “Abbreviation”]. It covers a variety of notes including flat (“-”) and sharp (“#”) versions. The last two entries in the list provide options to remove the last note entered or finish input.

RHYTHMIC_VALUES_LIST represents rhythmic values of musical notes. Each entry contains a display string and the corresponding rhythmic value. The rhythmic value is represented either as a float or as a string, in case of triplets. The list entries cover note values from thirty-second notes to double whole notes, including dotted and triplet versions.

PITCH_CLASS_NAMES is a dictionary that maps integers to pitch class names. In music theory, pitch classes are the set of all pitches that are integer multiples of the octave. This constant is useful for converting pitch class integers into human-readable names.

EXAMPLE_SCORES_DICT is a dictionary containing data about example scores. Each entry includes the title of the score, the URL where the score can be found, and the subcorpus the score belongs to. This dictionary is used to provide users with a selection of example scores for analysis.