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

Derive.Instrument.DUtil

Description

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.

Synopsis

Documentation

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.

Constructors

Before 
After 

Instances

Instances details
Show Placement Source # 
Instance details

Defined in Derive.Instrument.DUtil

Eq Placement Source # 
Instance details

Defined in Derive.Instrument.DUtil

composite

data Composite Source #

A composite patch corresponds to multiple underlying 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.

Constructors

Composite 

Fields

Instances

Instances details
Show Composite Source # 
Instance details

Defined in Derive.Instrument.DUtil

Pretty Composite Source # 
Instance details

Defined in Derive.Instrument.DUtil

data Pitch Source #

Instances

Instances details
Show Pitch Source # 
Instance details

Defined in Derive.Instrument.DUtil

Methods

showsPrec :: Int -> Pitch -> ShowS #

show :: Pitch -> String #

showList :: [Pitch] -> ShowS #

type Controls = Set ScoreT.Control Source #

Assigning a control to a composite actually means the other composite parts will *not* get it. This is because derivers naturally inherit the entire environment, and it seems better to list what it should have, and not exhaustively list all it gets.

So if this is empty it gets all controls, and if it's not, it still gets the named controls but other composites don't.

control vals

postproc

move_val :: (Typecheck.Typecheck old, Typecheck.ToVal new) => EnvKey.Key -> EnvKey.Key -> (old -> Either Log.Msg new) -> Cmd.InstrumentPostproc 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.