hsc3-0.19.1: Haskell SuperCollider
Safe HaskellSafe-Inferred
LanguageHaskell2010

Sound.SC3.UGen.Name

Description

Functions to normalise UGen names.

SC3 UGen names are capitalised at word boundaries. hsc3 cannot use these names for UGen constructor functions. Haskell names are given by lower-casing until the first word edge. Lisp names are given by lower-casing everything and adding hyphens before edges.

Synopsis

Documentation

sc3_name_edges_plain :: String -> [Bool] Source #

Find all SC3 name edges. Edges occur at non lower-case letters. This rule is very simple but is coherent and predictable and works well for .hs names.

sc3_name_edges :: String -> [Bool] Source #

Find non-initial SC3 name edges.

sc3_name_edges "SinOsc" == [False,False,False,True,False,False]
sc3_name_edges "FFT" == [False,False,False]
sc3_name_edges "DFM1" == [False,False,False,False]
sc3_name_edges "PV_Add" == [False,False,False,True,False,False]
sc3_name_edges "A2K" == [False,False,False]
sc3_name_edges "Lag2UD" == [False,False,False,True,True,True]
sc3_name_edges "PeakEQ" == [False,False,False,False,True,True]

sc3_name_to_hs_name :: String -> String Source #

Convert from SCLang (class) name to Haskell (function) name.

s = words "SinOsc LFSaw FFT PV_Add AllpassN BHiPass BinaryOpUGen HPZ1 RLPF TGrains DFM1 FBSineC A2K Lag2UD IIRFilter FMGrainB Pan2 PeakEQ RIRandN"
l = words "sinOsc lfSaw fft pv_Add allpassN bHiPass binaryOpUGen hpz1 rlpf tGrains dfm1 fbSineC a2k lag2UD iirFilter fmGrainB pan2 peakEQ riRandN"
map sc3_name_to_hs_name s == l

sc3_name_to_lisp_name :: String -> String Source #

Convert from SC3 name to Lisp style name.

s = words "SinOsc LFSaw FFT PV_Add AllpassN BHiPass BinaryOpUGen HPZ1 RLPF TGrains DFM1 BPeakEQ Pan2 RIRandN"
l = words "sin-osc lf-saw fft pv-add allpass-n b-hi-pass binary-op-u-gen hpz1 rlpf t-grains dfm1 b-peak-e-q pan-2 ri-rand-n"
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 *")