Skip to content

Commit

Permalink
0.4.4.6 fixed bug affecting multichannel use of trunc, acosh, asinh, …
Browse files Browse the repository at this point in the history
…atanh, cosh, log10, sinh, and tanh
  • Loading branch information
dktr0 committed Jan 8, 2024
1 parent aaaff0b commit e595479
Show file tree
Hide file tree
Showing 6 changed files with 47,222 additions and 47,131 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# ChangeLog

0.4.4.6:

-fixed bug affecting multichannel use of trunc, acosh, asinh, atanh, cosh, log10, sinh, and tanh

0.4.4.5:

-fixed bug that was scrambling access to multiple image and video textures
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ clean:

devBuild:
cabal --ghcjs --builddir=dev-result new-build all --disable-library-profiling --disable-documentation --ghcjs-options=-DGHCJS_GC_INTERVAL=60000
cp -f dev-result/build/x86_64-linux/ghcjs-8.6.0.1/punctual-0.4.4.5/x/punctual/build/punctual/punctual.jsexe/index.html .
cp -f dev-result/build/x86_64-linux/ghcjs-8.6.0.1/punctual-0.4.4.5/x/punctual/build/punctual/punctual.jsexe/rts.js .
cp -f dev-result/build/x86_64-linux/ghcjs-8.6.0.1/punctual-0.4.4.5/x/punctual/build/punctual/punctual.jsexe/lib.js .
cp -f dev-result/build/x86_64-linux/ghcjs-8.6.0.1/punctual-0.4.4.5/x/punctual/build/punctual/punctual.jsexe/out.js .
cp -f dev-result/build/x86_64-linux/ghcjs-8.6.0.1/punctual-0.4.4.5/x/punctual/build/punctual/punctual.jsexe/runmain.js .
cp -f dev-result/build/x86_64-linux/ghcjs-8.6.0.1/punctual-0.4.4.6/x/punctual/build/punctual/punctual.jsexe/index.html .
cp -f dev-result/build/x86_64-linux/ghcjs-8.6.0.1/punctual-0.4.4.6/x/punctual/build/punctual/punctual.jsexe/rts.js .
cp -f dev-result/build/x86_64-linux/ghcjs-8.6.0.1/punctual-0.4.4.6/x/punctual/build/punctual/punctual.jsexe/lib.js .
cp -f dev-result/build/x86_64-linux/ghcjs-8.6.0.1/punctual-0.4.4.6/x/punctual/build/punctual/punctual.jsexe/out.js .
cp -f dev-result/build/x86_64-linux/ghcjs-8.6.0.1/punctual-0.4.4.6/x/punctual/build/punctual/punctual.jsexe/runmain.js .

devTest:
cabal --ghcjs new-test test:tests --disable-library-profiling --disable-documentation
Expand Down
4 changes: 2 additions & 2 deletions executable-src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ headElement = do

