Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- silence :: Pattern a
- sig :: (Time -> a) -> Pattern a
- sine :: Fractional a => Pattern a
- sine2 :: Fractional a => Pattern a
- cosine :: Fractional a => Pattern a
- cosine2 :: Fractional a => Pattern a
- saw :: (Fractional a, Real a) => Pattern a
- saw2 :: (Fractional a, Real a) => Pattern a
- isaw :: (Fractional a, Real a) => Pattern a
- isaw2 :: (Fractional a, Real a) => Pattern a
- tri :: (Fractional a, Real a) => Pattern a
- tri2 :: (Fractional a, Real a) => Pattern a
- square :: Fractional a => Pattern a
- square2 :: Fractional a => Pattern a
- envL :: Pattern Double
- envLR :: Pattern Double
- envEq :: Pattern Double
- envEqR :: Pattern Double
- class Unionable a where
- union :: a -> a -> a
- (|+|) :: (Applicative a, Num b) => a b -> a b -> a b
- (|+) :: Num a => Pattern a -> Pattern a -> Pattern a
- (+|) :: Num a => Pattern a -> Pattern a -> Pattern a
- (|++|) :: Applicative a => a String -> a String -> a String
- (|++) :: Pattern String -> Pattern String -> Pattern String
- (++|) :: Pattern String -> Pattern String -> Pattern String
- (|/|) :: (Applicative a, Fractional b) => a b -> a b -> a b
- (|/) :: Fractional a => Pattern a -> Pattern a -> Pattern a
- (/|) :: Fractional a => Pattern a -> Pattern a -> Pattern a
- (|*|) :: (Applicative a, Num b) => a b -> a b -> a b
- (|*) :: Num a => Pattern a -> Pattern a -> Pattern a
- (*|) :: Num a => Pattern a -> Pattern a -> Pattern a
- (|-|) :: (Applicative a, Num b) => a b -> a b -> a b
- (|-) :: Num a => Pattern a -> Pattern a -> Pattern a
- (-|) :: Num a => Pattern a -> Pattern a -> Pattern a
- (|%|) :: (Applicative a, Moddable b) => a b -> a b -> a b
- (|%) :: Moddable a => Pattern a -> Pattern a -> Pattern a
- (%|) :: Moddable a => Pattern a -> Pattern a -> Pattern a
- (|**|) :: (Applicative a, Floating b) => a b -> a b -> a b
- (|**) :: Floating a => Pattern a -> Pattern a -> Pattern a
- (**|) :: Floating a => Pattern a -> Pattern a -> Pattern a
- (|>|) :: (Applicative a, Unionable b) => a b -> a b -> a b
- (|>) :: Unionable a => Pattern a -> Pattern a -> Pattern a
- (>|) :: Unionable a => Pattern a -> Pattern a -> Pattern a
- (|<|) :: (Applicative a, Unionable b) => a b -> a b -> a b
- (|<) :: Unionable a => Pattern a -> Pattern a -> Pattern a
- (<|) :: Unionable a => Pattern a -> Pattern a -> Pattern a
- (#) :: Unionable b => Pattern b -> Pattern b -> Pattern b
- fromList :: [a] -> Pattern a
- fastFromList :: [a] -> Pattern a
- listToPat :: [a] -> Pattern a
- fromMaybes :: [Maybe a] -> Pattern a
- run :: (Enum a, Num a) => Pattern a -> Pattern a
- _run :: (Enum a, Num a) => a -> Pattern a
- scan :: (Enum a, Num a) => Pattern a -> Pattern a
- _scan :: (Enum a, Num a) => a -> Pattern a
- append :: Pattern a -> Pattern a -> Pattern a
- cat :: [Pattern a] -> Pattern a
- slowCat :: [Pattern a] -> Pattern a
- slowcat :: [Pattern a] -> Pattern a
- slowAppend :: Pattern a -> Pattern a -> Pattern a
- slowappend :: Pattern a -> Pattern a -> Pattern a
- fastAppend :: Pattern a -> Pattern a -> Pattern a
- fastappend :: Pattern a -> Pattern a -> Pattern a
- fastCat :: [Pattern a] -> Pattern a
- fastcat :: [Pattern a] -> Pattern a
- timeCat :: [(Time, Pattern a)] -> Pattern a
- timecat :: [(Time, Pattern a)] -> Pattern a
- overlay :: Pattern a -> Pattern a -> Pattern a
- stack :: [Pattern a] -> Pattern a
- (<~) :: Pattern Time -> Pattern a -> Pattern a
- (~>) :: Pattern Time -> Pattern a -> Pattern a
- fast :: Pattern Time -> Pattern a -> Pattern a
- fastSqueeze :: Pattern Time -> Pattern a -> Pattern a
- density :: Pattern Time -> Pattern a -> Pattern a
- _fast :: Time -> Pattern a -> Pattern a
- slow :: Pattern Time -> Pattern a -> Pattern a
- _slow :: Time -> Pattern a -> Pattern a
- slowSqueeze :: Pattern Time -> Pattern a -> Pattern a
- sparsity :: Pattern Time -> Pattern a -> Pattern a
- rev :: Pattern a -> Pattern a
- zoom :: (Time, Time) -> Pattern a -> Pattern a
- zoomArc :: Arc -> Pattern a -> Pattern a
- fastGap :: Pattern Time -> Pattern a -> Pattern a
- densityGap :: Pattern Time -> Pattern a -> Pattern a
- compress :: (Time, Time) -> Pattern a -> Pattern a
- compressTo :: (Time, Time) -> Pattern a -> Pattern a
- repeatCycles :: Pattern Int -> Pattern a -> Pattern a
- _repeatCycles :: Int -> Pattern a -> Pattern a
- fastRepeatCycles :: Int -> Pattern a -> Pattern a
- every :: Pattern Int -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
- _every :: Int -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
- every' :: Pattern Int -> Pattern Int -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
- _every' :: Int -> Int -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
- foldEvery :: [Int] -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
- when :: (Int -> Bool) -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
- whenT :: (Time -> Bool) -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
- _getP_ :: (Value -> Maybe a) -> Pattern Value -> Pattern a
- _getP :: a -> (Value -> Maybe a) -> Pattern Value -> Pattern a
- _cX :: a -> (Value -> Maybe a) -> String -> Pattern a
- _cX_ :: (Value -> Maybe a) -> String -> Pattern a
- cF :: Double -> String -> Pattern Double
- cF_ :: String -> Pattern Double
- cF0 :: String -> Pattern Double
- cN :: Note -> String -> Pattern Note
- cN_ :: String -> Pattern Note
- cN0 :: String -> Pattern Note
- cI :: Int -> String -> Pattern Int
- cI_ :: String -> Pattern Int
- cI0 :: String -> Pattern Int
- cB :: Bool -> String -> Pattern Bool
- cB_ :: String -> Pattern Bool
- cB0 :: String -> Pattern Bool
- cR :: Rational -> String -> Pattern Rational
- cR_ :: String -> Pattern Rational
- cR0 :: String -> Pattern Rational
- cT :: Time -> String -> Pattern Time
- cT0 :: String -> Pattern Time
- cT_ :: String -> Pattern Time
- cS :: String -> String -> Pattern String
- cS_ :: String -> Pattern String
- cS0 :: String -> Pattern String
- in0 :: Pattern Double
- in1 :: Pattern Double
- in2 :: Pattern Double
- in3 :: Pattern Double
- in4 :: Pattern Double
- in5 :: Pattern Double
- in6 :: Pattern Double
- in7 :: Pattern Double
- in8 :: Pattern Double
- in9 :: Pattern Double
- in10 :: Pattern Double
- in11 :: Pattern Double
- in12 :: Pattern Double
- in13 :: Pattern Double
- in14 :: Pattern Double
- in15 :: Pattern Double
- in16 :: Pattern Double
- in17 :: Pattern Double
- in18 :: Pattern Double
- in19 :: Pattern Double
- in20 :: Pattern Double
- in21 :: Pattern Double
- in22 :: Pattern Double
- in23 :: Pattern Double
- in24 :: Pattern Double
- in25 :: Pattern Double
- in26 :: Pattern Double
- in27 :: Pattern Double
- in28 :: Pattern Double
- in29 :: Pattern Double
- in30 :: Pattern Double
- in31 :: Pattern Double
- in32 :: Pattern Double
- in33 :: Pattern Double
- in34 :: Pattern Double
- in35 :: Pattern Double
- in36 :: Pattern Double
- in37 :: Pattern Double
- in38 :: Pattern Double
- in39 :: Pattern Double
- in40 :: Pattern Double
- in41 :: Pattern Double
- in42 :: Pattern Double
- in43 :: Pattern Double
- in44 :: Pattern Double
- in45 :: Pattern Double
- in46 :: Pattern Double
- in47 :: Pattern Double
- in48 :: Pattern Double
- in49 :: Pattern Double
- in50 :: Pattern Double
- in51 :: Pattern Double
- in52 :: Pattern Double
- in53 :: Pattern Double
- in54 :: Pattern Double
- in55 :: Pattern Double
- in56 :: Pattern Double
- in57 :: Pattern Double
- in58 :: Pattern Double
- in59 :: Pattern Double
- in60 :: Pattern Double
- in61 :: Pattern Double
- in62 :: Pattern Double
- in63 :: Pattern Double
- in64 :: Pattern Double
- in65 :: Pattern Double
- in66 :: Pattern Double
- in67 :: Pattern Double
- in68 :: Pattern Double
- in69 :: Pattern Double
- in70 :: Pattern Double
- in71 :: Pattern Double
- in72 :: Pattern Double
- in73 :: Pattern Double
- in74 :: Pattern Double
- in75 :: Pattern Double
- in76 :: Pattern Double
- in77 :: Pattern Double
- in78 :: Pattern Double
- in79 :: Pattern Double
- in80 :: Pattern Double
- in81 :: Pattern Double
- in82 :: Pattern Double
- in83 :: Pattern Double
- in84 :: Pattern Double
- in85 :: Pattern Double
- in86 :: Pattern Double
- in87 :: Pattern Double
- in88 :: Pattern Double
- in89 :: Pattern Double
- in90 :: Pattern Double
- in91 :: Pattern Double
- in92 :: Pattern Double
- in93 :: Pattern Double
- in94 :: Pattern Double
- in95 :: Pattern Double
- in96 :: Pattern Double
- in97 :: Pattern Double
- in98 :: Pattern Double
- in99 :: Pattern Double
- in100 :: Pattern Double
- in101 :: Pattern Double
- in102 :: Pattern Double
- in103 :: Pattern Double
- in104 :: Pattern Double
- in105 :: Pattern Double
- in106 :: Pattern Double
- in107 :: Pattern Double
- in108 :: Pattern Double
- in109 :: Pattern Double
- in110 :: Pattern Double
- in111 :: Pattern Double
- in112 :: Pattern Double
- in113 :: Pattern Double
- in114 :: Pattern Double
- in115 :: Pattern Double
- in116 :: Pattern Double
- in117 :: Pattern Double
- in118 :: Pattern Double
- in119 :: Pattern Double
- in120 :: Pattern Double
- in121 :: Pattern Double
- in122 :: Pattern Double
- in123 :: Pattern Double
- in124 :: Pattern Double
- in125 :: Pattern Double
- in126 :: Pattern Double
- in127 :: Pattern Double
Elemental patterns
sig :: (Time -> a) -> Pattern a Source #
Takes a function from time to values, and turns it into a Pattern
.
sine :: Fractional a => Pattern a Source #
sine
- unipolar sinewave. A pattern of continuous values following a
sinewave with frequency of one cycle, and amplitude from 0 to 1.
sine2 :: Fractional a => Pattern a Source #
sine2
- bipolar sinewave. A pattern of continuous values following a
sinewave with frequency of one cycle, and amplitude from -1 to 1.
cosine :: Fractional a => Pattern a Source #
cosine
- unipolar cosine wave. A pattern of continuous values
following a cosine with frequency of one cycle, and amplitude from
0 to 1. Equivalent to `0.25 ~> sine`.
cosine2 :: Fractional a => Pattern a Source #
cosine2
- bipolar cosine wave. A pattern of continuous values
following a cosine with frequency of one cycle, and amplitude from
-1 to 1. Equivalent to `0.25 ~> sine2`.
saw :: (Fractional a, Real a) => Pattern a Source #
saw
- unipolar ascending sawtooth wave. A pattern of continuous values
following a sawtooth with frequency of one cycle, and amplitude from
0 to 1.
saw2 :: (Fractional a, Real a) => Pattern a Source #
saw2
- bipolar ascending sawtooth wave. A pattern of continuous values
following a sawtooth with frequency of one cycle, and amplitude from
-1 to 1.
isaw :: (Fractional a, Real a) => Pattern a Source #
isaw
like saw
, but a descending (inverse) sawtooth.
isaw2 :: (Fractional a, Real a) => Pattern a Source #
isaw2
like saw2
, but a descending (inverse) sawtooth.
tri :: (Fractional a, Real a) => Pattern a Source #
tri
- unipolar triangle wave. A pattern of continuous values
following a triangle wave with frequency of one cycle, and amplitude from
0 to 1.
tri2 :: (Fractional a, Real a) => Pattern a Source #
tri2
- bipolar triangle wave. A pattern of continuous values
following a triangle wave with frequency of one cycle, and amplitude from
-1 to 1.
square :: Fractional a => Pattern a Source #
square
- unipolar square wave. A pattern of continuous values
following a square wave with frequency of one cycle, and amplitude from
0 to 1.
| square
is like sine
, for square waves.
square2 :: Fractional a => Pattern a Source #
square2
- bipolar square wave. A pattern of continuous values
following a square wave with frequency of one cycle, and amplitude from
-1 to 1.
Pattern algebra
(|+|) :: (Applicative a, Num b) => a b -> a b -> a b Source #
(|/|) :: (Applicative a, Fractional b) => a b -> a b -> a b Source #
(|*|) :: (Applicative a, Num b) => a b -> a b -> a b Source #
(|-|) :: (Applicative a, Num b) => a b -> a b -> a b Source #
(|%|) :: (Applicative a, Moddable b) => a b -> a b -> a b Source #
(|**|) :: (Applicative a, Floating b) => a b -> a b -> a b Source #
(|>|) :: (Applicative a, Unionable b) => a b -> a b -> a b Source #
(|<|) :: (Applicative a, Unionable b) => a b -> a b -> a b Source #
Constructing patterns
fromList :: [a] -> Pattern a Source #
Turns a list of values into a pattern, playing one of them per cycle.
fastFromList :: [a] -> Pattern a Source #
Turns a list of values into a pattern, playing all of them per cycle.
listToPat :: [a] -> Pattern a Source #
A synonym for fastFromList
fromMaybes :: [Maybe a] -> Pattern a Source #
run :: (Enum a, Num a) => Pattern a -> Pattern a Source #
A pattern of whole numbers from 0 to the given number, in a single cycle.
scan :: (Enum a, Num a) => Pattern a -> Pattern a Source #
From 1
for the first cycle, successively adds a number until it gets up to n
Combining patterns
append :: Pattern a -> Pattern a -> Pattern a Source #
Alternate between cycles of the two given patterns
cat :: [Pattern a] -> Pattern a Source #
Like append
, but for a list of patterns. Interlaces them, playing the first cycle from each
in turn, then the second cycle from each, and so on.
fastCat :: [Pattern a] -> Pattern a Source #
The same as cat
, but speeds up the result by the number of
patterns there are, so the cycles from each are squashed to fit a
single cycle.
timeCat :: [(Time, Pattern a)] -> Pattern a Source #
Similar to fastCat
, but each pattern is given a relative duration
Manipulating time
(<~) :: Pattern Time -> Pattern a -> Pattern a Source #
Shifts a pattern back in time by the given amount, expressed in cycles
(~>) :: Pattern Time -> Pattern a -> Pattern a Source #
Shifts a pattern forward in time by the given amount, expressed in cycles
fastSqueeze :: Pattern Time -> Pattern a -> Pattern a Source #
Slow down a pattern by the factors in the given time pattern, squeezing
the pattern to fit the slot given in the time pattern
slow :: Pattern Time -> Pattern a -> Pattern a Source #
Slow down a pattern by the given time pattern
slowSqueeze :: Pattern Time -> Pattern a -> Pattern a Source #
Slow down a pattern by the factors in the given time pattern, squeezing
the pattern to fit the slot given in the time pattern
rev :: Pattern a -> Pattern a Source #
rev p
returns p
with the event positions in each cycle
reversed (or mirrored).
zoom :: (Time, Time) -> Pattern a -> Pattern a Source #
Plays a portion of a pattern, specified by a time arc (start and end time). The new resulting pattern is played over the time period of the original pattern:
d1 $ zoom (0.25, 0.75) $ sound "bd*2 hh*3 [sn bd]*2 drum"
In the pattern above, zoom
is used with an arc from 25% to 75%. It is equivalent to this pattern:
d1 $ sound "hh*3 [sn bd]*2"
fastGap :: Pattern Time -> Pattern a -> Pattern a Source #
fastGap
is similar to fast
but maintains its cyclic
alignment. For example, fastGap 2 p
would squash the events in
pattern p
into the first half of each cycle (and the second
halves would be empty). The factor should be at least 1
every :: Pattern Int -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a Source #
- Higher order functions
Functions which work on other functions (higher order functions)
every n f p
applies the function f
to p
, but only affects
every n
cycles.
every' :: Pattern Int -> Pattern Int -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a Source #
every n o f'
is like every n f
with an offset of o
cycles
foldEvery :: [Int] -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a Source #
foldEvery ns f p
applies the function f
to p
, and is applied for
each cycle in ns
.
when :: (Int -> Bool) -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a Source #
Only when
the given test function returns True
the given pattern
transformation is applied. The test function will be called with the
current cycle as a number.
d1 $ when ((elem '4').show) (striate 4) $ sound "hh hc"
The above will only apply `striate 4` to the pattern if the current cycle number contains the number 4. So the fourth cycle will be striated and the fourteenth and so on. Expect lots of striates after cycle number 399.