module Sound.Sc3.Ugen.Bindings.Composite.External where
import Data.List
import Data.Maybe
import Sound.Sc3.Common.Math
import Sound.Sc3.Common.Rate
import Sound.Sc3.Common.Uid
import Sound.Sc3.Common.Unsafe
import Sound.Sc3.Ugen.Analysis
import Sound.Sc3.Ugen.Ugen
import Sound.Sc3.Ugen.Util
import qualified Sound.Sc3.Ugen.Bindings.Db as Db
import qualified Sound.Sc3.Ugen.Bindings.Db.External as External
fm7_mx :: [[Ugen]] -> [[Ugen]] -> Ugen
fm7_mx :: [[Ugen]] -> [[Ugen]] -> Ugen
fm7_mx [[Ugen]]
ctlMatrix [[Ugen]]
modMatrix = Rate -> Ugen -> Ugen -> Ugen
External.fm7 Rate
ar ([Ugen] -> Ugen
mce (forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat [[Ugen]]
ctlMatrix)) ([Ugen] -> Ugen
mce (forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat [[Ugen]]
modMatrix))
greyhole :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen
greyhole :: Ugen
-> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen
greyhole Ugen
i Ugen
delayTime Ugen
damping Ugen
size Ugen
diffusion Ugen
feedback Ugen
modDepth Ugen
modFreq =
let (Ugen
i1,Ugen
i2) = Ugen -> (Ugen, Ugen)
unmce2 Ugen
i
in Ugen
-> Ugen
-> Ugen
-> Ugen
-> Ugen
-> Ugen
-> Ugen
-> Ugen
-> Ugen
-> Ugen
External.greyholeRaw Ugen
i1 Ugen
i2 Ugen
damping Ugen
delayTime Ugen
diffusion Ugen
feedback Ugen
modDepth Ugen
modFreq Ugen
size
miBraids_mode_dict :: Num n => [(n,String)]
miBraids_mode_dict :: forall n. Num n => [(n, String)]
miBraids_mode_dict =
[(n
0,String
"CSAW")
,(n
1,String
"MORPH")
,(n
2,String
"SAW_SQUARE")
,(n
3,String
"SINE_TRIANGLE")
,(n
4,String
"BUZZ")
,(n
5,String
"SQUARE_SUB")
,(n
6,String
"SAW_SUB")
,(n
7,String
"SQUARE_SYNC")
,(n
8,String
"SAW_SYNC")
,(n
9,String
"TRIPLE_SAW")
,(n
10,String
"TRIPLE_SQUARE")
,(n
11,String
"TRIPLE_TRIANGLE")
,(n
12,String
"TRIPLE_SINE")
,(n
13,String
"TRIPLE_RING_MOD")
,(n
14,String
"SAW_SWARM")
,(n
15,String
"SAW_COMB")
,(n
16,String
"TOY")
,(n
17,String
"DIGITAL_FILTER_LP")
,(n
18,String
"DIGITAL_FILTER_PK")
,(n
19,String
"DIGITAL_FILTER_BP")
,(n
20,String
"DIGITAL_FILTER_HP")
,(n
21,String
"VOSIM")
,(n
22,String
"VOWEL")
,(n
23,String
"VOWEL_FOF")
,(n
24,String
"HARMONICS")
,(n
25,String
"FM")
,(n
26,String
"FEEDbACK_FM")
,(n
27,String
"CHAOTIC_FEEDbACK_FM")
,(n
28,String
"PLUCKED")
,(n
29,String
"BOWED")
,(n
30,String
"BLOWN")
,(n
31,String
"FLUTED")
,(n
32,String
"STRUCK_BELL")
,(n
33,String
"STRUCK_DRUM")
,(n
34,String
"KICK")
,(n
35,String
"CYMBAL")
,(n
36,String
"SNARE")
,(n
37,String
"WAVETABLES")
,(n
38,String
"WAVE_MAP")
,(n
39,String
"WAVE_LINE")
,(n
40,String
"WAVE_PARAPHONIC")
,(n
41,String
"FILTERED_NOISE")
,(n
42,String
"TWIN_PEAKS_NOISE")
,(n
43,String
"CLOCKED_NOISE")
,(n
44,String
"GRANULAR_CLOUD")
,(n
45,String
"PARTICLE_NOISE")
,(n
46,String
"DIGITAL_MODULATION")
,(n
47,String
"QUESTION_MARK")]
miBraids_mode_maybe :: Num n => String -> Maybe n
miBraids_mode_maybe :: forall n. Num n => String -> Maybe n
miBraids_mode_maybe String
x = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. (a, b) -> a
fst (forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Maybe a
find ((forall a. Eq a => a -> a -> Bool
== String
x) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a, b) -> b
snd) forall n. Num n => [(n, String)]
miBraids_mode_dict)
miBraids_mode :: Num n => String -> n
miBraids_mode :: forall n. Num n => String -> n
miBraids_mode = forall a. a -> Maybe a -> a
fromMaybe (forall a. HasCallStack => String -> a
error String
"miBraids_mode?") forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall n. Num n => String -> Maybe n
miBraids_mode_maybe
miClouds_mode_dict :: Num n => [(n,String)]
miClouds_mode_dict :: forall n. Num n => [(n, String)]
miClouds_mode_dict =
[(n
0,String
"GRANULAR")
,(n
1,String
"STRETCH")
,(n
2,String
"LOOPING_DELAY")
,(n
3,String
"SPECTRAL")]
miClouds_mode_maybe :: Num n => String -> Maybe n
miClouds_mode_maybe :: forall n. Num n => String -> Maybe n
miClouds_mode_maybe String
x = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. (a, b) -> a
fst (forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Maybe a
find ((forall a. Eq a => a -> a -> Bool
== String
x) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a, b) -> b
snd) forall n. Num n => [(n, String)]
miClouds_mode_dict)
miClouds_mode :: Num n => String -> n
miClouds_mode :: forall n. Num n => String -> n
miClouds_mode = forall a. a -> Maybe a -> a
fromMaybe (forall a. HasCallStack => String -> a
error String
"miClouds_mode?") forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall n. Num n => String -> Maybe n
miClouds_mode_maybe
miPlaits_mode_dict :: Num n => [(n,String)]
miPlaits_mode_dict :: forall n. Num n => [(n, String)]
miPlaits_mode_dict =
[(n
0,String
"virtual_analog")
,(n
1,String
"waveshaping")
,(n
2,String
"fm")
,(n
3,String
"grain")
,(n
4,String
"additive")
,(n
5,String
"wavetable")
,(n
6,String
"chord")
,(n
7,String
"speech")
,(n
8,String
"swarm")
,(n
9,String
"noise")
,(n
10,String
"particle")
,(n
11,String
"string")
,(n
12,String
"modal")
,(n
13,String
"bass_drum")
,(n
14,String
"snare_drum")
,(n
15,String
"hi_hat")]
miPlaits_mode_maybe :: Num n => String -> Maybe n
miPlaits_mode_maybe :: forall n. Num n => String -> Maybe n
miPlaits_mode_maybe String
x = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. (a, b) -> a
fst (forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Maybe a
find ((forall a. Eq a => a -> a -> Bool
== String
x) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a, b) -> b
snd) forall n. Num n => [(n, String)]
miPlaits_mode_dict)
miPlaits_mode :: Num n => String -> n
miPlaits_mode :: forall n. Num n => String -> n
miPlaits_mode = forall a. a -> Maybe a -> a
fromMaybe (forall a. HasCallStack => String -> a
error String
"miPlaits_mode?") forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall n. Num n => String -> Maybe n
miPlaits_mode_maybe
miRings_mode_dict :: Num n => [(n,String)]
miRings_mode_dict :: forall n. Num n => [(n, String)]
miRings_mode_dict =
[(n
0,String
"MODAL_RESONATOR")
,(n
1,String
"SYMPATHETIC_STRING")
,(n
2,String
"MODULATED/INHARMONIC_STRING")
,(n
3,String
"2-OP_FM_VOICE")
,(n
4,String
"SYMPATHETIC_STRING_QUANTIZED")
,(n
5,String
"STRING_AND_REVERB")]
miRings_mode_maybe :: Num n => String -> Maybe n
miRings_mode_maybe :: forall n. Num n => String -> Maybe n
miRings_mode_maybe String
x = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. (a, b) -> a
fst (forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Maybe a
find ((forall a. Eq a => a -> a -> Bool
== String
x) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a, b) -> b
snd) forall n. Num n => [(n, String)]
miRings_mode_dict)
miRings_mode :: Num n => String -> n
miRings_mode :: forall n. Num n => String -> n
miRings_mode = forall a. a -> Maybe a -> a
fromMaybe (forall a. HasCallStack => String -> a
error String
"miRings_mode?") forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall n. Num n => String -> Maybe n
miRings_mode_maybe
pulseDPW :: Rate -> Ugen -> Ugen -> Ugen
pulseDPW :: Rate -> Ugen -> Ugen -> Ugen
pulseDPW Rate
rt Ugen
freq Ugen
width =
let o1 :: Ugen
o1 = Rate -> Ugen -> Ugen -> Ugen
External.sawDPW Rate
rt Ugen
freq Ugen
0
o2 :: Ugen
o2 = Rate -> Ugen -> Ugen -> Ugen
External.sawDPW Rate
rt Ugen
freq (forall n. RealFrac n => (n, n) -> n -> n
wrap_hs (-Ugen
1,Ugen
1) (Ugen
widthforall a. Num a => a -> a -> a
+Ugen
width))
in Ugen
o1 forall a. Num a => a -> a -> a
- Ugen
o2
pv_SplitUnpack :: Ugen -> Ugen -> (Ugen,Ugen)
pv_SplitUnpack :: Ugen -> Ugen -> (Ugen, Ugen)
pv_SplitUnpack Ugen
a Ugen
b =
case Ugen -> [Ugen]
mceChannels (Ugen -> Ugen -> Ugen
External.pv_Split Ugen
a Ugen
b) of
[Ugen
p,Ugen
q] -> (Ugen
p,Ugen
q)
[Ugen]
_ -> forall a. HasCallStack => String -> a
error String
"pv_SplitUnpack"
pv_SplitAllocId :: ID i => i -> Ugen -> Ugen
pv_SplitAllocId :: forall i. ID i => i -> Ugen -> Ugen
pv_SplitAllocId i
z Ugen
u =
case Ugen -> Either String Ugen
pv_track_nframes Ugen
u of
Left String
err -> forall a. HasCallStack => String -> a
error String
err
Right Ugen
nf -> let b :: Ugen
b = forall a. ID a => a -> Ugen -> Ugen -> Ugen
Db.localBufId i
z Ugen
nf Ugen
1 in Ugen -> Ugen -> Ugen
External.pv_Split Ugen
u Ugen
b
pv_SplitAllocM :: Uid m => Ugen -> m Ugen
pv_SplitAllocM :: forall (m :: * -> *). Uid m => Ugen -> m Ugen
pv_SplitAllocM = forall (m :: * -> *) a b. Uid m => (Int -> Fn1 a b) -> Fn1 a (m b)
liftUid1 forall i. ID i => i -> Ugen -> Ugen
pv_SplitAllocId
pv_SplitAlloc :: Ugen -> Ugen
pv_SplitAlloc :: Ugen -> Ugen
pv_SplitAlloc = forall a r. (a -> IO r) -> a -> r
liftUnsafe1 forall (m :: * -> *). Uid m => Ugen -> m Ugen
pv_SplitAllocM
pv_SplitAllocUnpackId :: ID i => i -> Ugen -> (Ugen,Ugen)
pv_SplitAllocUnpackId :: forall i. ID i => i -> Ugen -> (Ugen, Ugen)
pv_SplitAllocUnpackId i
z Ugen
u =
case Ugen -> [Ugen]
mceChannels (forall i. ID i => i -> Ugen -> Ugen
pv_SplitAllocId i
z Ugen
u) of
[Ugen
p,Ugen
q] -> (Ugen
p,Ugen
q)
[Ugen]
_ -> forall a. HasCallStack => String -> a
error String
"pv_SplitAllocUnpackId"