summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2018-05-15 18:49:14 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2018-05-15 18:49:14 +0200
commit55cee1104651ec938b8f4412993780b766a30f33 (patch)
treed6141e6f8814d4b2656aac1f04196a554cf69574
parent011a884bf286ab4ed908b7b040091b92489eb653 (diff)
downloadtrivmix-55cee1104651ec938b8f4412993780b766a30f33.tar
trivmix-55cee1104651ec938b8f4412993780b766a30f33.tar.gz
trivmix-55cee1104651ec938b8f4412993780b766a30f33.tar.bz2
trivmix-55cee1104651ec938b8f4412993780b766a30f33.tar.xz
trivmix-55cee1104651ec938b8f4412993780b766a30f33.zip
-rw-r--r--trivmix.cabal2
-rw-r--r--trivmix.nix2
-rw-r--r--trivmix/Trivmix.hs3
3 files changed, 4 insertions, 3 deletions
diff --git a/trivmix.cabal b/trivmix.cabal
index 494e165..f5cf777 100644
--- a/trivmix.cabal
+++ b/trivmix.cabal
@@ -2,7 +2,7 @@
2-- documentation, see http://haskell.org/cabal/users-guide/ 2-- documentation, see http://haskell.org/cabal/users-guide/
3 3
4name: trivmix 4name: trivmix
5version: 3.3.0 5version: 3.3.1
6-- synopsis: 6-- synopsis:
7-- description: 7-- description:
8license: PublicDomain 8license: PublicDomain
diff --git a/trivmix.nix b/trivmix.nix
index 233cfb3..f5bb6c0 100644
--- a/trivmix.nix
+++ b/trivmix.nix
@@ -5,7 +5,7 @@
5}: 5}:
6mkDerivation { 6mkDerivation {
7 pname = "trivmix"; 7 pname = "trivmix";
8 version = "3.3.0"; 8 version = "3.3.1";
9 src = ./.; 9 src = ./.;
10 isLibrary = true; 10 isLibrary = true;
11 isExecutable = true; 11 isExecutable = true;
diff --git a/trivmix/Trivmix.hs b/trivmix/Trivmix.hs
index 69a3b50..41370cc 100644
--- a/trivmix/Trivmix.hs
+++ b/trivmix/Trivmix.hs
@@ -184,11 +184,12 @@ trivmix Options{..} = do
184 frames = interval * fps 184 frames = interval * fps
185 delay = round $ recip fps * 1e6 185 delay = round $ recip fps * 1e6
186 linInt x a b = a * (1 - x) + b * x 186 linInt x a b = a * (1 - x) + b * x
187 linInt' x a b = either error id $ asFloat (linInt x) a b 187 linInt' x a b = either (const 0) id $ asFloat (linInt x) a b
188 mulBalance (bToFloat -> b) x = either error id $ asFloat (*) (Lin . either error id $ refine b) x 188 mulBalance (bToFloat -> b) x = either error id $ asFloat (*) (Lin . either error id $ refine b) x
189 newLevel <- mulBalance <$> readMVar balance <*> readMVar level 189 newLevel <- mulBalance <$> readMVar balance <*> readMVar level
190 currentLevel <- readMVar level' 190 currentLevel <- readMVar level'
191 mapM_ (\x -> swapMVar level' (linInt' x currentLevel newLevel) >> threadDelay delay) [0,recip frames..1] 191 mapM_ (\x -> swapMVar level' (linInt' x currentLevel newLevel) >> threadDelay delay) [0,recip frames..1]
192 notifyWatchdog
192 193
193mix :: MVar Level -> CFloat -> IO CFloat 194mix :: MVar Level -> CFloat -> IO CFloat
194mix level input = do 195mix level input = do