Safe Haskell | None |
---|---|
Language | Haskell98 |
Patches.
- type CsdNote a = (a, a)
- type Instr a b = CsdNote a -> SE b
- type Fx a = a -> SE a
- type Fx1 = Fx Sig
- type Fx2 = Fx Sig2
- data FxSpec a = FxSpec {
- fxMix :: DryWetRatio
- fxFun :: Fx a
- type DryWetRatio = Sig
- type Patch1 = Patch Sig
- type Patch2 = Patch Sig2
- data Patch a
- = MonoSynt MonoSyntSpec (Instr Sig a)
- | PolySynt PolySyntSpec (Instr D a)
- | FxChain [FxSpec a] (Patch a)
- | SplitPatch (Patch a) D (Patch a)
- | LayerPatch [(Sig, Patch a)]
- data PolySyntSpec = PolySyntSpec {}
- data MonoSyntSpec = MonoSyntSpec {}
- polySynt :: Instr D a -> Patch a
- monoSynt :: Instr Sig a -> Patch a
- mapPatchInstr :: (Instr D a -> Instr D a) -> Patch a -> Patch a
- mapMonoPolyInstr :: (Instr Sig a -> Instr Sig a) -> (Instr D a -> Instr D a) -> Patch a -> Patch a
- transPatch :: D -> Patch a -> Patch a
- dryPatch :: Patch a -> Patch a
- getPatchFx :: (SigSpace a, Sigs a) => [FxSpec a] -> Fx a
- setFxMix :: Sig -> Patch a -> Patch a
- setFxMixes :: [Sig] -> Patch a -> Patch a
- setMidiChn :: MidiChn -> Patch a -> Patch a
- atMidi :: (SigSpace a, Sigs a) => Patch a -> SE a
- atSched :: (SigSpace a, Sigs a) => Patch a -> Evt (Sco (CsdNote D)) -> SE a
- atSchedUntil :: (SigSpace a, Sigs a) => Patch a -> Evt (CsdNote D) -> Evt b -> SE a
- atSco :: (SigSpace a, Sigs a) => Patch a -> Sco (CsdNote D) -> Sco (Mix a)
- atNote :: (SigSpace a, Sigs a) => Patch a -> CsdNote D -> SE a
- addInstrFx :: Fx a -> Patch a -> Patch a
- addPreFx :: DryWetRatio -> Fx a -> Patch a -> Patch a
- addPostFx :: DryWetRatio -> Fx a -> Patch a -> Patch a
- harmonPatch :: (SigSpace b, Sigs b) => [Sig] -> [D] -> Patch b -> Patch b
- deepPad :: (SigSpace b, Sigs b) => Patch b -> Patch b
- patchWhen :: Sigs a => BoolSig -> Patch a -> Patch a
- mixInstr :: (SigSpace b, Num b) => Sig -> Patch b -> Patch b -> Patch b
- withSmallRoom :: Patch2 -> Patch2
- withSmallRoom' :: DryWetRatio -> Patch2 -> Patch2
- withSmallHall :: Patch2 -> Patch2
- withSmallHall' :: DryWetRatio -> Patch2 -> Patch2
- withLargeHall :: Patch2 -> Patch2
- withLargeHall' :: DryWetRatio -> Patch2 -> Patch2
- withMagicCave :: Patch2 -> Patch2
- withMagicCave' :: DryWetRatio -> Patch2 -> Patch2
- sfPatch :: Sf -> Patch2
- sfPatchHall :: Sf -> Patch2
- onMonoSyntSpec :: (MonoSyntSpec -> MonoSyntSpec) -> Patch a -> Patch a
- setMonoSharp :: Patch a -> Patch a
- setMonoHold :: Patch a -> Patch a
- patchByNameMidi :: (SigSpace a, Sigs a) => String -> Patch a -> SE a
- atMidiTemp :: (SigSpace a, Sigs a) => Temp -> Patch a -> SE a
- patchByNameMidiTemp :: (SigSpace a, Sigs a) => Temp -> String -> Patch a -> SE a
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).
Fx specification. It;s a pair of dryWet ratio and a transformation function.
FxSpec | |
|
type DryWetRatio = Sig 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.
MonoSynt MonoSyntSpec (Instr Sig a) | |
PolySynt PolySyntSpec (Instr D a) | |
FxChain [FxSpec a] (Patch a) | |
SplitPatch (Patch a) D (Patch a) | |
LayerPatch [(Sig, Patch a)] |
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
MonoSyntSpec | |
|
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.
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
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
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
withSmallRoom :: Patch2 -> Patch2 Source #
withSmallRoom' :: DryWetRatio -> Patch2 -> Patch2 Source #
withSmallHall :: Patch2 -> Patch2 Source #
withSmallHall' :: DryWetRatio -> Patch2 -> Patch2 Source #
withLargeHall :: Patch2 -> Patch2 Source #
withLargeHall' :: DryWetRatio -> Patch2 -> Patch2 Source #
withMagicCave :: Patch2 -> Patch2 Source #
withMagicCave' :: DryWetRatio -> Patch2 -> Patch2 Source #
Sound font patches
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
).