musif.extract.features.harmony.utils module¶
- musif.extract.features.harmony.utils.CountChordsGroup(counter_function: List[str], number: str) Dict[str, str] [source]¶
- musif.extract.features.harmony.utils.compute_number_of_measures(done, starting_measure, previous_measure, measure, current_onset, num_beats)[source]¶
- musif.extract.features.harmony.utils.count_chords(chords: list, order: List[str] = []) Dict[str, str] [source]¶
- musif.extract.features.harmony.utils.get_chords_functions(chords, relativeroots, local_keys) list [source]¶
- musif.extract.features.harmony.utils.get_measures_per_key(keys_options, measures, keys, mc_onsets, time_signatures)[source]¶
- musif.extract.features.harmony.utils.get_numerals_lists(list_numerals, list_relativeroots, list_local_keys)[source]¶
- musif.extract.features.harmony.utils.get_second_grouping_localkey(first_grouping, relativeroot, local_key)[source]¶
- musif.extract.features.harmony.utils.make_type_col(df, num_col='numeral', form_col='form', fig_col='figbass')[source]¶
- musif.extract.features.harmony.utils.sort_labels(labels, git_branch='master', drop_duplicates=True, verbose=True, **kwargs)[source]¶
- Sort a list of DCML labels following custom criteria.
Uses: split_labels()
- Parameters
labels (
collection
orpandas.Series
) – The labels you want to sort.git_branch (
str
, optional) – The branch of the DCMLab/standards repo from which you want to use the regEx.drop_duplicates (
bool
, optional) – By default, the function returns an ordered list of unique labels. Set to False in order to keep duplicate labels. Note that where the ordered features are identical, labels appear in the order of their occurrence.verbose (.obj:bool, optional) – By default, values that are missing from custom orderings are printed out. Pass False to prevent that.
kwargs ({‘values’, ‘occurrences’, ‘rvalues’, ‘roccurrences’},
dict
,list
or callable) – Pass one argument for every feature that you want to sort in the order in which features should be used for sorting. The arguments will be mapped on the respective columns which should yield alpha-numeric values to be sorted. globalkey localkey pedal chord numeral form figbass changes relativeroot pedalend phraseend chordtype
Examples
- musif.extract.features.harmony.utils.split_labels(labels, git_branch='master', dropna=True)[source]¶
- Split DCML harmony labels into their respective features using the regEx
from the indicated branch of the DCMLab/standards repository.
- Parameters
labels (
pandas.Series
) – Harmony labels to be split.git_branch (
str
, optional) – The branch of the DCMLab/standards repo from which you want to use the regEx.dropna (
bool
, optional) – Drop rows where the regEx didn’t match.