TWID #15: VJ System in TouchDesigner
Improving the architecture and building new components for a VJ System in TouchDesigner.
Every time I play a VJ Set I either build a new custom one, or I iterate on something I already have. This week I did some improvements on an existing one.
Those were focussed around three main topics:
MVC Architecture
Video Buffer
LFO Sliders
MVC Architecture
Recently I was learning about a concept for software architecture called MVC (short for Model View Controller). As far as I understand that concept, it proposes that you separate your application into three parts:
Model - Data and Business Logic
View - Layout and Display
Controller - Connection between Model and View
As my system got more and more complex I was looking for a way to improve the structure of it and be able to make adjustments more precisely.
So I decided to use the idea of “separation of concerns” in TouchDesigner, which would look something like that:
Model - Individual Components that produce visuals. They have properties that can be controlled from outside.
View - Not only visual, but all ways to interface with the system. This can be a graphical interface, midi, OSC, sensors and similar.
Controller - Some storage that holds all data. It connects what’s coming in through the view with the models parameters.
I have named those differently in my system, but conceptually they do the same thing.
By doing this, the visual producing part is not connected directly to the UI or other inputs, but has a Layer between that it refers to. This makes it easy to try out different input methods without restructuring how things are connected.
Video Buffer
Usually you have two or more decks of visuals that you can blend between to prepare things while others are visible to the audience.
My system does only have one deck, since my controls are a bit esoteric and it would be too complex to have two or more of them. To be able to switch between different banks without strange behaviour I had added a simple second deck that does some generic noise things that I could blend to while setting up a new bank. But this is a bit boring, so I needed to have something different.
Playing with my modular, I found the concept of audio buffers and tape loops, where you can record some sounds that are looping over and over. So I wanted to have this in my VJ System as well so that I could hit a button, which would record the last 120 frames into a buffer and the play it back over and over.
This way I could record a snippet from the current visuals, loop it for some time, while preparing the next visuals.
The implementation was quite simple. It uses a Cache Top for recording, and a Cache Select Top for playback. This one is being looped through with a ramp from a Beat Chop to stay in sync with the tempo.
LFO Sliders
My visuals all have a fixed set of parameters. This way I can flip between them without having to think too much. One of those parameters accepts a normalised float value. Meaning a value that goes from 0.0 to 1.0.
While I could change that value manually or with a midi controller. I noticed that it is quite intense and when it comes to beat matching it is far better to have a tempo synced LFO to do that.
So I wanted a value that can be controlled with the computer, but also with a midi controller. It should be able to be changing automatically based on a LFO with different shapes and also at different time divisions from the main tempo. And on top of that it should be able to be remapped to a different range, by specifying a min and a max value for that.
Sounds a bit weird, but I came up with a solution that I find quite good to work with.
The sliders in the centre can be controlled manually or reflect the incoming midi signal. But they can also be set to LFO Mode, where you choose a shape and a speed. Then they move autonomously, synced to the tempo and within a range you can specify as well.
Other things I did this week
Animations
Drawing
That’s it for this week. Hope you liked it.