hsc3-lang-0.13: Haskell SuperCollider Language

Safe HaskellSafe-Inferred

Sound.SC3.Lang.Math

Contents

Description

sclang math functions.

Synopsis

Binary

bitChar :: Char -> BoolSource

0 is false, 1 is True, else error.

 map bitChar "01" == [False,True]

parseBits :: (Num a, Bits a) => String -> aSource

Parse a sequence of 0 and 1 characters as a BE bit sequence

 parseBits "101" == 5
 parseBits "00001111" == 15

SimpleNumber

exprandrng :: Floating b => b -> b -> b -> bSource

Variant of SimpleNumber.exprand that shifts a linear (0,1) value to an exponential distribution.

 map (floor . exprandrng 10 100) [0,0.5,1] == [10,31,100]

inf :: Bounded a => aSource

Psuedo-inifite bounded value.

 inf == maxBound

isInf :: (Eq a, Bounded a) => a -> BoolSource

Predicate for inf.

 isInf inf == True

linexp :: (Ord a, Floating a) => a -> a -> a -> a -> a -> aSource

SimpleNumber.linexp shifts from linear to exponential ranges.

 map (floor . linexp 1 2 10 100) [1,1.5,2] == [10,31,100]

Gain

log10 :: Floating a => a -> aSource

Synonym for logBase 10.

rmsToDb :: Floating a => a -> aSource

dbToRms :: Floating a => a -> aSource

powToDb :: Floating a => a -> aSource

dbToPow :: Floating a => a -> aSource