Karya, built on 2020-11-26T21:03:17 (patch 23b5be2d53a9e8e7d6136cda5aae2849abe5cded)
Safe HaskellNone

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
Eq Placement # 
Instance details

Defined in Derive.Instrument.DUtil

Show Placement # 
Instance details

Defined in Derive.Instrument.DUtil

composite

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.

Constructors

Composite 

Fields

Instances

Instances details
Show Composite # 
Instance details

Defined in Derive.Instrument.DUtil

Pretty Composite # 
Instance details

Defined in Derive.Instrument.DUtil

data Pitch Source #

Instances

Instances details
Show Pitch # 
Instance details

Defined in Derive.Instrument.DUtil

Methods

showsPrec :: Int -> Pitch -> ShowS #

show :: Pitch -> String #

showList :: [Pitch] -> ShowS #

type Controls = Maybe (Set ScoreT.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

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.