Sound.SC3.UGen.Math

Description

Non-standard mathematical classes and class instances.

Synopsis

# Documentation

Pseudo-infinite constant UGen.

sc3_true :: Num n => n Source #

True is conventionally 1. The test to determine true is > 0.

sc3_false :: Num n => n Source #

False is conventionally 0.

sc3_not :: (Ord n, Num n) => n -> n Source #

Lifted not.

sc3_not sc3_true == sc3_false
sc3_not sc3_false == sc3_true

sc3_bool :: Num n => Bool -> n Source #

Translate Bool to sc3_true and sc3_false.

sc3_comparison :: Num n => (n -> n -> Bool) -> n -> n -> n Source #

Lift comparison function.

sc3_eq :: (Num n, Eq n) => n -> n -> n Source #

Lifted ==.

sc3_neq :: (Num n, Eq n) => n -> n -> n Source #

Lifted /=.

sc3_lt :: (Num n, Ord n) => n -> n -> n Source #

Lifted <.

sc3_lte :: (Num n, Ord n) => n -> n -> n Source #

Lifted <=.

sc3_gt :: (Num n, Ord n) => n -> n -> n Source #

Lifted >.

sc3_gte :: (Num n, Ord n) => n -> n -> n Source #

Lifted >=.

binop_hs_tbl :: (Real n, Floating n, RealFrac n) => [(Binary, n -> n -> n)] Source #

Association table for Binary to haskell function implementing operator.

binop_special_hs :: (RealFrac n, Floating n) => Int -> Maybe (n -> n -> n) Source #

lookup binop_hs_tbl via toEnum.

uop_hs_tbl :: (RealFrac n, Floating n) => [(Unary, n -> n)] Source #

Association table for Unary to haskell function implementing operator.

uop_special_hs :: (RealFrac n, Floating n) => Int -> Maybe (n -> n) Source #

lookup uop_hs_tbl via toEnum.

class (Eq a, Num a) => EqE a where Source #

Variant on Eq class, result is of the same type as the values compared.

Methods

(==*) :: a -> a -> a Source #

(/=*) :: a -> a -> a Source #

Instances

 Source # Methods Source # Methods Source # Methods(==*) :: Int -> Int -> Int Source #(/=*) :: Int -> Int -> Int Source # Source # Methods Source # Methods Source # Methods Source # Methods(==*) :: UGen -> UGen -> UGen Source #(/=*) :: UGen -> UGen -> UGen Source #

class (Ord a, Num a) => OrdE a where Source #

Variant on Ord class, result is of the same type as the values compared.

Methods

(<*) :: a -> a -> a Source #

(<=*) :: a -> a -> a Source #

(>*) :: a -> a -> a Source #

(>=*) :: a -> a -> a Source #

Instances

 Source # Methods Source # Methods Source # Methods(<*) :: Int -> Int -> Int Source #(<=*) :: Int -> Int -> Int Source #(>*) :: Int -> Int -> Int Source #(>=*) :: Int -> Int -> Int Source # Source # Methods Source # Methods Source # Methods Source # Methods(<*) :: UGen -> UGen -> UGen Source #(<=*) :: UGen -> UGen -> UGen Source #(>*) :: UGen -> UGen -> UGen Source #(>=*) :: UGen -> UGen -> UGen Source #

class RealFrac a => RealFracE a where Source #

Variant of RealFrac with non Integral results.

Methods

properFractionE :: a -> (a, a) Source #

truncateE :: a -> a Source #

roundE :: a -> a Source #

ceilingE :: a -> a Source #

floorE :: a -> a Source #

Instances

 Source # Methods Source # Methods Source # Methods

UGen form or sc3_round_to.

UGen form of ceilingE.

class (Floating a, Ord a) => UnaryOp a where Source #

Unary operator class.

map (floor . (* 1e4) . dbAmp) [-90,-60,-30,0] == [0,10,316,10000]

Methods

ampDb :: a -> a Source #

asFloat :: a -> a Source #

asInt :: a -> a Source #

cpsMIDI :: a -> a Source #

cpsOct :: a -> a Source #

cubed :: a -> a Source #

dbAmp :: a -> a Source #

distort :: a -> a Source #

frac :: a -> a Source #

isNil :: a -> a Source #

log10 :: a -> a Source #

log2 :: a -> a Source #

midiCPS :: a -> a Source #

midiRatio :: a -> a Source #

notE :: a -> a Source #

notNil :: a -> a Source #

octCPS :: a -> a Source #

ramp_ :: a -> a Source #

ratioMIDI :: a -> a Source #

softClip :: a -> a Source #

squared :: a -> a Source #

Instances

 Source # Methods Source # Methods Source # Methods

class (Floating a, RealFrac a, Ord a) => BinaryOp a where Source #

Binary operator class.

Methods

absDif :: a -> a -> a Source #

amClip :: a -> a -> a Source #

atan2E :: a -> a -> a Source #

clip2 :: a -> a -> a Source #

difSqr :: a -> a -> a Source #

excess :: a -> a -> a Source #

exprandRange :: a -> a -> a Source #

fill :: a -> a -> a Source #

firstArg :: a -> a -> a Source #

fold2 :: a -> a -> a Source #

gcdE :: a -> a -> a Source #

hypot :: a -> a -> a Source #

hypotx :: a -> a -> a Source #

iDiv :: a -> a -> a Source #

lcmE :: a -> a -> a Source #

modE :: a -> a -> a Source #

randRange :: a -> a -> a Source #

ring1 :: a -> a -> a Source #

ring2 :: a -> a -> a Source #

ring3 :: a -> a -> a Source #

ring4 :: a -> a -> a Source #

roundUp :: a -> a -> a Source #

scaleNeg :: a -> a -> a Source #

sqrDif :: a -> a -> a Source #

sqrSum :: a -> a -> a Source #

sumSqr :: a -> a -> a Source #

thresh :: a -> a -> a Source #

trunc :: a -> a -> a Source #

wrap2 :: a -> a -> a Source #

Instances

 Source # Methods Source # Methods Source # Methodsclip2 :: UGen -> UGen -> UGen Source #fill :: UGen -> UGen -> UGen Source #fold2 :: UGen -> UGen -> UGen Source #gcdE :: UGen -> UGen -> UGen Source #hypot :: UGen -> UGen -> UGen Source #iDiv :: UGen -> UGen -> UGen Source #lcmE :: UGen -> UGen -> UGen Source #modE :: UGen -> UGen -> UGen Source #ring1 :: UGen -> UGen -> UGen Source #ring2 :: UGen -> UGen -> UGen Source #ring3 :: UGen -> UGen -> UGen Source #ring4 :: UGen -> UGen -> UGen Source #trunc :: UGen -> UGen -> UGen Source #wrap2 :: UGen -> UGen -> UGen Source #

class Num a => MulAdd a where Source #

Methods

mul_add :: a -> a -> a -> a Source #

Instances

 Source # Methods Source # Methods Source # Methodsmul_add :: UGen -> UGen -> UGen -> UGen Source #

linlin_ma :: (Fractional a, MulAdd a) => a -> a -> a -> a -> a -> a Source #

Map from one linear range to another linear range.

urange_ma :: (Fractional a, MulAdd a) => a -> a -> a -> a Source #

Scale uni-polar (0,1) input to linear (l,r) range

range_ma :: (Fractional a, MulAdd a) => a -> a -> a -> a Source #

Scale bi-polar (-1,1) input to linear (l,r) range. Note that the argument order is not the same as linLin.