Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Csound.Typed.Control.InstrRef
Description
Imperative csound instruments
Synopsis
- data InstrRef a
- newInstr :: Arg a => (a -> SE ()) -> SE (InstrRef a)
- scheduleEvent :: Arg a => InstrRef a -> D -> D -> a -> SE ()
- turnoff2 :: InstrRef a -> Sig -> Sig -> SE ()
- negateInstrRef :: InstrRef a -> InstrRef a
- addFracInstrRef :: D -> D -> InstrRef a -> InstrRef a
- newOutInstr :: (Arg a, Sigs b) => (a -> SE b) -> SE (InstrRef a, b)
- noteOn :: Arg a => D -> D -> InstrRef a -> a -> SE ()
- noteOff :: (Default a, Arg a) => D -> D -> InstrRef a -> SE ()
Documentation
Instrument reference. we can invoke or stop the instrument by the identifier.
newInstr :: Arg a => (a -> SE ()) -> SE (InstrRef a) Source #
Creates a new instrument and generates a unique identifier.
scheduleEvent :: Arg a => InstrRef a -> D -> D -> a -> SE () Source #
Schedules an event for the instrument.
scheduleEvent instrRef delay duration args
The arguments for time values are set in seconds.
turnoff2 :: InstrRef a -> Sig -> Sig -> SE () Source #
Turns off the note played on the given instrument. Use fractional instrument reference to turn off specific instance.
turnoff2 instrRef mode releaseTime
The mode is sum of the following values:
- 0, 1, or 2: turn off all instances (0), oldest only (1), or newest only (2)
- 4: only turn off notes with exactly matching (fractional) instrument number, rather than ignoring fractional part
- 8: only turn off notes with indefinite duration (idur < 0 or MIDI)
releaseTime
if non-zero, the turned off instances are allowed to release, otherwise are deactivated immediately (possibly resulting in clicks).
negateInstrRef :: InstrRef a -> InstrRef a Source #
Negates the instrument identifier. This trick is used in Csound to update the instrument arguments while instrument is working.
addFracInstrRef :: D -> D -> InstrRef a -> InstrRef a Source #
Adds fractional part to the instrument reference. This trick is used in Csound to identify the notes (or specific instrument invokation).
newOutInstr :: (Arg a, Sigs b) => (a -> SE b) -> SE (InstrRef a, b) Source #
Creates an insturment that produces a value.