csound-expression-5.1.0: library to make electronic music

Safe HaskellNone
LanguageHaskell98

Csound.Air.Patch

Contents

Description

Patches.

Synopsis

Documentation

type CsdNote a = (a, a) Source #

A simple csound note (good for playing with midi-keyboard). It's a pair of amplitude (0 to 1) and freuqncy (Hz).

type Instr a b = CsdNote a -> SE b Source #

An instrument transforms a note to a signal.

type Fx a = a -> SE a Source #

An effect processes the input signal.

type Fx1 = Fx Sig Source #

Mono effect.

type Fx2 = Fx Sig2 Source #

Stereo effect.

data FxSpec a Source #

Fx specification. It;s a pair of dryWet ratio and a transformation function.

Constructors

FxSpec 

Fields

type Patch1 = Patch Sig Source #

Mono-output patch.

type Patch2 = Patch Sig2 Source #

Stereo-output patch.

data Patch a Source #

The patch can be:

  • a plain monophonic or polyphonic synthesizer
  • patch with chain of effects,
  • split on keyboard with certain frequency
  • layer of patches. That is a several patches that sound at the same time. the layer is a patch and the weight of volume for a given patch.

Instances

SigSpace a => SigSpace (Patch a) Source # 

Methods

mapSig :: (Sig -> Sig) -> Patch a -> Patch a Source #

data MonoSyntSpec Source #

Specification for monophonic synthesizer.

  • Chn -- midi channel to listen on
  • Hold -- to hold the note or not
  • SlideTime -- time of transition between notes
  • SyntRelease -- time of release

mapPatchInstr :: (Instr D a -> Instr D a) -> Patch a -> Patch a Source #

mapMonoPolyInstr :: (Instr Sig a -> Instr Sig a) -> (Instr D a -> Instr D a) -> Patch a -> Patch a Source #

transPatch :: D -> Patch a -> Patch a Source #

Transpose the patch by a given ratio. We can use the functions semitone, cent to calculate the ratio.

dryPatch :: Patch a -> Patch a Source #

Removes all effects from the patch.

getPatchFx :: (SigSpace a, Sigs a) => [FxSpec a] -> Fx a Source #

Renders the effect chain to a single function.

setFxMix :: Sig -> Patch a -> Patch a Source #

Sets the dryWet ratio of the effects wwithin the patch.

setFxMixes :: [Sig] -> Patch a -> Patch a Source #

Sets the dryWet ratios for the chain of the effects wwithin the patch.

setMidiChn :: MidiChn -> Patch a -> Patch a Source #

Sets the midi channel for all instruments in the patch.

Midi

atMidi :: (SigSpace a, Sigs a) => Patch a -> SE a Source #

Plays a patch with midi.

Events

atSched :: (SigSpace a, Sigs a) => Patch a -> Evt (Sco (CsdNote D)) -> SE a Source #

Plays a patch with event stream.

atSchedUntil :: (SigSpace a, Sigs a) => Patch a -> Evt (CsdNote D) -> Evt b -> SE a Source #

Plays a patch with event stream with stop-note event stream.

Sco

atSco :: (SigSpace a, Sigs a) => Patch a -> Sco (CsdNote D) -> Sco (Mix a) Source #

Plays a patch with scores.

Single note

atNote :: (SigSpace a, Sigs a) => Patch a -> CsdNote D -> SE a Source #

Plays a patch with a single infinite note.

Fx

addInstrFx :: Fx a -> Patch a -> Patch a Source #

Adds an effect to the patch's instrument.

addPreFx :: DryWetRatio -> Fx a -> Patch a -> Patch a Source #

Appends an effect before patch's effect.

addPostFx :: DryWetRatio -> Fx a -> Patch a -> Patch a Source #

Appends an effect after patch's effect.

Pads

harmonPatch :: (SigSpace b, Sigs b) => [Sig] -> [D] -> Patch b -> Patch b Source #

Harmnoic series of patches.

deepPad :: (SigSpace b, Sigs b) => Patch b -> Patch b Source #

Adds an octave below note for a given patch to make the sound deeper.

Misc

patchWhen :: Sigs a => BoolSig -> Patch a -> Patch a Source #

Plays a patch when the condition signal is satisfied. Can be useful for switches.

mixInstr :: (SigSpace b, Num b) => Sig -> Patch b -> Patch b -> Patch b Source #

Mix two patches together.

Rever

Sound font patches

sfPatch :: Sf -> Patch2 Source #

Sound font patch.

sfPatchHall :: Sf -> Patch2 Source #

Sound font patch with a bit of reverb.

Monosynt params

onMonoSyntSpec :: (MonoSyntSpec -> MonoSyntSpec) -> Patch a -> Patch a Source #

Transform the spec for monophonic patch.

setMonoSharp :: Patch a -> Patch a Source #

Sets the monophonic to sharp transition and quick release.

setMonoHold :: Patch a -> Patch a Source #

Sets the monophonic patch to hold mode. All notes are held.

Csound API

patchByNameMidi :: (SigSpace a, Sigs a) => String -> Patch a -> SE a Source #

Triggers patch with Csound API. It creates a named instruement with given name (first argument).

It simulates the midi-like instrument. Notes are encoded with messages:

i "givenName" 1 pitchKey volumeKey     -- note on
i "givenName" 0 pitchKey volumeKey     -- note off

Custom temperament

Midi

atMidiTemp :: (SigSpace a, Sigs a) => Temp -> Patch a -> SE a Source #

Plays a patch with midi with given temperament (see Csound.Tuning).

Csound API

patchByNameMidiTemp :: (SigSpace a, Sigs a) => Temp -> String -> Patch a -> SE a Source #

Triggers patch with Csound API. It creates a named instruement with given name (second argument). It behaves like the function patchByNameMidi but we can specify custom temperament.