tidal-1.9.2: Pattern language for improvised music
Safe HaskellSafe-Inferred
LanguageHaskell2010

Sound.Tidal.ParseBP

Synopsis

Documentation

data TidalParseError Source #

Constructors

TidalParseError 

Fields

Instances

Instances details
Exception TidalParseError Source # 
Instance details

Defined in Sound.Tidal.ParseBP

Methods

toException :: TidalParseError -> SomeException

fromException :: SomeException -> Maybe TidalParseError

displayException :: TidalParseError -> String

Show TidalParseError Source # 
Instance details

Defined in Sound.Tidal.ParseBP

Methods

showsPrec :: Int -> TidalParseError -> ShowS

show :: TidalParseError -> String #

showList :: [TidalParseError] -> ShowS

Eq TidalParseError Source # 
Instance details

Defined in Sound.Tidal.ParseBP

type MyParser = Parsec String Int Source #

data TPat a where Source #

AST representation of patterns

Constructors

TPat_Atom :: Maybe ((Int, Int), (Int, Int)) -> a -> TPat a 
TPat_Fast :: TPat Time -> TPat a -> TPat a 
TPat_Slow :: TPat Time -> TPat a -> TPat a 
TPat_DegradeBy :: Int -> Double -> TPat a -> TPat a 
TPat_CycleChoose :: Int -> [TPat a] -> TPat a 
TPat_Euclid :: TPat Int -> TPat Int -> TPat Int -> TPat a -> TPat a 
TPat_Stack :: [TPat a] -> TPat a 
TPat_Polyrhythm :: Maybe (TPat Rational) -> [TPat a] -> TPat a 
TPat_Seq :: [TPat a] -> TPat a 
TPat_Silence :: TPat a 
TPat_Foot :: TPat a 
TPat_Elongate :: Rational -> TPat a -> TPat a 
TPat_Repeat :: Int -> TPat a -> TPat a 
TPat_EnumFromTo :: TPat a -> TPat a -> TPat a 
TPat_Var :: String -> TPat a 
TPat_Chord :: (Num b, Enum b, Parseable b, Enumerable b) => (b -> a) -> TPat b -> TPat String -> [TPat [Modifier]] -> TPat a 

Instances

Instances details
Functor TPat Source # 
Instance details

Defined in Sound.Tidal.ParseBP

Methods

fmap :: (a -> b) -> TPat a -> TPat b

(<$) :: a -> TPat b -> TPat a

Show a => Show (TPat a) Source # 
Instance details

Defined in Sound.Tidal.ParseBP

Methods

showsPrec :: Int -> TPat a -> ShowS

show :: TPat a -> String #

showList :: [TPat a] -> ShowS

tShowList :: Show a => [TPat a] -> String Source #

tShow :: Show a => TPat a -> String Source #

resolve_tpat :: (Enumerable a, Parseable a) => TPat a -> (Rational, Pattern a) Source #

resolve_seq :: (Enumerable a, Parseable a) => [TPat a] -> (Rational, Pattern a) Source #

resolve_size :: [TPat a] -> [(Rational, TPat a)] Source #

steps_tpat :: Show a => TPat a -> (Rational, String) Source #

steps_seq :: Show a => [TPat a] -> (Rational, String) Source #

steps_size :: Show a => [TPat a] -> [(Rational, String)] Source #

parseBP :: (Enumerable a, Parseable a) => String -> Either ParseError (Pattern a) Source #

parseBP_E :: (Enumerable a, Parseable a) => String -> Pattern a Source #

parseTPat :: Parseable a => String -> Either ParseError (TPat a) Source #

cP :: (Enumerable a, Parseable a) => String -> Pattern a Source #

class Parseable a where Source #

Minimal complete definition

tPatParser, doEuclid

Methods

tPatParser :: MyParser (TPat a) Source #

doEuclid :: Pattern Int -> Pattern Int -> Pattern Int -> Pattern a -> Pattern a Source #

getControl :: String -> Pattern a Source #

Instances

Instances details
Parseable Rational Source # 
Instance details

Defined in Sound.Tidal.ParseBP

Methods

tPatParser :: MyParser (TPat Rational) Source #

doEuclid :: Pattern Int -> Pattern Int -> Pattern Int -> Pattern Rational -> Pattern Rational Source #

getControl :: String -> Pattern Rational Source #

Parseable ColourD Source # 
Instance details

Defined in Sound.Tidal.ParseBP

Parseable Note Source # 
Instance details

Defined in Sound.Tidal.ParseBP

Parseable String Source # 
Instance details

Defined in Sound.Tidal.ParseBP

Methods

tPatParser :: MyParser (TPat String) Source #

doEuclid :: Pattern Int -> Pattern Int -> Pattern Int -> Pattern String -> Pattern String Source #

getControl :: String -> Pattern String Source #

Parseable Integer Source # 
Instance details

Defined in Sound.Tidal.ParseBP

Methods

tPatParser :: MyParser (TPat Integer) Source #

doEuclid :: Pattern Int -> Pattern Int -> Pattern Int -> Pattern Integer -> Pattern Integer Source #

