This PR add a new feature representation with a fixed number of frames per beats. This is an advancement of issue #154 , but on beats instead of bars.
For the user this adds :
A configurable parameter frames_per_beat (int, default 3). The number of frames sampled for each beat.
An argument of Feature : multibeat (bool, default False). Whether to use this representation or not.
An in line parameter of the run_MSAF.py : -mb. To use this representation.
A little bit of documentaion.
In the Feature class :
self._est_multibeat_features and self._ann_mutlibeat_features where the representation will be for resp. estimated beats and annotated beats.
self._est_multibeat_frames and self._ann_multibeat_frames with the frame index of the beats. (We remove the last beat from self._est_beatsync_frames, because we compute frames between beats)
self._est_multibeat_times and self._ann_multibeat_times with the times in secondes of the beats.
_compute_multibeat(self, beat_frames) to compute the index of the frames used for the representation
_shape_beatwise(self, multibeat_features) to stack the feature representation as a beatwise TF matrix.
It also does some refactoring of compute_beat_sync_features in order to use the same function to compute multibeat features. The padding of beat_times is moved to a new function called _pad_beats_times
Two new FeatureTypes : est_multibeat and ann_multibeat and the appropriate code in select_features(...)
A new Exception FramesPerBeatTooHigh raised by '_compute_multibeat()if the number of frames between two beats is lower thanframes_per_beat`.
This PR add a new feature representation with a fixed number of frames per beats. This is an advancement of issue #154 , but on beats instead of bars.
For the user this adds :
frames_per_beat
(int, default 3). The number of frames sampled for each beat.Feature
:multibeat
(bool, default False). Whether to use this representation or not.run_MSAF.py
:-mb
. To use this representation.In the
Feature
class :self._est_multibeat_features
andself._ann_mutlibeat_features
where the representation will be for resp. estimated beats and annotated beats.self._est_multibeat_frames
andself._ann_multibeat_frames
with the frame index of the beats. (We remove the last beat fromself._est_beatsync_frames
, because we compute frames between beats)self._est_multibeat_times
andself._ann_multibeat_times
with the times in secondes of the beats._compute_multibeat(self, beat_frames)
to compute the index of the frames used for the representation_shape_beatwise(self, multibeat_features)
to stack the feature representation as a beatwise TF matrix.compute_beat_sync_features
in order to use the same function to compute multibeat features. The padding ofbeat_times
is moved to a new function called_pad_beats_times
FeatureTypes
:est_multibeat
andann_multibeat
and the appropriate code inselect_features(...)
FramesPerBeatTooHigh
raised by '_compute_multibeat()if the number of frames between two beats is lower than
frames_per_beat`.test_multibeat.py
Thanks for reading, and reviewing code 😃