musif package

Subpackages

Submodules

musif.config module

class musif.config.ExtractConfiguration(*args, **kwargs)[source]

Bases: GenericConfiguration

Configuration object used by :class: musif.extract.extract.FeatureExtractor

It additionaly sets the following properties:

from musif.musicxml import constants as musicxml_c
self.scoring_family_order = musicxml_c.SCORING_FAMILY_ORDER
self.scoring_order = musicxml_c.SCORING_ORDER
self.sound_to_family = musicxml_c.SOUND_TO_FAMILY
self.family_to_abbreviation = musicxml_c.FAMILY_TO_ABBREVIATION
self.sound_to_abbreviation = musicxml_c.SOUND_TO_ABBREVIATION

The above settings can be overriden by the user both by changing the variables in musicxml.constants and by adding them to the configuration.

is_requested_feature_category(feature: str) bool[source]

Returns True if feature is among the requeste features, according to the configuration. Returns False otherwise.

is_requested_musescore_file() bool[source]

Returns True if any of the requested features needs musescore files for the harmonic annotations. Returns False otherwise.

class musif.config.GenericConfiguration(arg, **kwargs)[source]

Bases: object

Generic class for configuration objects.

When subclassing, you should override the _get_fallback method.

__init__(arg, **kwargs)[source]

It set up the Configuration object in this way:

  1. it sets the default values returned by self._get_fallback() as filed of the object (i.e. in the __dict__ dictionary)

  2. it load the configuration file arg provided by the user

  3. it overrides the configuration file with the keyword arguments

  4. it sets the values obtained, overriding the one already available, in __dict_, making them avilable as usual fields

to_dict() dict[source]

Returns a dictionary having as keys the public fields of this object.

class musif.config.PostProcessConfiguration(arg, **kwargs)[source]

Bases: GenericConfiguration

Configuration object used by :class: musif.process.DataProcessor

musif.logs module