getControl :: String -> Pattern Integer Source #

Parseable Bool Source # 
Instance details

Defined in Sound.Tidal.ParseBP

Methods

tPatParser :: MyParser (TPat Bool) Source #

doEuclid :: Pattern Int -> Pattern Int -> Pattern Int -> Pattern Bool -> Pattern Bool Source #

getControl :: String -> Pattern Bool Source #

Parseable Char Source # 
Instance details

Defined in Sound.Tidal.ParseBP

Methods

tPatParser :: MyParser (TPat Char) Source #

doEuclid :: Pattern Int -> Pattern Int -> Pattern Int -> Pattern Char -> Pattern Char Source #

getControl :: String -> Pattern Char Source #

Parseable Double Source # 
Instance details

Defined in Sound.Tidal.ParseBP

Methods

tPatParser :: MyParser (TPat Double) Source #

doEuclid :: Pattern Int -> Pattern Int -> Pattern Int -> Pattern Double -> Pattern Double Source #

getControl :: String -> Pattern Double Source #

Parseable Int Source # 
Instance details

Defined in Sound.Tidal.ParseBP

Methods

tPatParser :: MyParser (TPat Int) Source #

doEuclid :: Pattern Int -> Pattern Int -> Pattern Int -> Pattern Int -> Pattern Int Source #

getControl :: String -> Pattern Int Source #

Parseable [Modifier] Source # 
Instance details

Defined in Sound.Tidal.ParseBP

class Enumerable a where Source #

Methods

fromTo :: a -> a -> Pattern a Source #

fromThenTo :: a -> a -> a -> Pattern a Source #

Instances

Instances details
Enumerable Rational Source # 
Instance details

Defined in Sound.Tidal.ParseBP

Methods

fromTo :: Rational -> Rational -> Pattern Rational Source #

fromThenTo :: Rational -> Rational -> Rational -> Pattern Rational Source #

Enumerable ColourD Source # 
Instance details

Defined in Sound.Tidal.ParseBP

Enumerable Note Source # 
Instance details

Defined in Sound.Tidal.ParseBP

Enumerable String Source # 
Instance details

Defined in Sound.Tidal.ParseBP

Methods

fromTo :: String -> String -> Pattern String Source #

fromThenTo :: String -> String -> String -> Pattern String Source #

Enumerable Integer Source # 
Instance details

Defined in Sound.Tidal.ParseBP

Methods

fromTo :: Integer -> Integer -> Pattern Integer Source #

fromThenTo :: Integer -> Integer -> Integer -> Pattern Integer Source #

Enumerable Bool Source # 
Instance details

Defined in Sound.Tidal.ParseBP

Methods

fromTo :: Bool -> Bool -> Pattern Bool Source #

fromThenTo :: Bool -> Bool -> Bool -> Pattern Bool Source #

Enumerable Char Source # 
Instance details

Defined in Sound.Tidal.ParseBP

Methods

fromTo :: Char -> Char -> Pattern Char Source #

fromThenTo :: Char -> Char -> Char -> Pattern Char Source #

Enumerable Double Source # 
Instance details

Defined in Sound.Tidal.ParseBP

Methods

fromTo :: Double -> Double -> Pattern Double Source #

fromThenTo :: Double -> Double -> Double -> Pattern Double Source #

Enumerable Int Source # 
Instance details

Defined in Sound.Tidal.ParseBP

Methods

fromTo :: Int -> Int -> Pattern Int Source #

fromThenTo :: Int -> Int -> Int -> Pattern Int Source #

Enumerable [Modifier] Source # 
Instance details

Defined in Sound.Tidal.ParseBP

enumFromTo' :: (Ord a, Enum a) => a -> a -> Pattern a Source #

enumFromThenTo' :: (Ord a, Enum a, Num a) => a -> a -> a -> Pattern a Source #

type ColourD = Colour Double Source #

lexer :: GenTokenParser String u Identity Source #

symbol :: String -> MyParser String Source #

naturalOrFloat :: MyParser (Either Integer Double) Source #

data Sign Source #

Constructors

Positive 
Negative 

applySign :: Num a => Sign -> a -> a Source #

parseIntNote :: Integral i => MyParser i Source #

pIntegral :: (Integral a, Parseable a, Enumerable a) => MyParser (TPat a) Source #

parseChord :: (Enum a, Num a) => MyParser [a] Source #

parseNote :: Num a => MyParser a Source #

fromNote :: Num a => Pattern String -> Pattern a Source #

pE :: TPat a -> MyParser (TPat a) Source #

pRatio :: MyParser Rational Source #

pFraction :: RealFrac a => a -> MyParser Rational Source #

pRatioChar :: Fractional a => MyParser a Source #

pRatioSingleChar :: Fractional a => Char -> a -> MyParser a Source #

isInt :: RealFrac a => a -> Bool Source #

pChord :: (Enum a, Num a, Parseable a, Enumerable a) => TPat a -> MyParser (TPat a) Source #

Orphan instances

(Enumerable a, Parseable a) => IsString (Pattern a) Source # 
Instance details

Methods

fromString :: String -> Pattern a