module Sound.SC3.UGen.Enum where
import qualified Sound.SC3.Common.Envelope as E
import Sound.SC3.UGen.Type
data Loop' t = Loop
| NoLoop
| WithLoop t
deriving (Eq, Show)
type Loop = Loop' UGen
from_loop :: Num t => Loop' t -> t
from_loop e =
case e of
NoLoop -> 0
Loop -> 1
WithLoop u -> u
data Interpolation = NoInterpolation
| LinearInterpolation
| CubicInterpolation
| Interpolation UGen
deriving (Eq, Show)
from_interpolation :: Interpolation -> UGen
from_interpolation e =
case e of
NoInterpolation -> 1
LinearInterpolation -> 2
CubicInterpolation -> 4
Interpolation u -> u
data DoneAction = DoNothing
| PauseSynth
| RemoveSynth
| RemoveGroup
| DoneAction UGen
deriving (Eq, Show)
from_done_action :: DoneAction -> UGen
from_done_action e =
case e of
DoNothing -> 0
PauseSynth -> 1
RemoveSynth -> 2
RemoveGroup -> 14
DoneAction u -> u
data Warp = Linear
| Exponential
| Warp UGen
deriving (Eq, Show)
from_warp :: Warp -> UGen
from_warp e =
case e of
Linear -> 0
Exponential -> 1
Warp u -> u
type EnvCurve = E.Envelope_Curve UGen
data Buffer = Buffer_Id Int
| Buffer UGen
deriving (Eq, Show)
from_buffer :: Buffer -> UGen
from_buffer b =
case b of
Buffer_Id i -> constant i
Buffer u -> u