tidal-0.9.6: Pattern language for improvised music

Safe HaskellNone
LanguageHaskell2010

Sound.Tidal.Sieve

Synopsis

Documentation

data Sieve a Source #

Constructors

Sieve 

Fields

Instances

Functor Sieve Source # 

Methods

fmap :: (a -> b) -> Sieve a -> Sieve b #

(<$) :: a -> Sieve b -> Sieve a #

Applicative Sieve Source # 

Methods

pure :: a -> Sieve a #

(<*>) :: Sieve (a -> b) -> Sieve a -> Sieve b #

(*>) :: Sieve a -> Sieve b -> Sieve b #

(<*) :: Sieve a -> Sieve b -> Sieve a #

Show (Sieve Bool) Source # 

(@@) :: Int -> Int -> Sieve Bool infixl 9 Source #

The basic notation for and constructor of a boolean Sieve is m@@n, which represents all integers whose modulo with m is equal to n

not' :: Applicative f => f Bool -> f Bool Source #

not' gives the complement of a sieve

(#||#) :: Applicative f => f Bool -> f Bool -> f Bool infixl 2 Source #

gives the union (logical OR) of two sieves

(#&&#) :: Applicative f => f Bool -> f Bool -> f Bool infixl 3 Source #

gives the intersection (logical AND) of two sieves

(#^^#) :: Applicative f => f Bool -> f Bool -> f Bool infixl 2 Source #

#^^# gives the exclusive disjunction (logical XOR) of two sieves

sieveToList :: Int -> Sieve a -> [a] Source #

sieveToList n returns a list of the values of the sieve for each nonnegative integer less than n For example: sieveToList 10 $ 3@@1 returns `[False, True, False, False, True, False, False, True, False, False]`

sieveToString :: Int -> Sieve Bool -> [Char] Source #

sieveToString n represents the sieve as a character string, where - represents False and x represents True

sieveToInts :: Int -> Sieve Bool -> [Int] Source #

sieveToInts n returns a list of nonnegative integers less than n where the sieve is True

sieveToPat :: Int -> Sieve Bool -> Pattern String Source #

sieveToPat n returns a pattern where the cycle is divided into n beats, and there is an event whenever the matching beat number is in the sieve For example: sieveToPat 8 $ 3@@1 returns "~ x ~ ~ x ~ ~ x"

stepSieve :: Int -> String -> Sieve Bool -> Pattern String Source #

stepSieve n str works like sieveToPat but uses str in the pattern instead of x

slowstepSieve :: Pattern Time -> Int -> String -> Sieve Bool -> Pattern String Source #

slowstepSieve t is shorthand for applying slow t to the result of stepSieve

scaleSieve :: Int -> Sieve Bool -> Pattern Int -> Pattern Int Source #

scaleSieve n uses sieveToInts to turn a sieve into a list of integers, and then uses that with the toScale function to turn a pattern of numbers into a pattern of notes in the scale. For example: scaleSieve 8 (3@@1) "0 1 2 1" first converts the sieve to the scale [1, 4, 7] and then uses that with toScale to return the pattern "1 4 7 4"