hsc3-0.16: Haskell SuperCollider

Safe HaskellSafe
LanguageHaskell98

Sound.SC3.UGen.Operator

Contents

Description

Enumerations of the unary and binary math unit generators. Names that conflict with existing names have a _ suffix.

Synopsis

Unary

unaryTable :: [(Unary, String)] Source #

Table of symbolic names for standard unary operators.

unaryName :: Int -> String Source #

Lookup possibly symbolic name for standard unary operators.

unaryIndex :: Case_Rule -> String -> Maybe Int Source #

Given name of unary operator derive index.

mapMaybe (unaryIndex CI) (words "NEG CUBED") == [0,13]
unaryIndex CS "SinOsc" == Nothing

is_unary :: Case_Rule -> String -> Bool Source #

isJust of unaryIndex.

map (is_unary CI) (words "ABS MIDICPS NEG")
map (is_unary CI) (words "- RAND")

Binary

binaryTable :: [(Binary, String)] Source #

Table of symbolic names for standard binary operators.

binaryName :: Int -> String Source #

Lookup possibly symbolic name for standard binary operators.

map binaryName [1,2,8,12] == ["-","*","<","Min"]

binaryIndex :: Case_Rule -> String -> Maybe Int Source #

Given name of binary operator derive index.

mapMaybe (binaryIndex CI) (words "* MUL RING1") == [2,2,30]
binaryIndex CI "SINOSC" == Nothing

is_binary :: Case_Rule -> String -> Bool Source #

isJust of binaryIndex.

map (is_binary CI) (words "== > % TRUNC MAX")

Operator

resolve_operator :: Case_Rule -> String -> (String, Maybe Int) Source #

Order of lookup: binary then unary.

map (resolve_operator CI) (words "+ - ADD SUB NEG")