{- wavedrum-lib, a library to parse, edit and write Korg Wavedrum programs. Copyright (C) 2013 Ricardo Wurmus This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . -} module Wavedrum.Types where import qualified Data.Text as T type Range = (Int, Int) data Target = RimAlg | RimPCM | HeadAlg | HeadPCM | General deriving (Show, Eq) -- TODO: value is not just Int, but can be an algorithm, PCM instrument, a velocity curve etc. -- data Value = Value Int -- | Alg Algorithm -- | PCM String data Param = Param { target :: !Target , name :: !T.Text , range :: !Range , value :: !Int } deriving (Eq) instance Show Param where show p = "Param " ++ show (name p) ++ " = " ++ show (value p) ++ " [min " ++ show (fst (range p)) ++ ", max " ++ show (snd (range p)) ++ "]" type Program = [Param] {- This is the order of parameters in a program: 07.1 Type 01.1 02.1 03.1 04.1 05.1 Hd.1 Hd.2 Hd.3 Hd.4 Hd.5 Hd.6 Hd.7 Hd.8 01.3 02.3 03.3 04.3 05.3 Rm.1 Rm.2 Rm.3 Rm.4 Rm.5 Rm.6 Rm.7 Rm.8 01.2 02.2 03.2 04.2 05.2 06.2 07.2 08.2 09.2 01.4 02.4 03.4 04.4 05.4 06.4 07.4 08.4 09.4 10.1 10.2 10.3 10.4 11.3 11.2 11.1 11.4 -}