intro :: Text
intro
="-- Punctual, an audiovisual live coding language, version 0.4.4.5\n\
="-- Punctual, an audiovisual live coding language, version 0.4.4.6\n\
\-- Chromium/Chrome/Edge/Opera browser required\n\
\-- Press Shift-Enter to (re)evaluate/activate code\n\
\-- documentation @ https://github.com/dktr0/Punctual.git\n\
Expand All @@ -55,7 +55,7 @@ intro
main :: IO ()
main = do
hSetBuffering stdout LineBuffering
putStrLn "Punctual standalone, version 0.4.4.5"
putStrLn "Punctual standalone, version 0.4.4.6"
ctx <- getGlobalAudioContextPlayback
putStrLn "global audio context (playback mode) acquired"
putStrLn "loading MusicW audio worklets..."
Expand Down
16 changes: 8 additions & 8 deletions library-src/Sound/Punctual/FragmentShader.hs
Original file line number Diff line number Diff line change
Expand Up @@ -96,28 +96,28 @@ graphToGLSL ah env (UnRep n x) = do
-- unary functions from the JavaScript Math library
graphToGLSL ah env (Abs x) = graphToGLSL ah env x >>= return . fmap (unaryFunctionMatched "abs")
graphToGLSL ah env (Acos x) = graphToGLSL ah env x >>= return . fmap (unaryFunctionMatched "acos")
graphToGLSL ah env (Acosh x) = graphToGLSL ah env $ Log $ x + Sqrt (x*x - 1) -- for WebGL1 compatibility, WebGL 2 has "acosh" directly
graphToGLSL ah env (Acosh x) = graphToGLSL ah env $ Log $ Sum PairWise x $ Sqrt (Pow PairWise x 2 - 1) -- for WebGL1 compatibility, WebGL 2 has "acosh" directly
graphToGLSL ah env (Asin x) = graphToGLSL ah env x >>= return . fmap (unaryFunctionMatched "asin")
graphToGLSL ah env (Asinh x) = graphToGLSL ah env $ Log $ x + Sqrt (x*x + 1) -- for WebGL1 compatibility, WebGL 2 has "asinh" directly
graphToGLSL ah env (Asinh x) = graphToGLSL ah env $ Log $ Sum PairWise x $ Sqrt (Pow PairWise x 2 + 1) -- for WebGL1 compatibility, WebGL 2 has "asinh" directly
graphToGLSL ah env (Atan x) = graphToGLSL ah env x >>= return . fmap (unaryFunctionMatched "atan")
graphToGLSL ah env (Atanh x) = graphToGLSL ah env $ Log ((1 + x) / (1 - x)) / 2 -- for WebGL1 compatibility, WebGL 2 has "atanh" directly
graphToGLSL ah env (Atanh x) = graphToGLSL ah env $ Log (Division PairWise (1 + x) (1 - x)) / 2 -- for WebGL1 compatibility, WebGL 2 has "atanh" directly
graphToGLSL ah env (Cbrt x) = graphToGLSL ah env $ Pow PairWise x 0.3333333333
graphToGLSL ah env (Ceil x) = graphToGLSL ah env x >>= return . fmap (unaryFunctionMatched "ceil")
graphToGLSL ah env (Cos x) = graphToGLSL ah env x >>= return . fmap (unaryFunctionMatched "cos")
graphToGLSL ah env (Cosh x) = graphToGLSL ah env $ (Exp x + Exp (x * (-1))) / 2 -- for WebGL1 compatibility, WebGL 2 has "cosh" directly
graphToGLSL ah env (Cosh x) = graphToGLSL ah env $ (Sum PairWise (Exp x) (Exp (x * (-1)))) / 2 -- for WebGL1 compatibility, WebGL 2 has "cosh" directly
graphToGLSL ah env (Exp x) = graphToGLSL ah env x >>= return . fmap (unaryFunctionMatched "exp")
graphToGLSL ah env (Floor x) = graphToGLSL ah env x >>= return . fmap (unaryFunctionMatched "floor")
graphToGLSL ah env (Log x) = graphToGLSL ah env x >>= return . fmap (unaryFunctionMatched "log")
graphToGLSL ah env (Log2 x) = graphToGLSL ah env x >>= return . fmap (unaryFunctionMatched "log2")
graphToGLSL ah env (Log10 x) = graphToGLSL ah env $ Log x / Log 10
graphToGLSL ah env (Log10 x) = graphToGLSL ah env $ Division PairWise (Log x) (Log 10)
graphToGLSL ah env (Round x) = graphToGLSL ah env $ Floor $ x + 0.5 -- for WebGL1 compatibility, WebGL 2 has "round" directly
graphToGLSL ah env (Sign x) = graphToGLSL ah env x >>= return . fmap (unaryFunctionMatched "sign")
graphToGLSL ah env (Sin x) = graphToGLSL ah env x >>= return . fmap (unaryFunctionMatched "sin")
graphToGLSL ah env (Sinh x) = graphToGLSL ah env $ (Exp x - Exp (x * (-1))) / 2 -- for WebGL1 compatibility, WebGL 2 has "sinh" directly
graphToGLSL ah env (Sinh x) = graphToGLSL ah env $ (Sum PairWise (Exp x) (Exp (x * (-1)) * (-1))) / 2 -- for WebGL1 compatibility, WebGL 2 has "sinh" directly
graphToGLSL ah env (Sqrt x) = graphToGLSL ah env x >>= return . fmap (unaryFunctionMatched "sqrt")
graphToGLSL ah env (Tan x) = graphToGLSL ah env x >>= return . fmap (unaryFunctionMatched "tan")
graphToGLSL ah env (Tanh x) = graphToGLSL ah env $ Sinh x / Cosh x -- for WebGL1 compatibility, WebGL 2 has "tanh" directly
graphToGLSL ah env (Trunc x) = graphToGLSL ah env $ Floor (Abs x) * Sign x -- for WebGL1 compatibility, WebGL 2 has "trunc" directly
graphToGLSL ah env (Tanh x) = graphToGLSL ah env $ Division PairWise (Sinh x) (Cosh x) -- for WebGL1 compatibility, WebGL 2 has "tanh" directly
graphToGLSL ah env (Trunc x) = graphToGLSL ah env $ Product PairWise (Floor (Abs x)) (Sign x) -- for WebGL1 compatibility, WebGL 2 has "trunc" directly

-- other unary functions

Expand Down
94,317 changes: 47,202 additions & 47,115 deletions out.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion punctual.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: punctual
version: 0.4.4.5
version: 0.4.4.6
synopsis: Live coding language
description: Please see README.md
homepage: http://github.com/dktr0/Punctual/blob/master/README.md
Expand Down

0 comments on commit e595479

Please sign in to comment.