module User.Elaforge.Instrument.Reaktor where
import qualified Data.Set as Set
import qualified Util.Doc as Doc
import qualified Cmd.Instrument.MidiInst as MidiInst
import qualified Derive.Attrs as Attrs
import qualified Derive.Controls as Controls
import qualified Derive.Instrument.DUtil as DUtil
import qualified Derive.ScoreT as ScoreT
import qualified Instrument.InstT as InstT
import qualified Midi.CC as CC
import qualified Midi.Midi as Midi
import qualified Perform.Midi.Patch as Patch
import Global
synth :: MidiInst.Synth
synth :: Synth
synth = Text -> Text -> [Patch] -> Synth
MidiInst.synth Text
"reaktor" Text
"Native Instruments Reaktor" [Patch]
patches
resonant_filter :: MidiInst.Code
resonant_filter :: Code
resonant_filter = Generator Note -> Code
MidiInst.null_call forall a b. (a -> b) -> a -> b
$
CallName -> Controls -> PControl -> Controls -> Generator Note
DUtil.double_pitch CallName
"res" forall a. Monoid a => a
mempty PControl
"res"
(forall a. Ord a => [a] -> Set a
Set.fromList [Control
"mix", Control
"q", Control
"lp-hp", Control
"2-4-pole"])
patch :: InstT.Name -> [(Midi.Control, ScoreT.Control)] -> MidiInst.Patch
patch :: Text -> [(Control, Control)] -> Patch
patch = PbRange -> Text -> [(Control, Control)] -> Patch
MidiInst.named_patch (-Int
96, Int
96)
patches :: [MidiInst.Patch]
patches :: [Patch]
patches =
[ Patch -> Patch
MidiInst.pressure forall a b. (a -> b) -> a -> b
$ Text -> [(Control, Control)] -> Patch
patch Text
"fm1" [(Control
4, Control
"depth")]
, Lens Patch Doc
MidiInst.doc forall f a. Lens f a -> a -> f -> f
#= Doc
"Tunable comb filter that processes an audio signal." forall a b. (a -> b) -> a -> b
$
Text -> [(Control, Control)] -> Patch
patch Text
"comb" [(Control
1, Control
"mix"), (Control
4, Control
"fbk")]
, Lens Patch Doc
MidiInst.doc forall f a. Lens f a -> a -> f -> f
#= Doc
"Tunable filter that processes an audio signal." forall a b. (a -> b) -> a -> b
$
Text -> [(Control, Control)] -> Patch
patch Text
"filter"
[ (Control
1, Control
"mix")
, (Control
CC.cc14, Control
"q")
, (Control
CC.cc15, Control
"lp-hp")
, (Control
CC.cc16, Control
"2-4-pole")
]
, Text -> [(Control, Control)] -> Patch
patch Text
"lazerbass"
[ (Control
CC.cc14, Control
Controls.mc1), (Control
CC.cc15, Control
Controls.mc2)
]
, Text -> [(Control, Control)] -> Patch
patch Text
"steam"
[]
, Text -> [(Control, Control)] -> Patch
patch Text
"spark"
[ (Control
4, Control
Controls.mc1), (Control
11, Control
Controls.mc2), (Control
1, Control
Controls.mc3)
, (Control
CC.cc14, Control
Controls.lpf)
, (Control
CC.cc15, Control
Controls.q)
]
, Text -> [(Control, Control)] -> Patch
patch Text
"prism"
[ (Control
1, Control
Controls.mc1)
, (Control
11, Control
Controls.mc2)
]
, Text -> [(Control, Control)] -> Patch
patch Text
"shark"
[ (Control
4, Control
Controls.lpf), (Control
3, Control
Controls.q)
, (Control
10, Control
"color")
]
, Lens Patch Doc
MidiInst.doc forall f a. Lens f a -> a -> f -> f
#= Doc
"Herald brass physical model." forall a b. (a -> b) -> a -> b
$
Patch -> Patch
MidiInst.pressure forall a b. (a -> b) -> a -> b
$ Text -> [(Control, Control)] -> Patch
patch Text
"herald"
[ (Control
CC.mod, Control
Controls.vib)
, (Control
CC.vib_speed, Control
Controls.vib_speed)
, (Control
CC.cc14, Control
"atk")
, (Control
CC.cc15, Control
"buzz")
, (Control
CC.cc16, Control
"buzz-len")
, (Control
CC.cc17, Control
"emb")
, (Control
CC.cc18, Control
"stiff")
, (Control
CC.cc20, Control
"finger")
, (Control
CC.cc21, Control
"flut")
, (Control
CC.cc22, Control
"flut-speed")
]
, Lens Patch Doc
MidiInst.doc forall f a. Lens f a -> a -> f -> f
#= Doc
"Serenade bowed string physical model." forall a b. (a -> b) -> a -> b
$
Patch :-> Patch
MidiInst.patch forall a b c. Lens a b -> Lens b c -> Lens a c
# Patch :-> AttributeMap
Patch.attribute_map forall f a. Lens f a -> a -> f -> f
#=
[(Control, [(Attributes, Control)])] -> AttributeMap
Patch.cc_keyswitches [(Control
CC.cc20, [(Attributes
Attrs.pizz, Control
127), (forall a. Monoid a => a
mempty, Control
0)])] forall a b. (a -> b) -> a -> b
$
Patch -> Patch
MidiInst.pressure forall a b. (a -> b) -> a -> b
$ PbRange -> Text -> [(Control, Control)] -> Patch
MidiInst.named_patch (-Int
24, Int
24) Text
"serenade"
[ (Control
CC.mod, Control
Controls.vib)
, (Control
CC.vib_speed, Control
Controls.vib_speed)
, (Control
CC.cc14, Control
"bow-speed")
, (Control
CC.cc15, Control
"bow-force")
, (Control
CC.cc16, Control
"bow-pos")
, (Control
CC.cc17, Control
"string-jitter")
, (Control
CC.cc18, Control
"string-buzz")
, (Control
CC.cc21, Control
"pizz-tone")
, (Control
CC.cc22, Control
"pizz-time")
, (Control
CC.cc23, Control
"pizz-level")
]
] forall a. [a] -> [a] -> [a]
++ [Patch]
silverwood_patches
silverwood_patches :: [MidiInst.Patch]
silverwood_patches :: [Patch]
silverwood_patches =
[ Text -> [(Control, Control)] -> Patch
mk Text
"clarinet" [(Control
CC.cc16, Control
"register")]
, Text -> [(Control, Control)] -> Patch
mk Text
"flute" [(Control
CC.cc17, Control
"embouch")]
, Text -> [(Control, Control)] -> Patch
mk Text
"brass" [(Control
CC.cc17, Control
"embouch")]
, Text -> [(Control, Control)] -> Patch
mk Text
"sax" [(Control
CC.cc18, Control
"exc"), (Control
CC.cc19, Control
"effic")]
, Text -> [(Control, Control)] -> Patch
mk Text
"recorder" []
]
where
mk :: Text -> [(Control, Control)] -> Patch
mk Text
name [(Control, Control)]
controls =
Lens Patch Doc
MidiInst.doc forall f a. Lens f a -> a -> f -> f
#=
(Doc
"Silverwood woodwind physical model: " forall a. Semigroup a => a -> a -> a
<> Text -> Doc
Doc.Doc Text
name) forall a b. (a -> b) -> a -> b
$
Patch -> Patch
MidiInst.pressure forall a b. (a -> b) -> a -> b
$ Text -> [(Control, Control)] -> Patch
patch (Text
"sw-" forall a. Semigroup a => a -> a -> a
<> Text
name) forall a b. (a -> b) -> a -> b
$
[ (Control
CC.mod, Control
Controls.vib)
, (Control
CC.vib_speed, Control
Controls.vib_speed)
, (Control
CC.cc14, Control
"trem")
, (Control
CC.cc15, Control
"growl")
] forall a. [a] -> [a] -> [a]
++ [(Control, Control)]
controls