Safe Haskell | Safe-Inferred |
---|
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
- generator :: CallName -> Doc.Doc -> WithArgDoc (GeneratorF d) -> Generator d
- generator0 :: Taggable d => CallName -> Doc.Doc -> (PassedArgs d -> Deriver (Stream.Stream d)) -> Generator d
- transformer :: CallName -> Doc.Doc -> WithArgDoc (TransformerF d) -> Transformer d
- transformer0 :: Taggable d => CallName -> Doc.Doc -> TransformerF d -> Transformer d
- attributes_note :: Attrs.Attributes -> Generator Note
- zero_duration_transform :: Doc.Doc -> (NoteArgs -> NoteDeriver -> NoteDeriver) -> Generator Note
- zero_duration :: CallName -> Doc.Doc -> (NoteArgs -> NoteDeriver) -> (NoteArgs -> NoteDeriver) -> Generator Note
- is_zero_duration :: PassedArgs a -> Deriver Bool
- postproc_note :: CallName -> Doc.Doc -> (Score.Event -> Score.Event) -> Generator Note
- postproc_generator :: CallName -> Doc.Doc -> Generator d -> (Deriver (Stream.Stream d) -> Deriver (Stream.Stream d)) -> Generator d
- multiple_calls :: [(Expr.Symbol, [Expr.Symbol])] -> [(Expr.Symbol, Generator Note)]
- multiple_call :: CallName -> [Expr.Symbol] -> Generator Note
- data Placement
- doubled_call :: Expr.Symbol -> CallName -> Placement -> RealTime -> Signal.Y -> Generator Note
- composite_doc :: Doc.Doc
- data Composite = Composite {
- c_call :: !Expr.Symbol
- c_instrument :: !ScoreT.Instrument
- c_pitch :: !Pitch
- c_controls :: !Controls
- data Pitch
- type Controls = Set ScoreT.Control
- show_controls :: Controls -> Text
- controls_doc :: Controls -> Doc.Doc
- redirect_pitch :: CallName -> Expr.Symbol -> Controls -> Expr.Symbol -> Controls -> Generator Note
- double_pitch :: CallName -> Controls -> ScoreT.PControl -> Controls -> Generator Note
- composite_call :: NoteArgs -> [Composite] -> NoteDeriver
- constant_pitch :: Generator Note
- constant_controls :: Bool -> Set ScoreT.Control -> Generator Note
- set_constant_controls :: Set ScoreT.Control -> PassedArgs b -> Deriver a -> Deriver a
- set_constant_pitch :: PassedArgs b -> Deriver a -> Deriver a
- element_from :: (Typecheck.Typecheck old, Typecheck.ToVal new) => EnvKey.Key -> (old -> Either Log.Msg new) -> Cmd.InstrumentPostproc
- element_from_id :: EnvKey.Key -> Cmd.InstrumentPostproc
- move_val :: (Typecheck.Typecheck old, Typecheck.ToVal new) => EnvKey.Key -> EnvKey.Key -> (old -> Either Log.Msg new) -> Cmd.InstrumentPostproc
- with_symbolic_pitch :: Cmd.InstrumentPostproc
- add_symbolic_pitch :: Cmd.InstrumentPostproc
- add_symbolic_pitch_convert :: (DeriveT.Transposed -> Either Text Pitch.Note) -> Cmd.InstrumentPostproc
- set_environ :: Typecheck.ToVal key => EnvKey.Key -> key -> Score.Event -> Score.Event
- when_env :: (Eq val, Typecheck.Typecheck val) => EnvKey.Key -> Maybe val -> Cmd.InstrumentPostproc -> Cmd.InstrumentPostproc
Documentation
generator :: CallName -> Doc.Doc -> WithArgDoc (GeneratorF d) -> Generator d Source #
generator0 :: Taggable d => CallName -> Doc.Doc -> (PassedArgs d -> Deriver (Stream.Stream d)) -> Generator d Source #
transformer :: CallName -> Doc.Doc -> WithArgDoc (TransformerF d) -> Transformer d Source #
transformer0 :: Taggable d => CallName -> Doc.Doc -> TransformerF d -> Transformer d Source #
attributes_note :: Attrs.Attributes -> Generator Note Source #
Make a call that simply calls the default note call with the given attrs.
zero_duration_transform :: Doc.Doc -> (NoteArgs -> NoteDeriver -> NoteDeriver) -> Generator Note Source #
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.
is_zero_duration :: PassedArgs a -> Deriver Bool Source #
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_calls :: [(Expr.Symbol, [Expr.Symbol])] -> [(Expr.Symbol, Generator Note)] Source #
multiple_call :: CallName -> [Expr.Symbol] -> Generator Note Source #
Create a call that just dispatches to other calls.
The grace note falls either before or after the beat.
doubled_call :: Expr.Symbol -> CallName -> Placement -> RealTime -> Signal.Y -> Generator Note Source #
composite
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.
Composite | |
|
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.
show_controls :: Controls -> Text Source #
controls_doc :: Controls -> Doc.Doc Source #
redirect_pitch :: CallName -> Expr.Symbol -> Controls -> Expr.Symbol -> Controls -> Generator Note Source #
double_pitch :: CallName -> Controls -> ScoreT.PControl -> Controls -> Generator Note Source #
composite_call :: NoteArgs -> [Composite] -> NoteDeriver Source #
See Composite
.
control vals
constant_controls :: Bool -> Set ScoreT.Control -> Generator Note Source #
set_constant_controls :: Set ScoreT.Control -> PassedArgs b -> Deriver a -> Deriver a Source #
set_constant_pitch :: PassedArgs b -> Deriver a -> Deriver a Source #
postproc
element_from :: (Typecheck.Typecheck old, Typecheck.ToVal new) => EnvKey.Key -> (old -> Either Log.Msg new) -> Cmd.InstrumentPostproc Source #
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.
add_symbolic_pitch_convert :: (DeriveT.Transposed -> Either Text Pitch.Note) -> Cmd.InstrumentPostproc Source #
set_environ :: Typecheck.ToVal key => EnvKey.Key -> key -> Score.Event -> Score.Event Source #
when_env :: (Eq val, Typecheck.Typecheck val) => EnvKey.Key -> Maybe val -> Cmd.InstrumentPostproc -> Cmd.InstrumentPostproc Source #