pumpp.task.ChordTagTransformer

class pumpp.task.ChordTagTransformer(name='chord', vocab='3567s', sr=22050, hop_length=512, sparse=False)[source]

Chord transformer that uses a tag-space encoding for chord labels.

Attributes

name (str) name of the transformer
vocab (str) A string of chord quality indicators to include: - ‘3’: maj/min - ‘5’: ‘3’ + aug/dim - ‘6’: ‘3’ + ‘5’ + maj6/min6 - ‘7’: ‘3’ + ‘5’ + ‘6’ + 7/min7/maj7/dim7/hdim7/minmaj7 - ‘s’: sus2/sus4 Note: 5 requires 3, 6 requires 5, 7 requires 6.
sr (number > 0) Sampling rate of audio
hop_length (int > 0) Hop length for annotation frames
__init__(name='chord', vocab='3567s', sr=22050, hop_length=512, sparse=False)[source]

Methods

__init__([name, vocab, sr, hop_length, sparse])
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) Empty chord annotations
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
simplify(chord) Simplify a chord string down to the vocabulary space
transform(jam[, query]) Transform jam object to make data for this task
transform_annotation(ann, duration) Transform an annotation to chord-tag encoding
vocabulary()