Skip to content

Module pippi.mir

Functions

bandwidth

def bandwidth(
    snd,
    winsize=4096
)

centroid

def centroid(
    snd,
    winsize=4096
)

contrast

def contrast(
    snd,
    winsize=4096
)

flatness

def flatness(
    snd,
    winsize=4096
)

flatten

def flatten(
    snd
)

onsets

def onsets(
    snd,
    method=None,
    winsize=4096,
    seconds=True
)

Returns a list of onset times in seconds detected using the given method. The default method is specflux.

An optional seconds argument (normally true) may be set to false to return a list of frame indexes instead of seconds.

pitch

def pitch(
    snd,
    tolerance=0.8,
    method=None,
    winsize=4096,
    backfill=True,
    autotune=0.0,
    fallback=220.0
)

Returns a wavetable of non-zero frequencies detected which exceed the confidence threshold given. Frequencies are

held until the next detection to avoid zeros and outliers. Depending on the input, you may need to play with the tolerance value and the window size to tune the behavior. The default detection method is yinfast.

rolloff

def rolloff(
    snd,
    winsize=4096
)

segments

def segments(
    snd,
    method=None,
    winsize=4096
)

A wrapper for mir.onsets which returns a list of SoundBuffers sliced at the onset times.

See the documentation for mir.onsets for an overview of the detection methods available.