Safe Haskell | None |
---|---|
Language | Haskell98 |
Patterns
- mean :: Fractional a => [a] -> a
- vibrate :: Sig -> Sig -> (Sig -> a) -> Sig -> a
- randomPitch :: Sig -> Sig -> (Sig -> a) -> Sig -> SE a
- chorusPitch :: Int -> Sig -> (Sig -> Sig) -> Sig -> Sig
- resons :: [(Sig, Sig)] -> Sig -> Sig
- resonsBy :: (cps -> bw -> Sig -> Sig) -> [(cps, bw)] -> Sig -> Sig
- modes :: [(Sig, Sig)] -> Sig -> Sig -> Sig
- dryWet :: Sig -> (Sig -> Sig) -> Sig -> Sig
- once :: Tab -> Sig
- onceBy :: D -> Tab -> Sig
- several :: Tab -> Sig -> Sig
- fromMono :: Sig -> (Sig, Sig)
- odds :: [a] -> [a]
- evens :: [a] -> [a]
- rndPan :: Sig -> SE Sig2
- rndPan2 :: Sig2 -> SE Sig2
- rndVol :: SigSpace a => (D, D) -> a -> SE a
- gaussVol :: SigSpace a => D -> a -> SE a
- selector :: (Num a, SigSpace a) => [a] -> Sig -> a
- writeHifi :: D -> String -> SE Sig2 -> IO ()
- arpeggi :: SigSpace a => [Sig] -> [Sig] -> (Sig -> a) -> Sig -> a
- arpBy :: SigSpace a => ([Sig] -> Sig -> Sig) -> ([Sig] -> Sig -> Sig) -> [Sig] -> [Sig] -> (Sig -> a) -> Sig -> a
- lpJoy :: Source (Sig -> Sig)
- delaySig :: D -> Sig -> Sig
- delay1k :: Sig -> Sig
- wshaper :: Tab -> Sig -> Sig -> Sig
- genSaturator :: Double -> Sig -> Sig -> Sig
- saturator :: Sig -> Sig -> Sig
- mildSaturator :: Sig -> Sig -> Sig
- hardSaturator :: Sig -> Sig -> Sig
- hardSaturator2 :: Sig -> Sig -> Sig
- funSeq :: [a -> a] -> a -> a
- funPar :: Num a => [a -> a] -> a -> a
- ticks :: Int -> Sig -> Sig
- nticks :: [Int] -> Sig -> Sig
- ticks2 :: Int -> Sig -> Sig
- nticks2 :: [Int] -> Sig -> Sig
- ticks3 :: Int -> Sig -> Sig
- nticks3 :: [Int] -> Sig -> Sig
- ticks4 :: Int -> Sig -> Sig
- nticks4 :: [Int] -> Sig -> Sig
- testDrone :: D -> SE Sig2
- testDrone2 :: D -> SE Sig2
- testDrone3 :: D -> SE Sig2
- testDrone4 :: D -> SE Sig2
Documentation
mean :: Fractional a => [a] -> a Source #
Mean value.
vibrate :: Sig -> Sig -> (Sig -> a) -> Sig -> a Source #
Adds vibrato to the sound unit. Sound units is a function that takes in a frequency.
randomPitch :: Sig -> Sig -> (Sig -> a) -> Sig -> SE a Source #
Adds a random vibrato to the sound unit. Sound units is a function that takes in a frequency.
chorusPitch :: Int -> Sig -> (Sig -> Sig) -> Sig -> Sig Source #
Chorus takes a number of copies, chorus width and wave shape.
resons :: [(Sig, Sig)] -> Sig -> Sig Source #
Applies a resonator to the signals. A resonator is a list of band pass filters. A list contains the parameters for the filters:
[(centerFrequency, bandWidth)]
resonsBy :: (cps -> bw -> Sig -> Sig) -> [(cps, bw)] -> Sig -> Sig Source #
A resonator with user defined band pass filter. Warning: a filter takes in a center frequency, band width and the signal. The signal comes last (this order is not standard in the Csound but it's more convinient to use with Haskell).
modes :: [(Sig, Sig)] -> Sig -> Sig -> Sig Source #
Chain of mass-spring-damping filters.
modes params baseCps exciter
- params - a list of pairs
(resonantFrequencyRatio, filterQuality)
baseCps
- base frequency of the resonator- exciter - an impulse that starts a resonator.
dryWet :: Sig -> (Sig -> Sig) -> Sig -> Sig Source #
Mixes dry and wet signals.
dryWet ratio effect asig
ratio
- of dry signal to weteffect
- means to wet the signalasig
-- processed signal
List functions
Random functions
gaussVol :: SigSpace a => D -> a -> SE a Source #
Random volume (with gauss distribution)
gaussVol radiusOfDistribution
Choose signals
selector :: (Num a, SigSpace a) => [a] -> Sig -> a Source #
It picks a signal from the list by integer index. The original value is taken from the head of the list (the first element).
Saving to file
writeHifi :: D -> String -> SE Sig2 -> IO () Source #
Hi-fi output for stereo signals. Saves the stereo signal to file. The length of the file is defined in seconds.
writeHifi fileLength fileName asig
Arpeggios
arpeggi :: SigSpace a => [Sig] -> [Sig] -> (Sig -> a) -> Sig -> a Source #
Creates running arpeggios.
arpeggiBy ampWeights pitches instrument cps
It plays an instrument with fast sequence of notes. We can specify the pitches and amplitude weights of the notes as well as frequency of repetition.
arpBy :: SigSpace a => ([Sig] -> Sig -> Sig) -> ([Sig] -> Sig -> Sig) -> [Sig] -> [Sig] -> (Sig -> a) -> Sig -> a Source #
Creates running arpeggios.
arpeggiBy ampWave pitchwave ampWeights pitches instrument cps
It plays an instrument with fast sequence of notes. We can specify amplitude envelope wave, pitch envelope wave, the pitches and amplitude weights of the notes as well as frequency of repetition.
GUI
lpJoy :: Source (Sig -> Sig) Source #
Low-pass filter pictured as joystick. Ox is for center frequency and Oy is for resonance.
Effects
delaySig :: D -> Sig -> Sig Source #
Delay a signal by certain number of seconds
There is a subtle difference between the function and the function delaySnd
.
The delaySig
is for delaying a signal on a micro level (the delay time have to be small)
It's implemented with delay buffer in the csound. But delaySnd
is for delaying
on macro level (the delay time can be big). It's implemented with scores and invocation
of hidden instruments.
delaySig numOfSamples asig
Wave shaper
wshaper :: Tab -> Sig -> Sig -> Sig Source #
Wave shaper. The signal should be bipolar. It ranges within the interval [-1, 1].
wshaper table amount asig
wave shaper transforms the input signal with the table. The amount of transformation scales the signal from 0 to 1. the amount is ratio of scaling. It expects the values from the interval [0, 1].
genSaturator :: Double -> Sig -> Sig -> Sig Source #
Wave shaper with sigmoid.
genSaturator sigmoidRadius amount asig
- sigmoid radius is 5 to 100.
- amount is [0, 1]
Function composition
funPar :: Num a => [a -> a] -> a -> a Source #
Applies all functions in the list to the given input and summs them up.
Metronome
nticks :: [Int] -> Sig -> Sig Source #
Metronome with a chain of accents. A typical 7/8 for example:
dac $ nticks [3, 2, 2] (135 * 2)