Safe Haskell | Safe-Inferred |
---|
This is called Inst because I already have way too many modules named Instrument and I couldn't think of anything better. TODO think of something better.
The hierarchy, from general to specific goes:
InstT.Qualified
- global name of an Inst, used to instantiate a ScoreTypes.Instrument.Instrument
- name an instance of an Inst within a scoreInst
- instrument encompassing all backends.- Patch - backend-specific instrument
Instrument configuration is divided into static (built-in to the instrument) and dynamic (configured per score).
Static configuration starts with Inst
, and is divided into Backend
specific and Common.Common
.
Dynamic configuration starts with Allocation
and is also
divided into Backend
specific and Common.Config
. When
a new allocation is created, the Midi.Patch.patch_defaults
are copied
to Midi.Patch.config_settings
.
Synopsis
- data Inst code = Inst {
- inst_backend :: !Backend
- inst_common :: !(Common.Common code)
- common :: Inst code :-> Common.Common code
- backend :: Inst code :-> Backend
- data Backend
- = Dummy !Text
- | Midi !Midi.Patch.Patch
- | Im !Im.Patch.Patch
- | Sc !Sc.Patch.Patch
- backend_name :: Backend -> Text
- inst_midi :: Inst code -> Maybe Midi.Patch.Patch
- inst_attributes :: Inst code -> [Attrs.Attributes]
- data Db code
- data Synth code = Synth {
- synth_doc :: !Text
- synth_insts :: !(Map InstT.Name (Inst code))
- empty :: Db code
- size :: Db code -> Int
- synth_names :: Db code -> [InstT.SynthName]
- synths :: Db code -> [(InstT.SynthName, Synth code)]
- lookup_synth :: InstT.SynthName -> Db code -> Maybe (Synth code)
- lookup :: InstT.Qualified -> Db code -> Maybe (Inst code)
- data SynthDecl code = SynthDecl !InstT.SynthName !Text ![(InstT.Name, Inst code)]
- db :: [SynthDecl code] -> (Db code, [Text])
- merge :: Db code -> Db code -> (Db code, [InstT.SynthName])
- annotate :: Map InstT.Qualified [Tag.Tag] -> Db code -> (Db code, [InstT.Qualified])
Inst
Inst | |
|
Instances
Show code => Show (Inst code) Source # | |
Pretty.Pretty code => Pretty.Pretty (Inst code) Source # | |
Dummy !Text | A Dummy instrument should be resolved to concrete instruments during derivation. It includes an error msg show if that doesn't happen. |
Midi !Midi.Patch.Patch | |
Im !Im.Patch.Patch | |
Sc !Sc.Patch.Patch |
backend_name :: Backend -> Text Source #
inst_attributes :: Inst code -> [Attrs.Attributes] Source #
db
Instances
Show code => Show (Db code) Source # | |
Pretty.Pretty code => Pretty.Pretty (Db code) Source # | |
Synth | |
|
Instances
Show code => Show (Synth code) Source # | |
Pretty.Pretty code => Pretty.Pretty (Synth code) Source # | |
synth_names :: Db code -> [InstT.SynthName] Source #
lookup_synth :: InstT.SynthName -> Db code -> Maybe (Synth code) Source #
Unchecked synth declaration. db
will check it for duplicates and other
problems. (name, doc, patches)
SynthDecl !InstT.SynthName !Text ![(InstT.Name, Inst code)] |
Instances
Show code => Show (SynthDecl code) Source # | |
Pretty.Pretty code => Pretty.Pretty (SynthDecl code) Source # | |
db :: [SynthDecl code] -> (Db code, [Text]) Source #
Construct and validate a Db, returning any errors that occurred.
merge :: Db code -> Db code -> (Db code, [InstT.SynthName]) Source #
Merge the Dbs, and return any duplicate synths.
annotate :: Map InstT.Qualified [Tag.Tag] -> Db code -> (Db code, [InstT.Qualified]) Source #