hsc3-0.20: Haskell SuperCollider
Safe HaskellSafe-Inferred
LanguageHaskell2010

Sound.Sc3.Ugen.Bindings.Composite

Contents

Description

Common unit generator graphs.

Synopsis

Documentation

asLocalBufId :: ID i => i -> [Ugen] -> Ugen Source #

Generate a localBuf and use setBuf to initialise it.

asLocalBufM :: Uid m => [Ugen] -> m Ugen Source #

balanceStereo :: Ugen -> Ugen -> Ugen -> Ugen Source #

balance2 with Mce input.

bLowPass4 :: Ugen -> Ugen -> Ugen -> Ugen Source #

24db/oct rolloff - 4th order resonant Low Pass Filter

bHiPass4 :: Ugen -> Ugen -> Ugen -> Ugen Source #

24db/oct rolloff - 4th order resonant Hi Pass Filter

bufRdN :: Int -> Rate -> Ugen -> Ugen -> Loop Ugen -> Ugen Source #

Buffer reader (no interpolation).

bufRdL :: Int -> Rate -> Ugen -> Ugen -> Loop Ugen -> Ugen Source #

Buffer reader (linear interpolation).

bufRdC :: Int -> Rate -> Ugen -> Ugen -> Loop Ugen -> Ugen Source #

Buffer reader (cubic interpolation).

changed :: Ugen -> Ugen -> Ugen Source #

Triggers when a value changes

chooseId :: ID m => m -> Ugen -> Ugen Source #

mce variant of lchoose.

chooseM :: Uid m => Ugen -> m Ugen Source #

liftUid of choose.

dconsId :: ID m => (m, m, m) -> Ugen -> Ugen -> Ugen Source #

Demand rate (:) function.

dconsM :: Uid m => Ugen -> Ugen -> m Ugen Source #

Demand rate (:) function.

dynKlang :: Rate -> Ugen -> Ugen -> Ugen -> Ugen Source #

Dynamic klang, dynamic sine oscillator bank

dynKlank :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen Source #

Dynamic klank, set of non-fixed resonating filters.

exprange :: Ugen -> Ugen -> Ugen -> Ugen Source #

linExp with input range of (-1,1).

in_exprange :: Ugen -> (Ugen, Ugen) -> Ugen Source #

Variant of exprange with arguments to make writing post-fix nicer.

fft' :: Ugen -> Ugen -> Ugen Source #

Variant FFT constructor with default values for hop size (0.5), window type (0), active status (1) and window size (0).

fftAllocId :: ID i => i -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen Source #

fft variant that allocates localBuf.

let c = ffta 'α' 2048 (soundIn 0) 0.5 0 1 0
in audition (out 0 (ifft c 0 0))

fftAllocM :: Uid m => Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> m Ugen Source #

fftAlloc :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen Source #

freqShift_hilbert :: Ugen -> Ugen -> Ugen -> Ugen Source #

Frequency shifter, in terms of hilbert (see also freqShift).

gateReset :: Num a => a -> a -> a Source #

Ugen function to re-trigger an EnvGen envelope. Inputs are gate (as set at EnvGen) and reset. The four state logic is: (1,0)->1 (1,1)->-1 (0,1)->0 (0,0)->0. If the gate input to EnvGen.kr is -1 the envelope ramps to zero in one control period. The reset input sequence 0,1,0 when the gate is open produces (1,-1,1), which resets the envelope.

map (uncurry gateReset) [(1,0),(1,1),(0,1),(0,0)] == [1,-1,0,0]

hilbertFIR :: Ugen -> Ugen -> Ugen Source #

Variant of hilbert using FFT (with a delay) for better results. Buffer should be 2048 or 1024. 2048 = better results, more delay. 1024 = less delay, little choppier results.

ifft' :: Ugen -> Ugen Source #

Variant ifft with default value for window type.

klanx_spec_f :: (a -> [b]) -> ([b] -> c) -> a -> a -> a -> c Source #

Generalised Klan(kg) specification rule. f unwraps inputs, g/ wraps output.

