Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 01-04-2021, 04:06 PM   #1
bhuether
Human being with feelings
 
Join Date: Nov 2016
Posts: 226
Default [SOLVED] Why isn't this call to SetMediaTrackInfo_Value setting the Source Channel?

Hi,

Going crazy trying to figure this out.

I am trying to set a track's send source channel as below:

Code:
reaper.SetMediaTrackInfo_Value(sendtck, "I_NCHAN", numchans+2)
reaper.CreateTrackSend(sendtck, rectck)
send=reaper.GetTrackNumSends(sendtck, 0 )
rval = reaper.BR_GetSetTrackSendInfo(sendtck, -1, send, "I_SRCCHAN", true, numchans)
where sendtck and rectck are tracks that I previously obtaind via reper.GetTrack and numchans is, say 4.

No matter what I do, the source channel remains 1/2. The sending track indeed has correct number of channels via the SetMediaTrackInfo_Value call. So basically, everything is working except the source channel just doesn't want to cooperate...

Ideas?

thanks!

Last edited by bhuether; 01-04-2021 at 04:42 PM.
bhuether is offline   Reply With Quote
Old 01-04-2021, 04:38 PM   #2
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,107
Default

In line 3 you get the current number of sends, which you use in line 4 as send index (the send variable), but send index in BR_GetSetTrackSendInfo is zero based (according to doc), so shouldn't it be?

Code:
rval = reaper.BR_GetSetTrackSendInfo(sendtck, -1, send-1, "I_SRCCHAN", true, numchans)
nofish is offline   Reply With Quote
Old 01-04-2021, 04:39 PM   #3
bhuether
Human being with feelings
 
Join Date: Nov 2016
Posts: 226
Default

Ok, it was because I wasn't using 0 as the identifier for a track send (versus -1 which is for track receive)

this is how it is working now:


Code:
reaper.SetMediaTrackInfo_Value(sendtck, "I_NCHAN", numchans+2)
reaper.CreateTrackSend(sendtck, rectck)
reaper.SetTrackSendInfo_Value(sendtck, 0, send, "I_SRCCHAN", numchans)
bhuether 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 11:09 PM.


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