module Sound.Sc3.Ugen.Bindings.Hw.Construct where
import Sound.Sc3.Common.Rate
import Sound.Sc3.Ugen.Types
mk_osc :: [Rate] -> UgenId -> Rate -> String -> [Ugen] -> Int -> Ugen
mk_osc :: [Rate] -> UgenId -> Rate -> String -> [Ugen] -> Int -> Ugen
mk_osc [Rate]
rs UgenId
z Rate
r String
c [Ugen]
i Int
o =
if Rate
r forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` [Rate]
rs
then Maybe ([Sample] -> Sample)
-> [Rate]
-> Either Rate [Int]
-> String
-> [Ugen]
-> Maybe [Ugen]
-> Int
-> Special
-> UgenId
-> Ugen
mkUgen forall a. Maybe a
Nothing [Rate]
rs (forall a b. a -> Either a b
Left Rate
r) String
c [Ugen]
i forall a. Maybe a
Nothing Int
o (Int -> Special
Special Int
0) UgenId
z
else forall a. HasCallStack => String -> a
error (String
"mk_osc: rate restricted: " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (Rate
r, [Rate]
rs, String
c))
mkOsc :: Rate -> String -> [Ugen] -> Int -> Ugen
mkOsc :: Rate -> String -> [Ugen] -> Int -> Ugen
mkOsc = [Rate] -> UgenId -> Rate -> String -> [Ugen] -> Int -> Ugen
mk_osc [Rate]
all_rates UgenId
no_id
mkOscR :: [Rate] -> Rate -> String -> [Ugen] -> Int -> Ugen
mkOscR :: [Rate] -> Rate -> String -> [Ugen] -> Int -> Ugen
mkOscR [Rate]
rs = [Rate] -> UgenId -> Rate -> String -> [Ugen] -> Int -> Ugen
mk_osc [Rate]
rs UgenId
no_id
mkOscIdR :: [Rate] -> UgenId -> Rate -> String -> [Ugen] -> Int -> Ugen
mkOscIdR :: [Rate] -> UgenId -> Rate -> String -> [Ugen] -> Int -> Ugen
mkOscIdR = [Rate] -> UgenId -> Rate -> String -> [Ugen] -> Int -> Ugen
mk_osc
mkOscId :: UgenId -> Rate -> String -> [Ugen] -> Int -> Ugen
mkOscId :: UgenId -> Rate -> String -> [Ugen] -> Int -> Ugen
mkOscId = [Rate] -> UgenId -> Rate -> String -> [Ugen] -> Int -> Ugen
mk_osc [Rate]
all_rates
mk_osc_mce :: UgenId -> Rate -> String -> [Ugen] -> Ugen -> Int -> Ugen
mk_osc_mce :: UgenId -> Rate -> String -> [Ugen] -> Ugen -> Int -> Ugen
mk_osc_mce UgenId
z Rate
r String
c [Ugen]
i Ugen
j =
let i' :: [Ugen]
i' = [Ugen]
i forall a. [a] -> [a] -> [a]
++ Ugen -> [Ugen]
mceChannels Ugen
j
in [Rate] -> UgenId -> Rate -> String -> [Ugen] -> Int -> Ugen
mk_osc [Rate]
all_rates UgenId
z Rate
r String
c [Ugen]
i'
mkOscMCE :: Rate -> String -> [Ugen] -> Ugen -> Int -> Ugen
mkOscMCE :: Rate -> String -> [Ugen] -> Ugen -> Int -> Ugen
mkOscMCE = UgenId -> Rate -> String -> [Ugen] -> Ugen -> Int -> Ugen
mk_osc_mce UgenId
no_id
mkOscMCEId :: UgenId -> Rate -> String -> [Ugen] -> Ugen -> Int -> Ugen
mkOscMCEId :: UgenId -> Rate -> String -> [Ugen] -> Ugen -> Int -> Ugen
mkOscMCEId = UgenId -> Rate -> String -> [Ugen] -> Ugen -> Int -> Ugen
mk_osc_mce
mk_filter :: [Rate] -> [Int] -> UgenId -> String -> [Ugen] -> Int -> Ugen
mk_filter :: [Rate] -> [Int] -> UgenId -> String -> [Ugen] -> Int -> Ugen
mk_filter [Rate]
rs [Int]
ix UgenId
z String
c [Ugen]
i Int
o = Maybe ([Sample] -> Sample)
-> [Rate]
-> Either Rate [Int]
-> String
-> [Ugen]
-> Maybe [Ugen]
-> Int
-> Special
-> UgenId
-> Ugen
mkUgen forall a. Maybe a
Nothing [Rate]
rs (forall a b. b -> Either a b
Right [Int]
ix) String
c [Ugen]
i forall a. Maybe a
Nothing Int
o (Int -> Special
Special Int
0) UgenId
z
mkFilterIdR :: [Rate] -> UgenId -> String -> [Ugen] -> Int -> Ugen
mkFilterIdR :: [Rate] -> UgenId -> String -> [Ugen] -> Int -> Ugen
mkFilterIdR [Rate]
rs UgenId
z String
nm [Ugen]
i = [Rate] -> [Int] -> UgenId -> String -> [Ugen] -> Int -> Ugen
mk_filter [Rate]
rs [Int
0 .. forall (t :: * -> *) a. Foldable t => t a -> Int
length [Ugen]
i forall a. Num a => a -> a -> a
- Int
1] UgenId
z String
nm [Ugen]
i
mkFilterR :: [Rate] -> String -> [Ugen] -> Int -> Ugen
mkFilterR :: [Rate] -> String -> [Ugen] -> Int -> Ugen
mkFilterR [Rate]
rs = [Rate] -> UgenId -> String -> [Ugen] -> Int -> Ugen
mkFilterIdR [Rate]
rs UgenId
no_id
mkFilter :: String -> [Ugen] -> Int -> Ugen
mkFilter :: String -> [Ugen] -> Int -> Ugen
mkFilter = [Rate] -> String -> [Ugen] -> Int -> Ugen
mkFilterR [Rate]
all_rates
mkFilterId :: UgenId -> String -> [Ugen] -> Int -> Ugen
mkFilterId :: UgenId -> String -> [Ugen] -> Int -> Ugen
mkFilterId = [Rate] -> UgenId -> String -> [Ugen] -> Int -> Ugen
mkFilterIdR [Rate]
all_rates
mk_filter_mce :: [Rate] -> UgenId -> String -> [Ugen] -> Ugen -> Int -> Ugen
mk_filter_mce :: [Rate] -> UgenId -> String -> [Ugen] -> Ugen -> Int -> Ugen
mk_filter_mce [Rate]
rs UgenId
z String
c [Ugen]
i Ugen
j = [Rate] -> UgenId -> String -> [Ugen] -> Int -> Ugen
mkFilterIdR [Rate]
rs UgenId
z String
c ([Ugen]
i forall a. [a] -> [a] -> [a]
++ Ugen -> [Ugen]
mceChannels Ugen
j)
mkFilterMCER :: [Rate] -> String -> [Ugen] -> Ugen -> Int -> Ugen
mkFilterMCER :: [Rate] -> String -> [Ugen] -> Ugen -> Int -> Ugen
mkFilterMCER [Rate]
rs = [Rate] -> UgenId -> String -> [Ugen] -> Ugen -> Int -> Ugen
mk_filter_mce [Rate]
rs UgenId
no_id
mkFilterMCE :: String -> [Ugen] -> Ugen -> Int -> Ugen
mkFilterMCE :: String -> [Ugen] -> Ugen -> Int -> Ugen
mkFilterMCE = [Rate] -> UgenId -> String -> [Ugen] -> Ugen -> Int -> Ugen
mk_filter_mce [Rate]
all_rates UgenId
no_id
mkFilterMCEId :: UgenId -> String -> [Ugen] -> Ugen -> Int -> Ugen
mkFilterMCEId :: UgenId -> String -> [Ugen] -> Ugen -> Int -> Ugen
mkFilterMCEId = [Rate] -> UgenId -> String -> [Ugen] -> Ugen -> Int -> Ugen
mk_filter_mce [Rate]
all_rates
mkInfo :: String -> Ugen
mkInfo :: String -> Ugen
mkInfo String
name = Rate -> String -> [Ugen] -> Int -> Ugen
mkOsc Rate
InitialisationRate String
name [] Int
1