boopadoop-0.0.0.1: Mathematically sound sound synthesis

Safe HaskellSafe
LanguageHaskell2010

Boopadoop.Rhythm

Description

Representing rhythms as rose trees.

Synopsis

Documentation

data Beat a Source #

A rhythm is represented as a rose tree where each subtree is given equal amounts of time. Leaves are either a Beat of type a or empty (a rest).

Constructors

RoseBeat [Beat a] 
Beat a 
Rest 
Instances
SummaryChar a => Show (Beat a) Source #

Show the rhythm by printing the summary characters, or . for rests.

Instance details

Defined in Boopadoop.Rhythm

Methods

showsPrec :: Int -> Beat a -> ShowS #

show :: Beat a -> String #

showList :: [Beat a] -> ShowS #

class SummaryChar a where Source #

Class for things that can be summarized in a single character, for use in printing out rhythms.

Methods

sumUp :: a -> Char Source #

Instances
SummaryChar DrumRack Source # 
Instance details

Defined in Boopadoop.Rhythm

Methods

sumUp :: DrumRack -> Char Source #

data DrumRack Source #

A rack of drums. Simple enumeration of the different possible drum types.

Constructors

Kick 
Snare 
Instances
SummaryChar DrumRack Source # 
Instance details

Defined in Boopadoop.Rhythm

Methods

sumUp :: DrumRack -> Char Source #

rockBeat :: Beat DrumRack Source #

The standard rock beat (or half of it) played on the DrumRack

primeBeat :: Beat a -> Beat a Source #

Force there to be only prime divisions of time in the rhythm. This is done without affecting the actual rhythm. This operation is not uniquely valued in any way, and this algorithm prefers small primes first.