|
|
|
06-20-2021, 02:24 AM
|
#1
|
Human being with feelings
Join Date: Sep 2018
Location: China
Posts: 565
|
How to set pin map in jsfx?
Let's say this is slider1, and when I select 3|4, it will set channel 3 and 4 on and 56, 78, 910 off, and so on. Is it possible?
Code:
slider1: 0<0,3,1{3 | 4,5 | 6,7 | 8,9 | 10}>Side Channel
|
|
|
06-20-2021, 02:30 AM
|
#2
|
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,688
|
in @slider something like
c0 = 2*slider1;
c1 = c0+1;
in @sample something lile
spl0 = spl[c0];spl1 = spl[c1];
-Michael
Last edited by mschnell; 06-20-2021 at 10:21 PM.
|
|
|
06-20-2021, 07:59 AM
|
#3
|
Human being with feelings
Join Date: Sep 2018
Location: China
Posts: 565
|
Quote:
Originally Posted by mschnell
in @slider something lile
c0 = 2*slider1;
c1 = c0+1;
in @sample something lile
spl0 = spl[c0];spl0 = spl[c1];
-Michael
|
Thanks for your answer. But seems like it passes the signal to the 1|2 channel.
What I want is turn on channel 3|4, or 5|6, or 7|8, and so on
|
|
|
06-20-2021, 08:06 AM
|
#4
|
Administrator
Join Date: Mar 2007
Location: NY
Posts: 15,750
|
There are actually jsfx functions to do this, although I don't think they have made it to the online documentation yet. You can look at the JS Utility/channel_mapper for example usage.
Code:
get_host_numchan(no parameters)
Get the number of track or media item take channels
set_host_numchan(numchan)
Set the number of track or media item take channels. only valid in @gfx section
get_pin_mapping(inout,pin,startchan,chanmask)
Get a bitfield (maximum 32 bits) representing the channel mappings for this pin
set_pin_mapping(inout,pin,startchan,chanmask,mapping)
Set the channel mappings for this pin/startchan/chanmask. only valid in @gfx section
get_pinmapper_flags(no parameters)
Get the pinmapper flags for this fx. !&1=pass through unmapped output channels, &1=zero out unmapped output channels
set_pinmapper_flags(flags)
Set the pinmapper flags for this fx. see get_pinmapper_flags. only valid in @gfx section
Last edited by schwa; 06-20-2021 at 08:11 AM.
|
|
|
06-20-2021, 09:43 AM
|
#5
|
Human being with feelings
Join Date: Sep 2018
Location: China
Posts: 565
|
Quote:
Originally Posted by schwa
There are actually jsfx functions to do this, although I don't think they have made it to the online documentation yet. You can look at the JS Utility/channel_mapper for example usage.
Code:
get_host_numchan(no parameters)
Get the number of track or media item take channels
set_host_numchan(numchan)
Set the number of track or media item take channels. only valid in @gfx section
get_pin_mapping(inout,pin,startchan,chanmask)
Get a bitfield (maximum 32 bits) representing the channel mappings for this pin
set_pin_mapping(inout,pin,startchan,chanmask,mapping)
Set the channel mappings for this pin/startchan/chanmask. only valid in @gfx section
get_pinmapper_flags(no parameters)
Get the pinmapper flags for this fx. !&1=pass through unmapped output channels, &1=zero out unmapped output channels
set_pinmapper_flags(flags)
Set the pinmapper flags for this fx. see get_pinmapper_flags. only valid in @gfx section
|
Wow, hidden api huh! Thanks, it works! I don't quite understand what chanmask means, but keeping it -1 is ok, as what Channel Mapper does.
Last edited by dsyrock; 06-20-2021 at 09:54 AM.
|
|
|
06-20-2021, 10:03 AM
|
#6
|
Human being with feelings
Join Date: Sep 2018
Location: China
Posts: 565
|
Quote:
Originally Posted by schwa
Code:
get_pin_mapping(inout,pin,startchan,chanmask)
Get a bitfield (maximum 32 bits) representing the channel mappings for this pin
set_pin_mapping(inout,pin,startchan,chanmask,mapping)
Set the channel mappings for this pin/startchan/chanmask. only valid in @gfx section
get_pinmapper_flags(no parameters)
Get the pinmapper flags for this fx. !&1=pass through unmapped output channels, &1=zero out unmapped output channels
set_pinmapper_flags(flags)
Set the pinmapper flags for this fx. see get_pinmapper_flags. only valid in @gfx section
|
Turns out that this four can use in @slider section too.
|
|
|
06-20-2021, 10:20 PM
|
#7
|
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,688
|
Quote:
Originally Posted by dsyrock
Thanks for your answer. But...
|
Typo: I meant to write:
spl0 = spl[c0];spl1 = spl[c1];
[corrected above]
-Michael
|
|
|
06-21-2021, 01:01 PM
|
#8
|
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,688
|
Quote:
Originally Posted by dsyrock
get_host_numchan(no parameters)
And friends...
|
That is interseting, indeed,
-Michael
|
|
|
07-01-2021, 07:22 PM
|
#9
|
Human being with feelings
Join Date: Aug 2013
Location: Bowral, Australia
Posts: 1,638
|
Is the documentation ever going to get updated? How much other secret stuff is there?
|
|
|
11-22-2021, 03:46 PM
|
#10
|
Human being with feelings
Join Date: Dec 2012
Posts: 7,272
|
What are the actual arguments for
get_pin_mapping(inout,pin,startchan,chanmask)
???
How many are required and what kinds of values should they have?
I want to make decisions based on which output pins are actually mapped. Basically, each one will be doing its own calculation, but I'd rather not run the ones that aren't actually being used.
Edit - Well, I figured out what I actually need for this specifically. inout should be 0 for input pins and 1 for output pins. pin seems to be the channel number (starting on 0), like the x in spl(x). Leaving the rest as 0 seems to work fine. If it returns not 0, I do what I do. Still interested to know about the rest, though!
Edit again - But it only seems to go up to 32. In order to get past that, we have to increment startchan. (???)
Last edited by ashcat_lt; 11-22-2021 at 05:06 PM.
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 05:34 PM.
|