let r = [220,0.2,0,219,0.1,1,221,0.1,2]
in klanx_spec_f id id [220,219,221] [0.2,0.1,0.1] [0,1,2] == r

klangSpec :: [Ugen] -> [Ugen] -> [Ugen] -> Ugen Source #

Format frequency, amplitude and decay time data as required for klank.

klangSpec_k :: Real n => [n] -> [n] -> [n] -> Ugen Source #

Variant of klangSpec for non-Ugen inputs.

klangSpec_mce :: Ugen -> Ugen -> Ugen -> Ugen Source #

Variant of klangSpec for Mce inputs.

klankSpec :: [Ugen] -> [Ugen] -> [Ugen] -> Ugen Source #

Format frequency, amplitude and decay time data as required for klank.

klankSpec_k :: Real n => [n] -> [n] -> [n] -> Ugen Source #

Variant for non-Ugen inputs.

klankSpec_mce :: Ugen -> Ugen -> Ugen -> Ugen Source #

Variant of klankSpec for Mce inputs.

lchooseId :: ID m => m -> [Ugen] -> Ugen Source #

Randomly select one of a list of Ugens (initialisation rate).

lchooseM :: Uid m => [Ugen] -> m Ugen Source #

liftUid of lchoose.

linExp_b :: Ugen -> Ugen -> Ugen -> Ugen Source #

linExp of (-1,1).

linExp_u :: Ugen -> Ugen -> Ugen -> Ugen Source #

linExp of (0,1).

linLin :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen Source #

Map from one linear range to another linear range.

linLin_u :: Ugen -> Ugen -> Ugen -> Ugen Source #

linLin where source is (0,1).

linLin_b :: Ugen -> Ugen -> Ugen -> Ugen Source #

linLin where source is (-1,1).

localIn' :: Int -> Rate -> Ugen Source #

Variant with defaults of zero.

makeFadeEnv :: Double -> Ugen Source #

Generate an envGen Ugen with fadeTime and gate controls.

import Sound.Sc3
audition (out 0 (makeFadeEnv 1 * sinOsc ar 440 0 * 0.1))
withSc3 (send (n_set1 (-1) "gate" 0))

mouseButtonRand :: Rate -> Ugen -> Ugen -> Ugen -> Ugen Source #

Variant that is randomly pressed.

mouseRandId :: ID a => a -> Rate -> Ugen -> Ugen -> Warp Ugen -> Ugen -> Ugen Source #

Randomised mouse Ugen (see also mouseX' and mouseY').

mouseRandM :: Uid m => Rate -> Ugen -> Ugen -> Warp Ugen -> Ugen -> m Ugen Source #

mouseXRand :: Rate -> Ugen -> Ugen -> Warp Ugen -> Ugen -> Ugen Source #

Variant that randomly traverses the mouseX space.

mouseYRand :: Rate -> Ugen -> Ugen -> Warp Ugen -> Ugen -> Ugen Source #

Variant that randomly traverses the mouseY space.

onsetType :: Num a => String -> a Source #

Translate onset type string to constant Ugen value.

onsetsDefault :: Ugen -> Ugen -> Ugen -> Ugen Source #

Onset detector with default values for minor parameters.

packFFTSpec :: [Ugen] -> [Ugen] -> Ugen Source #

Format magnitude and phase data data as required for packFFT.

partConv_calcAccumSize :: Int -> Int -> Int Source #

Calculate size of accumulation buffer given FFT and IR sizes.

pmOsc :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen Source #

PM oscillator. cf = carrier frequency, mf = modulation frequency, pm = pm-index = 0.0, mp = mod-phase = 0.0

pollExt :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen Source #

Variant of poll that generates an mrg value with the input signal at left, and that allows a constant frequency input in place of a trigger.

privateIn :: Int -> Rate -> Ugen -> Ugen Source #

Variant of in' offset so zero if the first private bus.

privateOut :: Ugen -> Ugen -> Ugen Source #

Variant of out offset so zero if the first private bus.

pvcollect :: Ugen -> Int -> (Ugen -> Ugen -> Int -> (Ugen, Ugen)) -> Int -> Int -> Ugen -> Ugen Source #

