Initial commit
[wavedrum/wavedrum-lib.git] / Wavedrum / Types.hs
1 {-
2 wavedrum-lib, a library to parse, edit and write Korg Wavedrum programs.
3 Copyright (C) 2013 Ricardo Wurmus
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 -}
18
19 module Wavedrum.Types where
20
21 import qualified Data.Text as T
22
23 type Range = (Int, Int)
24
25 data Target = RimAlg
26 | RimPCM
27 | HeadAlg
28 | HeadPCM
29 | General deriving (Show, Eq)
30
31 -- TODO: value is not just Int, but can be an algorithm, PCM instrument, a velocity curve etc.
32
33 -- data Value = Value Int
34 -- | Alg Algorithm
35 -- | PCM String
36
37 data Param = Param {
38 target :: !Target
39 , name :: !T.Text
40 , range :: !Range
41 , value :: !Int
42 } deriving (Eq)
43
44 instance Show Param where
45 show p = "Param " ++ show (name p) ++
46 " = " ++ show (value p) ++
47 " [min " ++ show (fst (range p)) ++
48 ", max " ++ show (snd (range p)) ++ "]"
49
50 type Program = [Param]
51
52 {-
53 This is the order of parameters in a program:
54
55 07.1 Type
56 01.1 02.1 03.1 04.1 05.1
57
58 Hd.1 Hd.2 Hd.3 Hd.4
59 Hd.5 Hd.6 Hd.7 Hd.8
60
61 01.3 02.3 03.3 04.3 05.3
62
63 Rm.1 Rm.2 Rm.3 Rm.4
64 Rm.5 Rm.6 Rm.7 Rm.8
65
66 01.2 02.2 03.2 04.2
67 05.2 06.2 07.2 08.2 09.2
68
69 01.4 02.4 03.4 04.4
70 05.4 06.4 07.4 08.4 09.4
71
72 10.1 10.2 10.3 10.4
73 11.3 11.2 11.1 11.4
74 -}