-- Copyright 2022 Evan Laforge
-- This program is distributed under the terms of the GNU General Public
-- License 3.0, see COPYING or http://www.gnu.org/licenses/gpl-3.0.txt

module User.Generic.Instrument.Surge where
import qualified Data.String as String

import qualified Cmd.Instrument.MidiInst as MidiInst


synth :: MidiInst.Synth
synth :: Synth
synth =
    SynthName -> SynthName -> [Patch] -> Synth
MidiInst.synth SynthName
"surge" SynthName
"https://surge-synthesizer.github.io/index.html" forall a b. (a -> b) -> a -> b
$
        [(Control, Control)] -> [Patch] -> [Patch]
MidiInst.synth_controls [(Control, Control)]
controls
        [PbRange -> [(Control, Control)] -> Patch
MidiInst.default_patch PbRange
pb_range []]
    where
    controls :: [(Control, Control)]
controls = [(Control
40 forall a. Num a => a -> a -> a
+ Control
n, forall a. IsString a => String -> a
String.fromString forall a b. (a -> b) -> a -> b
$ String
"macro" forall a. Semigroup a => a -> a -> a
<> forall a. Show a => a -> String
show Control
n) | Control
n <- [Control
1..Control
8]]

-- PB range when in MPE mode.
pb_range :: (Int, Int)
pb_range :: PbRange
pb_range = (-Int
48, Int
48)