Old 04-18-2017, 02:31 AM   #1
Reaktor:[Dave]
Human being with feelings
 
Reaktor:[Dave]'s Avatar
 
Join Date: Jun 2010
Location: Berlin
Posts: 563
Default ReaScript - manipulate track's sends

I need to create new sends to specific audio hardware outputs of a track. I'd like to use ReaScript for that.
But checking the ReaScript API http://www.reaper.fm/sdk/reascript/reascripthelp.html I only see methods for changing input configuration and read-only output configuration. Is there something I'm missing?
Reaktor:[Dave] is offline   Reply With Quote
Old 04-18-2017, 04:19 AM   #2
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
Default

I didn`t found a way to add specific HW send, only default config with CreateTrackSend(). But you simply can add HWOUT line to TrackStateChunk.


Quote:
Originally Posted by Reaktor:[Dave] View Post
I have to route a signal to 384 output tracks in Reaper. Is there a fast way to do this?
so if you need to send a track to 384 HW outputs , this may will work for you (but I`m not sure of course)
Code:
cnt_HW = 384

tr = reaper.GetSelectedTrack(0,0)
_, chunk = reaper.GetTrackStateChunk(tr, '')
str_add = ''
for i = 1, cnt_HW do str_add = str_add..'HWOUT '..(1024+i)..' 0 1 0 0 0 0 -1:U -1\n' end
chunk = chunk:gsub('MAINSEND',str_add..'MAINSEND')
reaper.SetTrackStateChunk(tr, chunk, false)

Last edited by mpl; 04-18-2017 at 04:31 AM.
mpl is offline   Reply With Quote
Old 04-18-2017, 10:42 AM   #3
Reaktor:[Dave]
Human being with feelings
 
Reaktor:[Dave]'s Avatar
 
Join Date: Jun 2010
Location: Berlin
Posts: 563
Default

Thank you - a lot! I didn't know we can manipulate tracks via rppxml.

Is there a reason that the number 'HWOUT '.. has to start at 1024?

Last edited by Reaktor:[Dave]; 04-18-2017 at 10:47 AM.
Reaktor:[Dave] is offline   Reply With Quote
Old 04-18-2017, 11:56 AM   #4
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
Default

I guess I`m wrong and setting destination seems possible:

Quote:
reaper.SetTrackSendInfo_Value( tr, category, sendidx, parmname, newvalue )
I_DSTCHAN : returns int *, index, &1024=mono, otherwise stereo pair, hwout:&512=rearoute
I have no idea why (I`m stupid and don`t understand bitshift stuff), but for me numbers looks like:

0 = default device stereo pair
1-1023 = additional device stereo pairs (not exists)
1024=second mono output
1025=third mono output
1026-2047 = additional mono outputs (not existed)

Last edited by mpl; 04-18-2017 at 12:13 PM.
mpl is offline   Reply With Quote
Old 04-18-2017, 12:51 PM   #5
Reaktor:[Dave]
Human being with feelings
 
Reaktor:[Dave]'s Avatar
 
Join Date: Jun 2010
Location: Berlin
Posts: 563
Default

That sounds great!
Where do you have that info from? On http://www.reaper.fm/sdk/reascript/reascripthelp.html there is no API function called "SetTrackSendInfo_Value()". All I see there is "SetTrackSendUIPan()" and "SetTrackSendUIVol()".
Reaktor:[Dave] is offline   Reply With Quote
Old 04-18-2017, 09:53 PM   #6
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
Default

You didn`t find because of small font sign "Generated by REAPER v5.0-dev" in top right corner. It also doesn`t show SWS APIs.
Click 'API Help' in ReaScript editor.
I personally used X-Raym`s page, much better visually.
mpl is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:11 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.