Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellSafe-Inferred

Instrument.Inst

Contents

Description

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 score
  • Inst - 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

Inst

data Inst code Source #

Constructors

Inst 

Instances

Instances details
Show code => Show (Inst code) Source # 
Instance details

Defined in Instrument.Inst

Methods

showsPrec :: Int -> Inst code -> ShowS #

show :: Inst code -> String #

showList :: [Inst code] -> ShowS #

Pretty.Pretty code => Pretty.Pretty (Inst code) Source # 
Instance details

Defined in Instrument.Inst

Methods

pretty :: Inst code -> Text Source #

format :: Inst code -> Doc Source #

formatList :: [Inst code] -> Doc Source #

data Backend Source #

Constructors

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 

Instances

Instances details
Show Backend Source # 
Instance details

Defined in Instrument.Inst

Pretty.Pretty Backend Source # 
Instance details

Defined in Instrument.Inst

db

data Db code Source #

Instances

Instances details
Show code => Show (Db code) Source # 
Instance details

Defined in Instrument.Inst

Methods

showsPrec :: Int -> Db code -> ShowS #

show :: Db code -> String #

showList :: [Db code] -> ShowS #

Pretty.Pretty code => Pretty.Pretty (Db code) Source # 
Instance details

Defined in Instrument.Inst

Methods

pretty :: Db code -> Text Source #

format :: Db code -> Doc Source #

formatList :: [Db code] -> Doc Source #

data Synth code Source #

Constructors

Synth 

Fields

Instances

Instances details
Show code => Show (Synth code) Source # 
Instance details

Defined in Instrument.Inst

Methods

showsPrec :: Int -> Synth code -> ShowS #

show :: Synth code -> String #

showList :: [Synth code] -> ShowS #

Pretty.Pretty code => Pretty.Pretty (Synth code) Source # 
Instance details

Defined in Instrument.Inst

Methods

pretty :: Synth code -> Text Source #

format :: Synth code -> Doc Source #

formatList :: [Synth code] -> Doc Source #

empty :: Db code Source #

size :: Db code -> Int Source #

Number of Insts in the db.

synths :: Db code -> [(InstT.SynthName, Synth code)] Source #

lookup :: InstT.Qualified -> Db code -> Maybe (Inst code) Source #

data SynthDecl code Source #

Unchecked synth declaration. db will check it for duplicates and other problems. (name, doc, patches)

Constructors

SynthDecl !InstT.SynthName !Text ![(InstT.Name, Inst code)] 

Instances

Instances details
Show code => Show (SynthDecl code) Source # 
Instance details

Defined in Instrument.Inst

Methods

showsPrec :: Int -> SynthDecl code -> ShowS #

show :: SynthDecl code -> String #

showList :: [SynthDecl code] -> ShowS #

Pretty.Pretty code => Pretty.Pretty (SynthDecl code) Source # 
Instance details

Defined in Instrument.Inst

Methods

pretty :: SynthDecl code -> Text Source #

format :: SynthDecl code -> Doc Source #

formatList :: [SynthDecl code] -> Doc 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.