Commit 0c2a2ea9 authored by Guerric Chupin's avatar Guerric Chupin

Removed most warnings.

parent 1364e9e7
......@@ -34,6 +34,7 @@ onChange' = proc x -> do
x' <- stepBack -< x
returnA -< makeEvent x x'
makeEvent :: (Eq a) => a -> Maybe a -> Event a
makeEvent x x'
| isNothing x' = Event x
| otherwise = let x'' = fromJust x' in
......
......@@ -100,8 +100,7 @@ liftW3 f a b c = ReactiveFieldWrite setter
reactiveValueWrite b x2
reactiveValueWrite c x3
liftRW3 :: ( Monad m
, ReactiveValueReadWrite a b m
liftRW3 :: ( ReactiveValueReadWrite a b m
, ReactiveValueReadWrite c d m
, ReactiveValueReadWrite e f m) =>
BijectiveFunc i (b,d,f)
......@@ -115,8 +114,7 @@ liftRW3 bij a b c =
ReactiveFieldWrite setter = liftW3 f1 a b c
(f1, f2) = (direct bij, inverse bij)
liftR4 :: ( Monad m
, ReactiveValueRead a b m
liftR4 :: ( ReactiveValueRead a b m
, ReactiveValueRead c d m
, ReactiveValueRead e f m
, ReactiveValueRead g h m) =>
......@@ -158,8 +156,7 @@ liftW4 f a b c d = ReactiveFieldWrite setter
reactiveValueWrite c x3
reactiveValueWrite d x4
liftRW4 :: ( Monad m
, ReactiveValueReadWrite a b m
liftRW4 :: ( ReactiveValueReadWrite a b m
, ReactiveValueReadWrite c d m
, ReactiveValueReadWrite e f m
, ReactiveValueReadWrite g h m) =>
......
......@@ -26,6 +26,7 @@ data GUICell = GUICell { cellAction :: Action
, asPh :: Bool
} deriving(Show)
rotateGUICell :: GUICell -> GUICell
rotateGUICell g = g { cellAction = rotateAction $ cellAction g }
where rotateAction (ChDir b na d) = ChDir b na (nextDir d)
rotateAction x = x
......@@ -51,13 +52,19 @@ tileW :: Int
tileW = 40
tileH :: Int
tileH = round (sqrt 3 * fromIntegral tileW / 3)
tileH = round d
where d :: Double
d = sqrt 3 * fromIntegral tileW / 3
hexW :: Int
hexW = round (4 * fromIntegral tileW / 3)
hexW = round d
where d :: Double
d = 4 * fromIntegral tileW / 3
hexH :: Int
hexH = round (sqrt 3 * fromIntegral hexW / 2)
hexH = round d
where d :: Double
d = sqrt 3 * fromIntegral hexW / 2
xMax, yMax :: Int
(xMax,yMax) = BF.second (*2) $ neighbor N nec
......@@ -108,12 +115,6 @@ validArea = filter (onBoard . fromGUICoords) $
outGUIBoard :: (Int,Int) -> Bool
outGUIBoard (xf,yf) = xf < xMin || xf > xMax || yf < yMin || yf > yMax
na = NoteAttr {
naArt = Accent13,
naDur = 1 % 1,
naOrn = Ornaments Nothing [] NoSlide
}
inertCell :: GUICell
inertCell = GUICell { cellAction = Inert
, repeatCount = 1
......
......@@ -37,7 +37,7 @@ mkClockGeneric io d = do
modifyCBMVar n return
io
return (n, tid)
where dInt = floor $ d * (10^3)
where dInt = floor $ d * 1000
-- Ticking clock in the IO monad, sending callbacks every t milliseconds.
mkClock :: DTime -> IO TickingClock
......
......@@ -118,7 +118,9 @@ type MIDINN = Int
-- Assume MIDI convetion: 60 = "Middle C" = C4
middleC :: Int
middleC = 60
middleCOct :: MIDINN
middleCOct = 4
......@@ -187,6 +189,7 @@ data Articulation = NoAccent
| Accent24
deriving (Eq, Show, Enum)
accentStrength :: Strength
accentStrength = 1.2
-- Articulated strength
......@@ -564,12 +567,12 @@ runRMCA bd bpb mri tr st
ppNotes :: BeatsPerBar -> [[Note]] -> IO ()
ppNotes bpb nss = ppnAux (zip [(br,bn) | br <- [1..], bn <- [1..bpb]] nss)
where
ppnAux [] = return ()
ppnAux ((_, []) : tnss) = ppnAux tnss
ppnAux ((t, ns) : tnss) = do
where ppnAux :: [((Int,BeatsPerBar),[Note])] -> IO ()
ppnAux [] = return ()
ppnAux ((_, []) : tnss) = ppnAux tnss
ppnAux ((t, ns) : tnss) = do
putStrLn (leftJustify 10 (show t) ++ ": "
++ intercalate ", " (map show ns))
++ intercalate ", " (map show ns))
ppnAux tnss
......
......@@ -27,7 +27,9 @@ noteToMessages :: LTempo
noteToMessages layTempo sr chan =
proc (t,n@Note { noteDur = d }) -> do
nm <- noteOnToMessage chan -< n
let dt = fromRational (d * toRational (tempoToQNoteIvl layTempo))
let dt :: Double
dt = fromRational (d * toRational (tempoToQNoteIvl layTempo))
dn :: Int
dn = floor $ dt * fromIntegral sr
returnA -< [(t,nm),(t + dn,switchOnOff nm)]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment