Notch & TouchDesigner Communication

#Introduction
It is pleasure to be part of 「Notch #madewithnotch Advent Calendar 2019」. Let me inrtoduce myself briefly, I am Jimmz from Shanghai, China. And I am the one of co-founder of Digital FUN studio [https://www.digitalfun.ca/]. Currently We organize the TouchDesigner Chinese community [http://www.touchdesigner.co/] and Notch Chinese community [http://www.notch-community.co/]. In September, we successfuly hosted the 2019 Flare International New Media Festival with TDSW together [http://tdsummit.jp/flare2019/] [http://www.tea-community.com/flare2019]. Notch Japan Community is very active and energtic, which always provide a great platform for amateurs and professinal masters to communicate and share knowledges. I wish us, Notch Chinese Community, could have more oppurtunities to communicate with and learn from Notch Japan Community, and present more and more Notch related events and forums together in future.

This time, I would like to share a sample case to introduce about how TouchDesigner and Notch communicate with each other. The sample project came from an audio-visual performance called "Mechanical Regret", which we performed in the 2019 Flare International New Media Festival. [https://youtu.be/MKsxcl07nSo]

#Software Requirement
1. Notch Pro License
2. TouchDesigner Pro License

#Notch Project

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/528733/a86e4b08-b47c-6b29-6946-7676ac12af84.png)
This is a screenshot of Notch file.

Basiclly I used Particle Primitive Emitter to generate a plane to emit particles, and add a Line connection Renderer to connect particle via lines in a limited range. Moreover, I add a Shape 3D Sphere, and let it become a input of Object Distance Field Affector, select the mode to "repel", to interact with surrounding particles. Once the sphere's Position X and Position Z value changed, the area of repel effects also changed. In the end, I add a Pixel Sorting Glitches Node to make other particle become vertical glitch, that could distinguish with the "repel" area.

With Pixel Sorting Glitches Node
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/528733/5456d299-7d0c-3a2d-7353-22de864a7f44.png)

Without Pixel Sorting Glitches Node
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/528733/9fae6a26-0775-af14-8cdd-2ade09111521.png)


Ok, let's move to the most important part, choose the parameter that we want to export to TouchDesigner. Here we chose the Position X and Position Z parameters from Shape 3D node. By clicking the "qustionmark" on the left side of Properties panel, you will see this interface below. Ticking the "Expose Property", you could active the panel, change the Exposed Name to something you could easily recognize, that could help you remember what this parameter means once you import to TouchDesigner. You could also set the maximum and minimal value if you need.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/528733/da6e23c2-7f65-c178-56f2-3c765f564cad.png)
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/528733/dc8e9888-0ada-dc59-7655-c67515f007bb.png)

Then we go to the menu bar - project - Compile block for media server. You can export your Notch Block to the location of your project folder.

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/528733/294fe57a-5591-a190-4468-6fd1015cf49a.png)

#TouchDesigner Project
Open the TouchDesigner file I prepare for the VJ performance. Add a Notch TOP into the edit interface. You can see all the parameter you export is in the parameter panel. In this case I would like to connect the position data of laser projectors to Notch TOP, to make the Sphere's Position X and Position Z become exaclty same as laser projector's position, which created a laser drawing repel effects.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/528733/7d3646fa-4a75-82d0-85bb-11f5a9b90abc.png)

That time we used two laser machines, so I create two Shape 3D nodes that can be manipulate by TouchDesigner data, and you could just simply drag the CHOP data export to the Notch TOP's parameter. I also export the Velocity Scale of particle and Radius of Shape 3D Node's data that I could change them flexibly in TouchDesigner.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/528733/a58fc76f-4df0-7668-615c-930645117daa.png)
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/528733/83132fcb-5549-1e12-eb19-0d101816eb45.png)


Here are some photos when we performed in Flare Festival Opening Performance.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/528733/63a6e659-6890-24b5-3f41-9c4c38d9734f.png)
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/528733/98344399-4ddd-3253-26a9-754797e54bde.png)
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/528733/76ab9968-753b-d3e1-bfe6-dcefc6779104.png)

Notch could also export the Exposable Camera Node's parameter to TouchDesigner, That means we could use the Camera COMP to control the camera in Notch. Here is a Chinese tutorial I made for this topic. Feel free to watch it. [https://vimeo.com/347038942]

Thank you for reading this article, I hope you could get some inspirations:)