Karya, built on 2018-05-31T02:46:59 (patch 0a1a35479c514820d77330ae8a978975ba22a47a)

Safe HaskellNone




Functions for instrument cmds. This is called DUtil because there is also Cmd.Instrument.CUtil and they are usually imported together.

I need a better name than "Util" for everything.



attributes_note :: Attrs.Attributes -> Generator Note Source #

Make a call that simply calls the default note call with the given attrs.

zero_duration :: CallName -> Doc.Doc -> (NoteArgs -> NoteDeriver) -> (NoteArgs -> NoteDeriver) -> Generator Note Source #

Create a generator that has a different implementation for zero and non-zero duration.

postproc_note :: CallName -> Doc.Doc -> (Score.Event -> Score.Event) -> Generator Note Source #

Just like the default note call, except apply a function to the output.

postproc_generator :: CallName -> Doc.Doc -> Generator d -> (Deriver (Stream.Stream d) -> Deriver (Stream.Stream d)) -> Generator d Source #

Transform an existing call by applying a function to it. It gets a new name and the documentation is prepended to the documentation of the original call.

multiple_call :: CallName -> [Expr.Symbol] -> Generator Note Source #

Create a call that just dispatches to other calls.

data Placement Source #

The grace note falls either before or after the beat.


Eq Placement # 
Instance details

Defined in Derive.Instrument.DUtil

Show Placement # 
Instance details

Defined in Derive.Instrument.DUtil


data Composite Source #

A composite patch corresponds to multiple underlying MIDI patches.

This is useful for instruments with multiple pitches, e.g. a drum with a keymap for strokes as well as a tuned pitch, or a pitched instrument with a secondary pitch as a resonance.




Show Composite # 
Instance details

Defined in Derive.Instrument.DUtil

Pretty Composite # 
Instance details

Defined in Derive.Instrument.DUtil

data Pitch Source #

Show Pitch # 
Instance details

Defined in Derive.Instrument.DUtil


showsPrec :: Int -> Pitch -> ShowS #

show :: Pitch -> String #

showList :: [Pitch] -> ShowS #

type Controls = Maybe (Set Score.Control) Source #

If Nothing, then this Composite gets all the controls that are not given to other instruments. Otherwise, it only gets the named ones.

control vals


move_val :: (Typecheck.Typecheck old, Typecheck.ToVal new) => EnvKey.Key -> EnvKey.Key -> (old -> Either Log.Msg new) -> Score.Event -> (Score.Event, [Log.Msg]) Source #

Move an environ val from one key to another. This is meant to be put in inst_postproc, because doing it in the note call may be too early.

default_controls :: [(Score.Control, Signal.Y)] -> Cmd.InstrumentPostproc Source #

Set a default value on controls which are not already explicitly set.