-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMeasureTest.hs
More file actions
62 lines (54 loc) · 2.97 KB
/
Copy pathMeasureTest.hs
File metadata and controls
62 lines (54 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
-- This file is part of KSQuant2.
-- Copyright (c) 2010 - 2011, Kilian Sprotte. All rights reserved.
-- 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 <http://www.gnu.org/licenses/>.
module MeasureTest
where
import qualified Measure as M ( M(M), E(D), l, measuresWithBeats, measureDur )
import Test.HUnit (Test(TestList), (~=?))
import Data.Ratio ( (%) )
import qualified Lisp as L (n60, nil)
measure1 :: Test
measure1 = TestList
[[M.M (4,4) (4,60 % 1)
(M.D (1 % 1) (1 % 1)
[M.l (1 % 4) False L.n60 L.nil,
M.l (1 % 4) False L.n60 L.nil,
M.l (1 % 4) False L.n60 L.nil,
M.l (1 % 4) False L.n60 L.nil])]
~=? M.measuresWithBeats [(4,4)] [(4,60)]
,[M.M (3,4) (4,60 % 1)
(M.D (3 % 4) (1 % 1)
[M.l (1 % 4) False L.n60 L.nil,
M.l (1 % 4) False L.n60 L.nil,
M.l (1 % 4) False L.n60 L.nil])]
~=? M.measuresWithBeats [(3,4)] [(4,60)]
,[M.M (5,8) (4,60 % 1)
(M.D (5 % 8) (1 % 1)
(replicate 5 (M.l (1 % 8) False L.n60 L.nil)))]
~=? M.measuresWithBeats [(5,8)] [(4,60)]
,[1,2,3,4,5]
~=? map M.measureDur (M.measuresWithBeats [(1,4),(2,4),(3,4),(4,4),(5,4)] [(4,60),(4,60),(4,60),(4,60),(4,60)])
,[1%2,2%2,3%2,4%2,5%2]
~=? map M.measureDur (M.measuresWithBeats [(1,4),(2,4),(3,4),(4,4),(5,4)] [(4,120),(4,120),(4,120),(4,120),(4,120)])
,[1%2,2%2,3%2,4%2,5%2]
~=? map M.measureDur (M.measuresWithBeats [(1,4),(2,4),(3,4),(4,4),(5,4)] [(8,60),(8,60),(8,60),(8,60),(8,60)])
,[1%4,2%4,3%4,4%4,5%4]
~=? map M.measureDur (M.measuresWithBeats [(1,4),(2,4),(3,4),(4,4),(5,4)] [(8,120),(8,120),(8,120),(8,120),(8,120)])
,[1%2,2%2,3%2,4%2,5%2]
~=? map M.measureDur (M.measuresWithBeats [(1,8),(2,8),(3,8),(4,8),(5,8)] [(4,60),(4,60),(4,60),(4,60),(4,60)])
,[1%4,2%4,3%4,4%4,5%4]
~=? map M.measureDur (M.measuresWithBeats [(1,8),(2,8),(3,8),(4,8),(5,8)] [(4,120),(4,120),(4,120),(4,120),(4,120)])
,[1%4,2%4,3%4,4%4,5%4]
~=? map M.measureDur (M.measuresWithBeats [(1,8),(2,8),(3,8),(4,8),(5,8)] [(8,60),(8,60),(8,60),(8,60),(8,60)])
,[1%8,2%8,3%8,4%8,5%8]
~=? map M.measureDur (M.measuresWithBeats [(1,8),(2,8),(3,8),(4,8),(5,8)] [(8,120),(8,120),(8,120),(8,120),(8,120)])
]