Numuse Documentation

numuse.notation.RootedIntervalCollection

numuse.notation.RootedIntervalCollection

class numuse.notation.RootedIntervalCollection(root: numuse.notation.Note, interval_collection: Set[int], duration=0, musical_system=<numuse.musical_system.RBMS_Approximation object>)[source]

Bases: numuse.notation.NoteCollection

A note collection instantiated in a special way

A rooted interval collection is a way to define a set of notes of a musical system.

It does so specifying a note (denoted by root) from the system and a set of intervals measured with respect to the root.

Parameters
  • root (int) – The root tone

  • intervals (Set[int]) – The intervals above the root

__init__(root: numuse.notation.Note, interval_collection: Set[int], duration=0, musical_system=<numuse.musical_system.RBMS_Approximation object>)[source]

durations is measured in seconds, it is by default set to 0 seconds to represent no duration

Methods

__init__(root, interval_collection[, …])

durations is measured in seconds, it is by default set to 0 seconds to represent no duration

compute_diatonic_distance(other_NC)

Return how many notes the two note collections differ by dividided by the number of notes it has

compute_intervallic_complexity()

Computes the intervallic complexity of this rooted interval collection

generate_interval_to_occurence()

Generate a dictionary that maps all possible intervals in this interval collection to the number of times it appears

generate_notes()

Generate the notes that are defined by taking the root note and adding the notes in the interval collection

generate_wave_function()

Generates the wave function determined by the current musical system

get_fundamental_representation()

Generate the fundamental representation of this interval collection

compute_diatonic_distance(other_NC: numuse.notation.NoteCollection)float

Return how many notes the two note collections differ by dividided by the number of notes it has

compute_intervallic_complexity()float[source]

Computes the intervallic complexity of this rooted interval collection

The intervallic complexity of a rooted interval collection is computed by considering all the possible intervals in the interval collection, assigning a complexity cost (derived from the ratios that the system approximates) and then summing all of the complexity costs.

For example, if we consider the interval collection {0, 4, 7, 11}, we clearly have the intervals 0, 4, 7, 11, but additionally between 4 and 7, there is an interval of 3. and between 4 and 11 there is another interval of 7.

Returns

The intervallic complexity

Return type

float

generate_interval_to_occurence()Dict[int, int][source]

Generate a dictionary that maps all possible intervals in this interval collection to the number of times it appears

Returns

A dictionary mapping intervals to occurence

Return type

Dict[int, int]

generate_notes()Set[numuse.notation.Note][source]

Generate the notes that are defined by taking the root note and adding the notes in the interval collection

:param root: The root tone

Parameters

intervals (Set[int]) – The intervals above the root

Returns

A list of notes

Return type

Set[int]

Example

>>> ric = RootedIntervalCollection(5, {0, 4, 7, 11})
>>> ric.generate_notes()
TODO
generate_wave_function()

Generates the wave function determined by the current musical system

get_fundamental_representation()numuse.notation.RootedIntervalCollection[source]

Generate the fundamental representation of this interval collection

The fundamental representation a rooted interval collection where the interval are within the range 0 … num_notes - 1 where num_notes is defined by the musical system we are dealing with.

In 12 tone equal temperament, num_notes is equal to 12.

For example, if we have a rooted interval collection 13 | -3 1 2 24, then the fundamental representation would be 1 | 0 1 2 9

Returns

The funamental representation of this interavl collection

Return type

RootedIntervalCollection

Free document hosting provided by Read the Docs.