Practical Python For DumDums

I’ve got some really good use out of TD in my first month, and I’m really intersted in growing with this software long term. The thing is its so vast that I don’t want to get more lost than I need to, and learning python from scratch is an equally daunting undertaking to the vastness of TD.

That being said I’m also starting to work with Pis and Arduino boards, so there’s plenty of opportunities to gain knowledge that can be used in other endeavors and merge together. Right?

So my question is twofold:

  1. What aspects of coding should I learn to best leverage TD, and what are the potentials within the software that really open up or are otherwise locked without the practical coding knowhow?

  2. What can I make with TD in combination of with Raspberry Pi and Arduinos? I’m assuming that various sensor data can drive parameters and whatnot, but is there a deeper realm of running parrallel scripts and servers that is worth thinking about? I’m just curious as to the scope of possibilities.

FYI I’ve done a teensy bit of programming and understand the fundamentals right up to reading and writing tables like json. I’m typically making hybrid analog/digital psych/glitch fkry for art’s sake. I’m really not as into 3D as most. I have a kinact v2 that I have only just started to comprehend and I’ll probably just end up making midi controllers from the micro boards if I can’t figure out a practical implementation of Python in TD.

Thanks in advance for your insight, resources and whatever you add to the convo.

1 Like

These are all great questions @basementvibes

I never imagined that I’d be a Python programmer when I started working with TouchDesigner, but it’s become a very helpful tool to add to my belt - not only for what I can do in TD with that language, but how that bridges out to other tools and opportunities for integration.

As an entry point there’s a tutorial set all about working with Python in TouchDesigner here that you might find helpful:

Speaking to your questions:

In my opinion, the most important element to understand about Python in TouchDesigner is the Object Oriented nature of both Python and TD. Any given operator is an instance of that class object - and the way you interact with ops isn’t too far away from the way you might think about working with objects in a purely text based programming language. Good examples of that idea are in both of these tutorials:

The notion of being able to manipulate TouchDesigner only through python extends to many other environments, and will open up possibilities to control any application that has a Python API. For example this repo is a look at how you can use TouchDesigner to control Phillips Hue Lights:

The same principles extend to all sorts of applications and tools - everything from Spotify to Blender.

Pi’s are especially interesting from a Python perspective - you can use your Pi to run pure Python code / scripts / services and lots more. So learning Python as a language opens up your tool kit a bit more on the Pi side of the equation. There are also other tools like NodeRed (a visual based programming kit for NodeJS) that can be used to create simple web-servers, dashboards, and interaction elements that act as remote control panels that send info back to TouchDesigner.

Both Pis and Arduino’s can be used for lighting control integrations, and @lucasm has an excellent approach that’s worth checking out -

The spectrum of what you can do is pretty wide open, so having a little more concrete set of your interests might help others here on the forum also collect examples that are more relevant to the direction of exploration you’re most interested in.

1 Like

Wonderful! This post alone is going to keep me busy and certainly be a source of inspiration.

My motivations are firstly around performance, generating unique art, video synthesis, working with music (hopefully integrating Reaper) and eventually interactive installations.

Thanks again for the response. I’ll have to comb through it a few times.