musicflower.loader.get_chroma
- musicflower.loader.get_chroma(data, cqt=False, normal=False, harm=False, filter=False, smooth=True, asdict=False, loader=<function load>, **kwargs)[source]
Get chroma features from audio data.
- Parameters:
data (
Union
[str
,Tuple
[ndarray
,int
]]) – a path to an audio file, which is loaded using librosa’s load function, or a tuple(y, sr)
that is of the same type as returned by the load function, i.e.y
: an audio time series as np.ndarray andsr
the sampling ratecqt (
bool
) – return constant-Q transformnormal (
bool
) – return “normal” chroma featuresharm (
bool
) – filter harmonics before computing chroma featuresfilter (
bool
) – apply non-local filtering to chroma featuressmooth (
bool
) – apply a horizontal median filter (after non-local filtering)asdict (
bool
) – return results as a dict (keys are ‘cqt’, ‘normal’, ‘harm’, ‘filter’, ‘smooth’)loader – the loader to use (defaults to librosa.load)
kwargs – kwargs passed to the cqt calls (librosa.cqt and/or librosa.feature.chroma_cqt)
- Return type:
Union
[Tuple
[ndarray
],Dict
[str
,ndarray
],ndarray
]- Returns:
tuple, dict, or Numpy array with results (cqt/normal/harm/filter/smooth as specified)