Use touchportal to place CHOPs and TOPs in Touchdesigner

Hello everyone !

I was wondering if there is a way to easily place any CHOPs or TOPs (like an audio file in) by pressing a button on touchportal ?
Heard that Websocket and OSC DATs can do thet, but I have no idea on how to do that

Thanks in advance !

Cheers

I just wattched this tutorial, and used a Streamdeck to give it a try : https://www.youtube.com/watch?v=UrZgDGxFZsQ

Worked like a charm

The thing is I have no idea what code to put to create a node in the project ! :frowning:

Hi @Recma,

not sure how familiar you are with Python Scripting in TouchDesigner, but a first step might be to check our curriculum at:

If all of this is clear, a new operator can be created via the COMP Class’ .create method:

On any component, you can say:

n = op('/project1')
w = n.create(boxSOP, 'box12')

w now will hold a reference to your new operator inside “/project1”

Hope this helps
cheers
Markus

Thank you Markus
I just tried to make a test with a constant chop linked to a chopexec, including this code :

def onValueChange(channel, sampleIndex, val, prev):
	n = op('/project1')
	w = n.create(boxSOP, 'box12')
	return
	

So that when i change the value of the constant, the OP appears
Now the goal would be to create a specific OP when I press a specific MIDI note

Can you help me with that ?

Thanks a lot !

Hi @Recma,

What you would want to do is:

  • create a list of operators that you want to place when hitting certain midi buttons, something like [addSOP, constantTOP, baseCOMP, lineMAT]
  • next see how you can access the list items with your midi values. Would you do this in a Midi In DAT for example?
  • check out how to access list items in python: Access List Items in Python - GeeksforGeeks

Please share your process here and I will keep adding information.

cheers
Markus