Safe Haskell | Safe-Inferred |
---|
This contains instrument data in common between different backends.
Synopsis
- data Common code = Common {
- common_code :: !code
- common_environ :: !REnv.Environ
- common_tags :: ![Tag.Tag]
- common_doc :: !Doc.Doc
- common_flags :: !(Set Flag)
- common_call_map :: !CallMap
- code :: Common code :-> code
- environ :: Common code :-> REnv.Environ
- tags :: Common code :-> [Tag.Tag]
- doc :: Common code :-> Doc.Doc
- flags :: Common code :-> Set Flag
- call_map :: Common code :-> CallMap
- type CallMap = Map Attrs.Attributes Expr.Symbol
- common :: code -> Common code
- data Flag = Triggered
- add_environ :: REnv.ToVal a => EnvKey.Key -> a -> Common code -> Common code
- newtype AttributeMap a = AttributeMap [(Attrs.Attributes, a)]
- attribute_map :: [(Attrs.Attributes, a)] -> AttributeMap a
- mapped_attributes :: AttributeMap a -> [Attrs.Attributes]
- attribute_vals :: AttributeMap a -> [a]
- lookup_attributes :: Attrs.Attributes -> AttributeMap a -> Maybe.Maybe (Attrs.Attributes, a)
- overlapping_attributes :: AttributeMap a -> [Text]
- sort_attributes :: [(Attrs.Attributes, a)] -> [(Attrs.Attributes, a)]
- data Config = Config {}
- empty_config :: Config
- cenviron :: Config :-> REnv.Environ
- controls :: Config :-> ScoreT.ControlValMap
- mute :: Config :-> Bool
- solo :: Config :-> Bool
- add_cenviron :: REnv.ToVal a => EnvKey.Key -> a -> Config -> Config
Documentation
Attributes common to all instruments. Unlike Config
, these are
part of the instrument itself and not configurable.
Common | |
|
type CallMap = Map Attrs.Attributes Expr.Symbol Source #
Map attributes to the names of the calls they should map to. This is used by the integrator to turn score events into UI events.
Triggered | Patch doesn't pay attention to duration, e.g. percussion. The UI can use this to create zero duration events for this instrument. |
add_environ :: REnv.ToVal a => EnvKey.Key -> a -> Common code -> Common code Source #
AttributeMap
newtype AttributeMap a Source #
This determines what Attributes the instrument can respond to. Each set of Attributes is mapped to a backend-specific value. The attributes are matched by subset in order, so their order gives a priority.
For example, if +pizz
is before +nv
, then +pizz+nv
will map to
+pizz
, unless +pizz+nv
exists. The idea is that more specific or
more perceptually important attributes go first. Since pizz vs. arco
is a much more obvious distinction than vibrato vs. nv, if you say
everything is nv but some notes are also pizz, chances are you want those
notes to get pizz even if there isn't a specifically nv pizz variant.
This also means that if a previous attr is a subset of a later one, the
later one will never be selected. overlapping_attributes
will check for
that, but normally you use a constructor that calls sort_attributes
to
make sure that can't happen.
AttributeMap [(Attrs.Attributes, a)] |
Instances
attribute_map :: [(Attrs.Attributes, a)] -> AttributeMap a Source #
mapped_attributes :: AttributeMap a -> [Attrs.Attributes] Source #
attribute_vals :: AttributeMap a -> [a] Source #
lookup_attributes :: Attrs.Attributes -> AttributeMap a -> Maybe.Maybe (Attrs.Attributes, a) Source #
Look up the value as described in AttributeMap
.
overlapping_attributes :: AttributeMap a -> [Text] Source #
Figured out if any attributes shadow other attributes. I think this
shouldn't happen if you called sort_attributes
, or used any of the
constructors other than AttributeMap
.
sort_attributes :: [(Attrs.Attributes, a)] -> [(Attrs.Attributes, a)] Source #
lookup_attributes
looks for the first subset, which means that a smaller
set of attributes can shadow a larger set. Since it's annoying to have to
worry about order, sort larger sets to the back.
The sort is stable, so it shouldn't destroy the priority implicit in the order.
Config
Configuration for a specific allocation of an instrument in a specific score.
Config | |
|
add_cenviron :: REnv.ToVal a => EnvKey.Key -> a -> Config -> Config Source #