module Synth.Sampler.Patch.WayangCode where
import qualified Cmd.Instrument.Bali as Bali
import qualified Cmd.Instrument.ImInst as ImInst
import qualified Derive.C.Bali.Gender as Gender
import qualified Derive.C.Prelude.Note as Note
import qualified Derive.Call as Call
import qualified Derive.Call.Sub as Sub
import qualified Derive.Derive as Derive
import qualified Derive.Instrument.DUtil as DUtil
import qualified Synth.Sampler.Patch.Lib.Code as Code
code :: ImInst.Code
code :: Code
code = forall a. Monoid a => [a] -> a
mconcat
[ Generator Note -> Code
ImInst.null_call Generator Note
note
]
note :: Derive.Generator Derive.Note
note :: Generator Note
note = CallName
-> Doc
-> (NoteArgs -> NoteDeriver)
-> (NoteArgs -> NoteDeriver)
-> Generator Note
DUtil.zero_duration CallName
"note"
Doc
"When zero duration, and use-weak=t, use the `weak` call.\
\ When `symbolic-pitch=t`, tell the samples to use pitch by name rather\
\ than nn."
(forall d.
(PassedArgs d -> NoteDeriver) -> PassedArgs d -> NoteDeriver
Sub.inverting forall a b. (a -> b) -> a -> b
$ \NoteArgs
args -> forall {a}. Deriver a -> Deriver a
transform forall a b. (a -> b) -> a -> b
$ forall val a.
(Eq val, Typecheck val) =>
Key -> Maybe val -> Deriver a -> Deriver a -> Deriver a
Call.if_env Key
"use-weak" (forall a. a -> Maybe a
Just Bool
True)
(forall a. PassedArgs a -> NoteDeriver
Gender.weak_call NoteArgs
args)
(forall a. Y -> Deriver a -> Deriver a
Call.multiply_dynamic Y
0.65 (NoteArgs -> NoteDeriver
Bali.reapply_mute NoteArgs
args)))
(forall d.
(PassedArgs d -> NoteDeriver) -> PassedArgs d -> NoteDeriver
Sub.inverting forall a b. (a -> b) -> a -> b
$ \NoteArgs
args -> forall {a}. Deriver a -> Deriver a
transform (NoteArgs -> NoteDeriver
note NoteArgs
args))
where
note :: NoteArgs -> NoteDeriver
note = Config -> NoteArgs -> NoteDeriver
Note.default_note Config
Note.use_attributes
transform :: Deriver a -> Deriver a
transform = forall {a}. Deriver a -> Deriver a
Code.withVariation