amads.pitch.ivdist1#
Provides the ivdist1 function
Original doc: https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&doi=6e06906ca1ba0bf0ac8f2cb1a929f3be95eeadfa#page=63
- amads.pitch.ivdist1.ivdist1(score, weighted=True) list[float] [source]#
Returns the interval distribution of a musical score.
Currently, intervals greater than an octave will be ignored.
- Args:
score (Score): The musical score to analyze weighted (bool, optional): If True, the interval distribution is
weighted by note durations (default True)
- Returns:
- list[float]: A 25-element list representing the normalized
probabilities of each interval. The components are spaced at semitone distances with the first component representing the downward octave and the last component the upward octave. If the score is empty, the function returns a list with all elements set to zero.
- Raises:
Exception: If the score is not monophonic (e.g. contains chords)
- Parameters:
score (
Score
)- Return type:
list
[float
]
- amads.pitch.ivdist1.update_id(id, notes, weighted)[source]#
Updates the interval distribution list based on the given notes.
Serves as a helper function for ivdist1
- Args:
id (list[float]): The interval distribution list to be updated. notes (list[Note]): The list of notes to process. weighted (bool): If True, the interval distribution is weighted
by note durations.
- Parameters:
id (
list
[float
])notes (
list
[Note
])weighted (
bool
)