hsc3-0.15.1: Haskell SuperCollider

Safe HaskellSafe-Inferred



Functions to normalise UGen names. SC3 UGen names are capitalised, hsc3 cannot use the same names for UGen constructor functions. The functions here are heuristics, and are likely only partial.



toSC3Name :: String -> String Source

Convert from hsc3 name to SC3 name.

toSC3Name "sinOsc" == "SinOsc"
toSC3Name "lfSaw" == "LFSaw"
toSC3Name "pv_Copy" == "PV_Copy"
map toSC3Name ["bpf","fft","tpv","out","in'"]

fromSC3Name :: String -> String Source

Inverse of toSC3Name.

let nm = ["SinOsc","LFSaw","PV_Copy"]
in map fromSC3Name nm == ["sinOsc","lfSaw","pv_Copy"]
map fromSC3Name ["BPF","FFT","TPV"] == ["bpf","fft","tpv"]
map fromSC3Name (words "HPZ1 RLPF")

sc3_name_edges :: String -> [Bool] Source

Find SC3 name edges.

sc3_name_to_lisp_name :: String -> String Source

Convert from SC3 name to Lisp style name.

let {s = words "SinOsc LFSaw FFT PV_Add AllpassN BHiPass BinaryOpUGen HPZ1 RLPF TGrains"
    ;l = words "sin-osc lf-saw fft pv-add allpass-n b-hi-pass binary-op-ugen hpz1 rlpf t-grains"}
in map sc3_name_to_lisp_name s == l

sc3_ugen_name_sep :: String -> Maybe (String, Maybe Rate) Source

SC3 UGen names are given with rate suffixes if oscillators, without if filters.

map sc3_ugen_name_sep (words "SinOsc.ar LPF *")