beatmachine.effects.periodic module

The periodic module contains effects that update beats independently of others at regular intervals, i.e. removing every other beat.

class beatmachine.effects.periodic.CutEveryNth(*, period: int = 1, denominator: int = 2, take_index: int = 0, offset: int = 0)

Bases: beatmachine.effects.periodic.PeriodicEffect

Keeps one piece of each beat. For example, Denominator = 2, Take = 0 takes the first half and Denominator = 2, Take = 1 keeps the second half.

process_beat(beat: numpy.ndarray) → numpy.ndarray

Processes a single beat.

Parameters:beat – Beat to process.
Returns:Updated beat or None if it should be removed.
class beatmachine.effects.periodic.PeriodicEffect(*, period: int = 1, offset: int = 0)

Bases: beatmachine.effects.base.LoadableEffect, abc.ABC

A PeriodicEffect is an effect that gets applied to beats at a fixed interval, i.e. every other beat. A PeriodicEffect with a period of 1 gets applied to every single beat.

process_beat(beat: numpy.ndarray) → Optional[numpy.ndarray]

Processes a single beat.

Parameters:beat – Beat to process.
Returns:Updated beat or None if it should be removed.
class beatmachine.effects.periodic.RemoveEveryNth(*, period: int = 2, offset: int = 0)

Bases: beatmachine.effects.periodic.PeriodicEffect

Completely remove beats.

process_beat(beat: numpy.ndarray) → Optional[numpy.ndarray]

Processes a single beat.

Parameters:beat – Beat to process.
Returns:Updated beat or None if it should be removed.
class beatmachine.effects.periodic.RepeatEveryNth(*, period: int = 1, offset: int = 0, times: int = 2)

Bases: beatmachine.effects.periodic.PeriodicEffect

Repeat beats.

process_beat(beat: numpy.ndarray) → numpy.ndarray

Processes a single beat.

Parameters:beat – Beat to process.
Returns:Updated beat or None if it should be removed.
class beatmachine.effects.periodic.ReverseEveryNth(*, period: int = 1, offset: int = 0)

Bases: beatmachine.effects.periodic.PeriodicEffect

Reverse beats.

process_beat(beat: numpy.ndarray) → numpy.ndarray

Processes a single beat.

Parameters:beat – Beat to process.
Returns:Updated beat or None if it should be removed.
class beatmachine.effects.periodic.SilenceEveryNth(*, period: int = 1, offset: int = 0)

Bases: beatmachine.effects.periodic.PeriodicEffect

Silence beats, retaining their lengths.

process_beat(beat: numpy.ndarray) → numpy.ndarray

Processes a single beat.

Parameters:beat – Beat to process.
Returns:Updated beat or None if it should be removed.