amads documentation

amads documentation#

This package collects together a variety of algorithms for symbolic music analysis.

The package is its very early stages. The API is subject to change, and many algorithms are not yet implemented, tested, or documented!

For the source code, visit the GitHub repository.

General algorithms#

amads.algorithms.entropy(d)

Calculate the relative entropy of a distribution.

amads.algorithms.nnotes(score)

Returns the number of notes in a musical score.

amads.algorithms.scale(score[, factor, dim, ...])

Scale event timings in a score by a given factor.

amads.algorithms.slice.salami

Salami slice algorithm for segmenting musical scores.

amads.algorithms.slice.window

Sliding window algorithm.

Pitch#

amads.pitch.hz2midi

Provides the hz2midi function.

amads.pitch.ismonophonic

Provides the function ismonophonic

amads.pitch.ivdirdist1

Provides the ivdirdist1 function

amads.pitch.ivdist1

Provides the ivdist1 function

amads.pitch.ivdist2

Provides the ivdist2 function

amads.pitch.ivsizedist1

Provides the ivsizedist1 function

amads.pitch.key.profiles

NAME: Key Profiles (key_profiles_literature.py)

amads.pitch.pcdist1

Pitch class distribution analysis.

amads.pitch.pcdist2

This module provides the pcdist2 function.

amads.pitch.pitch_mean

amads.pitch.transformations

Basic functionality for transforming pitch lists expressed as integers (MIDI numbers or pitch classes) through transposition, inversion, retrograde, rotation, and more.

Time#

amads.time.durdist1

Distribution of durations of notes in a Score.

amads.time.durdist2

Distribution of duration pairs in a Score.

amads.time.swing

This module implements various functions useful for analyzing swing in jazz and other genres.

amads.time.tempo

This module provides functions for analyzing tempo characteristics in musical performances.

amads.time.meter.break_it_up

This module serves to map out metrical hierarchies in a number of different ways and to express the relationship between the notes in and the hierarchy of a metrical cycle.

Harmony#

Melody#

amads.melody.boundary(score)

Given a score, returns the following: (1) If score is not monophonic, we raise an exception (2) If score has notes, we return a a list of tuples containing note start and its corresponding strength, respectively

amads.melody.segment_gestalt(score)

Given a score, returns the following: (1) If score is not monophonic, we raise an exception (2) If score is monophonic, we return a 2-tuple of lists for clang boundary starts and segment boundary starts, respectively

amads.melody.contour.interpolation_contour

Calculates the Interpolation Contour of a melody, along with related features, as implemented in the FANTASTIC toolbox of Müllensiefen (2009) [1] (features 23–27).

amads.melody.contour.step_contour

Calculates the Step Contour of a melody, along with related features, as implemented in the FANTASTIC toolbox of Müllensiefen (2009) [1] (features 20–22).

amads.melody.similarity.melsim

This is a Python wrapper for the R package 'melsim' (sebsilas/melsim).

Polyphony#

amads.polyphony.skyline(score[, threshold])

Finds the skyline of a musical score.

Core#

amads.core.basics

Quick overview: The basic hierarchy of a score is shown here.

IO#

amads.io.pianoroll(score[, y_label, ...])

Converts a Score to a piano roll display of a musical score.