Easy Routing of audio from Reaper to TouchDesigner

Created by Gordon Byrd / WORLD WIDE BASEMENT VIBES
This is just a simple component I made to easily send audio from Reaper to TD. Reaper has a built in virtual routing system called 'ReaRoute' that should work right out of the box.
To Route a track from Reaper to TouchDesigner:
IMPORTANT: You must have checked the boxes to install ReaRoute when first installing Reaper. This apparently won't work on a portable install, but every new Reaper update walks you through the same steps. All of your settings and configurations should be safe with a new install. 
On any given track (+ Master Bus) you can pull up the routing menu. Under "Audio Hardware Output" create a new audio hardware output, and at the bottom of the list of possible sends will be ReaRoute 1-16. 
This component is set up for only ReaRoute 1 thru 10 as mono sources. Why? Well, my interface has 8 inputs, and I like routing the Master L/R channels to ReaRoute 9 & 10 as audio for OBS recording/streaming over NDI, or use an averaged volume of the entire mix to influence my audio reactive projects in subtle ways. You should be able to copy/paste the bottom row of inputs to create more, but I can't promise it won't break the look and interface of the whole container. 10 outputs on a container is probably pushing good taste/functionality as is.
I built a ReaRouteTD Stereo component that I can also share, but I've never actually used it myself. Here's why:
As soon as signals pass through this module the very first thing that needs to happen is for creative conversion of waveforms into on/off switches and decimal points that will easily translate into parameter control. Only after I have an effect network that is worth showing off will I want the actual audio coming from Reaper to be burned into a video recording and stream. If you can record Reaper into OBS then I wouldn't worry about getting actual audio out of Touch for now.
For this reason I suggest sending ReaRoute channels 1-8 from Reaper 'Pre-FX,' which is not the default. If you do not need the actual audio at the end of your TD project then you definitely don't need the extra latency imposed by your FX chains. Since I do use audio from 9&10 
I leave any actual audio mixing and control completely within Reaper, only piping in channels that I think could manipulate visuals in a dynamic way. Once audio leaves this simple network it interacts with a conveyor belt of smashers and chainsaws (via the CHOP family) until it's useful for direct parameter control.
If you route ReaRoute 9 & 10 from your mix bus: combine each in a MATH CHOP, or MERGE CHOP and link that as the audio source for an NDIOut TOP and your output from Reaper will be synced to the video being rendered at the end of your network. So handy when combined with OBS Studio streaming/recording!
I've set the default sample rate to match my settings in Reaper. I advise you to make sure that ReaRouteTD device settings match those of your Reaper session. You can change the buffer type on the audioDeviceIn CHOPs to frames or seconds... but it will not adjust the value proportionally. 256 samples becomes 256 seconds and your TD project will instantly choke and die. Save before even making these changes with confidence.   
I built the 'ReaSet' button to just quickly toggle the active parameter on each ReaRoute input. Almost any time I add a new audio device I find that it sort of freezes & stutters all these inputs and it's nice having a button/menu item to quickly get that signal flowing again.
ReaName menu allows you to change the CHANNEL name associated with the data to something other than "ReaRoute_1." This is very handy, but sometimes the name won't update until you reload your project. It's on my 1.5 to-do list. FYI changing this mid project will certainly break your python references, so be prepared to update them manually if you didn't plan ahead. If you rename everything to 'chan1' you'll never experience this, but you'll also have a hard time differentiating 8+ chan1's in your project.
If I can make any improvements or be of any help please let me know! I plan on adding more signal control option within this component, and hope to make it robust enough that no one really needs to dive in here unless they're curious.
Good luck on your Reaper to TD journey!

Downloads: 358

Created at: 5.9.2021

Uploaded: 5.9.2021