diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2018-05-15 18:49:14 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2018-05-15 18:49:14 +0200 |
commit | 55cee1104651ec938b8f4412993780b766a30f33 (patch) | |
tree | d6141e6f8814d4b2656aac1f04196a554cf69574 | |
parent | 011a884bf286ab4ed908b7b040091b92489eb653 (diff) | |
download | trivmix-55cee1104651ec938b8f4412993780b766a30f33.tar trivmix-55cee1104651ec938b8f4412993780b766a30f33.tar.gz trivmix-55cee1104651ec938b8f4412993780b766a30f33.tar.bz2 trivmix-55cee1104651ec938b8f4412993780b766a30f33.tar.xz trivmix-55cee1104651ec938b8f4412993780b766a30f33.zip |
…
-rw-r--r-- | trivmix.cabal | 2 | ||||
-rw-r--r-- | trivmix.nix | 2 | ||||
-rw-r--r-- | trivmix/Trivmix.hs | 3 |
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 | ||
4 | name: trivmix | 4 | name: trivmix |
5 | version: 3.3.0 | 5 | version: 3.3.1 |
6 | -- synopsis: | 6 | -- synopsis: |
7 | -- description: | 7 | -- description: |
8 | license: PublicDomain | 8 | license: 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 | }: |
6 | mkDerivation { | 6 | mkDerivation { |
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 | ||
193 | mix :: MVar Level -> CFloat -> IO CFloat | 194 | mix :: MVar Level -> CFloat -> IO CFloat |
194 | mix level input = do | 195 | mix level input = do |