Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type Weight = Double
- data Grammar meta a = Grammar {}
- data Rule meta a = (Head a) :-> (Body meta a)
- type Head a = (a, Weight, Activation)
- type Activation = Duration -> Bool
- type Body meta a = Duration -> Term meta a
- data Term meta a
- class Expand input a meta b | input a meta -> b where
- type Grammarly input a meta b = (Show a, Show meta, Eq a, Eq meta, Expand input a meta b)
- runGrammar :: Grammarly input a meta b => Grammar meta a -> Duration -> input -> IO (Music b)
- always :: Activation
- (/\) :: Activation -> Activation -> Activation
- (\/) :: Activation -> Activation -> Activation
- (|:) :: a -> [Rule meta a] -> Grammar meta a
- (-|) :: a -> Weight -> Rule meta a
- (-||) :: (a, Weight) -> Activation -> Rule meta a
- ($:) :: meta -> Term meta a -> Term meta a
- (|$:) :: meta -> Term meta a -> Term meta a
- (|->) :: Head a -> Term meta a -> Rule meta a
Documentation
type Head a = (a, Weight, Activation) Source #
type Activation = Duration -> Bool Source #
class Expand input a meta b | input a meta -> b where Source #
Any metadata-carrying grammar term must be expanded to a stripped-down
grammar term with no metadata (i.e. `Term a ()`), possibly producing terms of
a different type b
.
Expand input a () a Source # | A term with no auxiliary wrappers can be trivially expanded. |
Expand HarmonyConfig Degree Modulation SemiChord Source # | Expands modulations and intreprets degrees to chords. |
runGrammar :: Grammarly input a meta b => Grammar meta a -> Duration -> input -> IO (Music b) Source #
Run a grammar with the given initial symbol.
always :: Activation Source #
Rule which always activates.
(/\) :: Activation -> Activation -> Activation Source #
Conjunction of activation functions.
(\/) :: Activation -> Activation -> Activation Source #
Disjunction of activation functions.