-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAdjoinTies.hs
More file actions
57 lines (48 loc) · 1.98 KB
/
AdjoinTies.hs
File metadata and controls
57 lines (48 loc) · 1.98 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
-- 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 AdjoinTies (adjoinTies)
where
import qualified Measure as M ( M(M), E(L,D) )
import Data.Ratio ((%))
import qualified Lisp as L ( nil, n60 )
--import Debug.Trace
adjoinTies' :: M.M -> M.M
adjoinTies' x
| x == M.M (1,4) (4,60 % 1)
(M.D (1 % 4) (1 % 1)
[M.D (1 % 4) (2 % 3)
[M.L (1 % 8) True 0 L.n60 L.nil
,M.L (1 % 8) False 0 L.n60 L.nil
,M.L (1 % 8) False 0 L.n60 L.nil]]) =
M.M (1,4) (4,60 % 1)
(M.D (1 % 4) (1 % 1)
[M.D (1 % 4) (2 % 3)
[M.L (2 % 8) False 0 L.n60 L.nil
,M.L (1 % 8) False 0 L.n60 L.nil]])
| x == M.M (1,4) (4,60 % 1)
(M.D (1 % 4) (1 % 1)
[M.D (1 % 4) (1 % 1)
[M.L (1 % 16) True 0 L.n60 L.nil
,M.L (1 % 16) False 0 L.n60 L.nil
,M.L (1 % 16) False 0 L.n60 L.nil
,M.L (1 % 16) False 0 L.n60 L.nil]]) =
M.M (1,4) (4,60 % 1)
(M.D (1 % 4) (1 % 1)
[M.D (1 % 4) (1 % 1)
[M.L (1 % 8) False 0 L.n60 L.nil
,M.L (1 % 16) False 0 L.n60 L.nil
,M.L (1 % 16) False 0 L.n60 L.nil]])
| otherwise = x
adjoinTies :: M.M -> M.M
--adjoinTies = traceShowId . adjoinTies' . traceShowId
adjoinTies = adjoinTies'