msaf/base.py
def estimate_beats(self):
        """Estimates the beats using librosa.

        Returns
        -------
        times: np.array
            Times of estimated beats in seconds.
        frames: np.array
            Frame indeces of estimated beats.
        """
        # Compute harmonic-percussive source separation if needed
        if self._audio_percussive is None:
            self._audio_harmonic, self._audio_percussive = self.compute_HPSS()

        # Compute beats
        tempo, frames = librosa.beat.beat_track(
            y=self._audio_percussive, sr=self.sr,
            hop_length=self.hop_length)

        # To times
        times = librosa.frames_to_time(frames, sr=self.sr,
                                       hop_length=self.hop_length)

        # TODO: Is this really necessary?
        if len(times) > 0 and times[0] == 0:
            times = times[1:]
            frames = frames[1:]

        return times, frames
def estimate_beats(self):
        # Compute harmonic-percussive source separation if needed
        if self._audio_percussive is None:
            self._audio_harmonic, self._audio_percussive = self.compute_HPSS()

        # Compute beats
        tempo, frames = librosa.beat.beat_track(
            y=self._audio_percussive, sr=self.sr,
            hop_length=self.hop_length)

        # To times
        times = librosa.frames_to_time(frames, sr=self.sr,
                                       hop_length=self.hop_length)

        # TODO: Is this really necessary?
        if len(times) > 0 and times[0] == 0:
            times = times[1:]
            frames = frames[1:]

        return times, frames
def estimate_beats ( self ) : # Compute harmonic-percussive source separation if needed if self . _audio_percussive is None : self . _audio_harmonic , self . _audio_percussive = self . compute_HPSS ( ) # Compute beats tempo , frames = librosa . beat . beat_track ( y = self . _audio_percussive , sr = self . sr , hop_length = self . hop_length ) # To times times = librosa . frames_to_time ( frames , sr = self . sr , hop_length = self . hop_length ) # TODO: Is this really necessary? if len ( times ) > 0 and times [ 0 ] == 0 : times = times [ 1 : ] frames = frames [ 1 : ] return times , frames
Estimates the beats using librosa.

        Returns
        -------
        times: np.array
            Times of estimated beats in seconds.
        frames: np.array
            Frame indeces of estimated beats.
Estimates the beats using librosa .