Skip to content

Module pippi.rhythm

Some helpers for building and transforming onset lists

None

Variables

BELL
CLAVE
MIN_BEAT
REST_SYMBOLS
RUMBA
SON
TRESILLO

Functions

eu

def eu(
    length,
    numbeats,
    offset=0,
    reps=None,
    reverse=False
)

A euclidian pattern generator

Length 6, numbeats 3

rhythm.eu(6, 3) [1, 0, 1, 0, 1, 0]

Length 6, numbeats 3, offset 1

rhythm.eu(6, 3, 1) [0, 1, 0, 1, 0, 1]

makesection

def makesection(
    k,
    instrument,
    length,
    onsets,
    stems,
    stemsdir,
    sectionname,
    sectionindex
)

onsets

def onsets(
    pattern,
    beat=0.2,
    length=30.0,
    smear=1
)

Patterns to onset lists

pgen

def pgen(
    numbeats,
    div=1,
    offset=0,
    reps=None,
    reverse=False
)

Pattern creation helper

repeat

def repeat(
    onsets,
    reps
)

Repeat a sequence of onsets a given number of times

Classes

Seq

class Seq(
    /,
    *args,
    **kwargs
)

Class variables

instruments

Methods

add

def add(
    self,
    name,
    pattern=None,
    callback=None,
    div=1.0,
    numbeats=4,
    swing=0.0,
    barcallback=None,
    sounds=None,
    smear=1.0
)

play

def play(
    self,
    numbeats,
    patseq=None,
    stems=False,
    stemsdir='',
    pool=False
)

score

def score(
    self,
    score,
    barlength=4,
    stems=False,
    stemsdir='',
    pool=False
)

update

def update(
    self,
    name,
    **kwargs
)