Apply function f to each bin of an FFT chain, f receives magnitude, phase and index and returns a (magnitude,phase).

pv_calcPVRecSize :: Double -> Int -> Double -> Double -> Int Source #

dur and hop are in seconds, frameSize and sampleRate in frames, though the latter maybe fractional.

pv_calcPVRecSize 4.2832879818594 1024 0.25 48000.0 == 823299

rand0Id :: ID a => a -> Ugen -> Ugen Source #

rand with left edge set to zero.

rand0M :: Uid m => Ugen -> m Ugen Source #

UgenId form of rand0.

rand2Id :: ID a => a -> Ugen -> Ugen Source #

rand with left edge set to negative n. Note rand2 is also a UnaryOp Ugen, however hsc3 does not store Ids for operators.

rand2M :: Uid m => Ugen -> m Ugen Source #

UgenId form of rand2.

rotateStereo :: Ugen -> Ugen -> Ugen Source #

rotate2 with Mce input.

runningSumRMS :: Ugen -> Ugen -> Ugen Source #

RMS variant of runningSum.

selectX :: Ugen -> Ugen -> Ugen Source #

Mix one output from many sources

setBuf' :: Ugen -> [Ugen] -> Ugen -> Ugen Source #

Set local buffer values.

silent :: Int -> Ugen Source #

Silence.

soundIn :: Ugen -> Ugen Source #

Zero indexed audio input buses. Optimises case of consecutive Ugens.

soundIn (mce2 0 1) == in' 2 ar numOutputBuses
soundIn (mce2 0 2) == in' 1 ar (numOutputBuses + mce2 0 2)

splay :: Ugen -> Ugen -> Ugen -> Ugen -> Bool -> Ugen Source #

Pan a set of channels across the stereo field.

input, spread:1, level:1, center:0, levelComp:true

tap :: Int -> Rate -> Ugen -> Ugen -> Ugen Source #

Single tap into a delayline. ar only.

tChooseId :: ID m => m -> Ugen -> Ugen -> Ugen Source #

Randomly select one of several inputs on trigger.

tChooseM :: Uid m => Ugen -> Ugen -> m Ugen Source #

Randomly select one of several inputs.

tLine :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen Source #

Triggered Line, implemented in terms of EnvGen.

tXLine :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen Source #

Triggered xLine, implemented in terms of EnvGen.

triAS :: Int -> Ugen -> Ugen Source #

Triangle wave as sum of n sines. For partial n, amplitude is (1 / square n) and phase is pi at every other odd partial.

tWChooseId :: ID m => m -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen Source #

Randomly select one of several inputs on trigger (weighted).

tWChooseM :: Uid m => Ugen -> Ugen -> Ugen -> Ugen -> m Ugen Source #

Randomly select one of several inputs (weighted).

unpackFFT :: Ugen -> Int -> Int -> Int -> Ugen -> [Ugen] Source #

Unpack an FFT chain into separate demand-rate FFT bin streams.

varLag_env :: Ugen -> Ugen -> Envelope_Curve Ugen -> Maybe Ugen -> Ugen Source #

VarLag in terms of envGen. Note: in SC3 curvature and warp are separate arguments.

whiteNoiseMN :: Uid m => Int -> Rate -> m Ugen Source #

k channel white noise.

whiteNoiseN 2 ar * 0.1

wrapOut :: Maybe Double -> Ugen -> Ugen Source #

If z isn't a sink node route to an out node writing to bus. If fadeTime is given multiply by makeFadeEnv.

import Sound.Sc3 
audition (wrapOut (Just 1) (sinOsc ar 440 0 * 0.1))
import Sound.Osc 
withSc3 (sendMessage (n_set1 (-1) "gate" 0))

wslib

playBufCF :: Int -> Ugen -> Ugen -> Ugen -> Ugen -> Loop Ugen -> Ugen -> Int -> Ugen Source #

Cross-fading version of playBuf.

adc

osc1 :: Rate -> Ugen -> Ugen -> DoneAction Ugen -> Ugen Source #

An oscillator that reads through a table once.