sample.beatsdrop package

Implementation of Beats DROP (Beats Duality for the Resolution Of Partials)

class sample.beatsdrop.Beat(a0: Union[float, Callable[[ndarray], ndarray]] = 1, a1: Union[float, Callable[[ndarray], ndarray]] = 1, f0: Union[float, Callable[[ndarray], ndarray]] = 0.95, f1: Union[float, Callable[[ndarray], ndarray]] = 1.05, p0: Union[float, Callable[[ndarray], ndarray]] = 0, p1: Union[float, Callable[[ndarray], ndarray]] = 0)

Bases: object

Model for beating partials

Parameters:
  • a0 (float or callable) – Amplitude of first partial. It can be a function of time

  • a1 (float or callable) – Amplitude of second partial. It can be a function of time

  • f0 (float or callable) – Frequency of first partial. It can be a function of time

  • f1 (float or callable) – Frequency of second partial. It can be a function of time

  • p0 (float or callable) – Phase of first partial. It can be a function of time

  • p1 (float or callable) – Phase of second partial. It can be a function of time

compute(t: ndarray, output: Union[str, Iterable[str]]) List[ndarray]

Compute variables

Parameters:
  • t (array) – Time axis

  • output – Names of the variables to compute

property variables: Tuple[str, ...]

List of the names of the variables that can be computed by the model

class sample.beatsdrop.ExponentialDecay(a: float, d: float)

Bases: object

Exponentially decaying function \(f(t) = a\cdot e^{-\frac{2}{d}t}\)

Parameters:
  • a (float) – Amplitude at time \(t=0\)

  • d (float) – Decay in seconds

dt(t: ndarray, out: Optional[ndarray] = None)

Compute derivative of function at time t

Parameters:
  • t (array) – Time-steps at which to evaluate the derivative

  • out (array) – Optional. Array to use for storing results

Returns:

Function evaluated at time t

Return type:

array

class sample.beatsdrop.ModalBeat(a0: float = 1, a1: float = 1, f0: float = 0.95, f1: float = 1.05, d0: float = 1, d1: float = 1, p0: float = 0, p1: float = 0)

Bases: Beat

Model for beating exponentially-decaying partials

Parameters:
  • a0 (float) – Amplitude of first partial

  • a1 (float) – Amplitude of second partial

  • f0 (float) – Frequency of first partial

  • f1 (float) – Frequency of second partial

  • d0 (float) – Decay of the first partial

  • d1 (float) – Decay of the second partial

  • p0 (float) – Phase of first partial

  • p1 (float) – Phase of second partial

Submodules