A type-safe EDSL for TouchDesigner written in Haskell. Instead of connecting nodes by hand, use the power of algebraic data types to program TouchDesigner projects in Haskell.
- Haskell (only tested with haskellstack)
- Clone or download LambdaDesigner-sample.
stack buildin the created directory
stack exec LambdaDesigner-exe
- Check TouchDesigner - you should be seeing a banana!
The first thing you need to do is grab a reference to the runner.
topRunner :: IO ( Tree TOP -> IO () ) main = do r <- topRunner ...
This will let us run a
Tree TOP which will show up as an output connector on the
lambda COMP in TouchDesigner. Lets see this happening by creating a
movieFileIn top with the sample image.
main = do r <- topRunner r $ movieFileIn (bstr "app.samplesFolder+'/Map/Banana.tif'")
We have something we can run!
$ stack build $ stack exec LambdaDesigner-sample-exe
Take a look at it running in TouchDesigner! To experiment with different node types check out the wiki. Not every TouchDesigner node is represented yet, but the most common ones are there.
You can also experiment with LambdaDesigner in ghci. The following code will create a node with the text "Hello, World!"
$ stack ghci > r <- topRunner > r $ textT id (bstr "Hello, world!")
More complex networks
If you're new to TouchDesigner, check out the TouchDesigner wiki for some examples of nodes! You can play around with nodes in TouchDesigner until you get an idea of how everything works. Even if you solely use LambdaDesigner, it's useful to understand what's happening in TouchDesigner to debug. Most of the nodes are implemented, but if you need a new node or parameter, please file an issue.
Try out intero. It's a good way to compile and run hs files easily.
Check out some of Oscillare's node functions, they give a good idea of what LambdaDesigner can do. Everything under "Gens" is a
Tree TOPand everything under "Effects" is a
Tree TOP -> Tree TOP. Note that some of them depend on the
.fragfiles found in TD/scripts/Visuals
scripts node has errors
Click on the red X on the top right of the node. If it says that
dictdiffer isn't found, make sure you have installed the
dictdiffer python library using
pip, and that TouchDesigner knows which python module directory to use. Check out the TouchDesigner wiki article.
If it's a different error, then please file an issue.