csound-expression-typed-0.2.7.1: typed core for the library csound-expression
Safe HaskellSafe-Inferred
LanguageHaskell2010

Csound.Typed.Control.Api

Synopsis

Documentation

trigByName :: (Arg a, Sigs b) => Text -> (a -> SE b) -> SE b Source #

Creates an instrument that can be triggered by name with Csound API. The arguments are determined from the structure of the input for the instrument. If we have a tuple of arguments: (D, D, Tab) The would be rendered to instrument arguments that strts from p4. p1 is the name of teh instrument, p2 is the start time of the note, p3 is the duration of the note. Then p4 and p5 are going to be doubles and p6 is an integer that denotes a functional table.

trigByName_ :: Arg a => Text -> (a -> SE ()) -> SE () Source #

Creates an instrument that can be triggered by name with Csound API. The arguments are determined from the structure of the input for the instrument.

With Csound API we can send messages

i "name" time duration arg1 arg2 arg3

trigByNameMidi :: (Arg a, Sigs b) => Text -> ((D, D, a) -> SE b) -> SE b Source #

Creates an instrument that can be triggered by name with Csound API.

It's intended to be used like a midi instrument. It simulates a simplified midi protocol. We can trigger notes:

i "givenName" delay duration 1 pitchKey volumeKey auxParams     -- note on
i "givenName" delay duration 0 pitchKey volumeKey auxParams     -- note off

The arguments are

trigByNameMidi name instrument

The instrument takes a triplet of (pitchKey, volumeKey, auxilliaryTuple). The order does matter. Please don't pass the volumeKey as the first argument. The instrument expects the pitch key to be a first argument.

trigByNameMidi_ :: forall a. Arg a => Text -> ((D, D, a) -> SE ()) -> SE () Source #

It behaves just like the function trigByNameMidi. Only it doesn't produce an audio signal. It performs some procedure on note on and stops doing the precedure on note off.