pumpp.task.BeatPositionTransformer

class pumpp.task.BeatPositionTransformer(name, max_divisions=12, sr=22050, hop_length=512, sparse=False)[source]

Encode beat- and downbeat-annotations as labeled intervals.

This transformer assumes that the value field of a beat annotation encodes its metrical position (1, 2, 3, 4, ...).

A value of 0 indicates that the beat does not belong to a bar, and should be used to indicate pickup beats.

Beat position strings are coded as SUBDIVISION/POSITION

For example, in 4/4 time, the 2 beat would be coded as “04/02”.

__init__(name, max_divisions=12, sr=22050, hop_length=512, sparse=False)[source]

Methods

__init__(name[, max_divisions, sr, ...])
decode_events(encoded) Decode labeled events into (time, value) pairs
decode_intervals(encoded[, duration, multi, ...]) Decode labeled intervals into (start, end, value) triples
empty(duration) Create an empty jams.Annotation for this task.
encode_events(duration, events, values[, dtype]) Encode labeled events as a time-series matrix.
encode_intervals(duration, intervals, values) Encode labeled intervals as a time-series matrix.
inverse(encoded[, duration]) Inverse transformation
merge(data) Merge an array of output dictionaries into a single dictionary with properly scoped names.
pop(field)
register(field, shape, dtype) Register a field as a tensor with specified shape and type.
scope(key) Apply the name scope to a key
transform(jam[, query]) Transform jam object to make data for this task
transform_annotation(ann, duration) Transform an annotation to the beat-position encoding
vocabulary()