|
|
|
04-13-2011, 07:21 PM
|
#1
|
Human being with feelings
Join Date: Apr 2009
Location: Duluth, MN
Posts: 1,712
|
JS Global Variables - regxx Master List!
This thread was created to provide a list of JS plugins that are currently using the regxx variables for master/slave operation in REAPER. The purpose of this list is to avoid any possible collisions when using multiple plugins with global variables.
ATTN: Programmers!
Use this list to determine which regxx variables you should use in your plugins. When you upload your plugins, please add them to this list. Thanks!
ATTN: Plugin users!
Use this list to determine whether or not you will encounter any problems while using multiple master/slave JS plugins in your projects.
Thanks!
*Dear Mods...... sticky me?
*edit*
Thank you!
Last edited by d.bop; 04-13-2011 at 08:45 PM.
Reason: I got stickied :)
|
|
|
04-13-2011, 09:27 PM
|
#3
|
Human being with feelings
Join Date: Apr 2009
Location: Duluth, MN
Posts: 1,712
|
Till/Transient-driven Auto-Pan v1.0 (Master) & Till/Transient-driven Auto-Pan v1.0 (Slave)
- uses reg00, reg01, reg02, reg03, reg04, reg05, reg06, reg07, reg08, reg09
- included with REAPER
Till/Transient-driven Auto-Pan v1.1(Master) & Till/Transient-driven Auto-Pan v1.1 (Slave)
- uses reg00, reg01, reg02, reg03, reg04, reg05, reg06, reg07, reg08, reg09
- included with REAPER
There will be a conflict if both v1.0 and v1.1 are used together because they share the same regxx variables.
|
|
|
05-21-2013, 05:40 PM
|
#4
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,746
|
Perhaps we should make something where plugins can register named globals, i.e. _glob_* are automatically shared across all instances...
|
|
|
05-22-2013, 02:28 AM
|
#5
|
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,891
|
Quote:
Originally Posted by Justin
Perhaps we should make something where plugins can register named globals, i.e. _glob_* are automatically shared across all instances...
|
That would be great!
|
|
|
05-22-2013, 03:54 AM
|
#6
|
Human being with feelings
Join Date: Jul 2006
Posts: 626
|
Quote:
Originally Posted by Justin
Perhaps we should make something where plugins can register named globals, i.e. _glob_* are automatically shared across all instances...
|
that would be sweet! /dan
|
|
|
05-23-2013, 11:27 AM
|
#7
|
Human being with feelings
Join Date: Jun 2007
Location: Palm Beach FL
Posts: 265
|
Quote:
Originally Posted by Justin
Perhaps we should make something where plugins can register named globals, i.e. _glob_* are automatically shared across all instances...
|
Any chance, these could also be delay compensated (multithreaded render ahead, etc.)?
|
|
|
05-23-2013, 01:00 PM
|
#8
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,746
|
Quote:
Originally Posted by beyond
Any chance, these could also be delay compensated (multithreaded render ahead, etc.)?
|
Not possible, no.
Getting back to the main topic:
In the next build (4.5rc2), you will be able to use _global.* across instances, and regXX are mapped to _global.regXX.
You can also use the namespace facility with this, so you could do:
Code:
function inc() (
this.value += 1;
);
_global.inc(); // _global.value += 1;
_global.boo.inc(); // _global.boo.value += 1;
|
|
|
05-23-2013, 01:12 PM
|
#9
|
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,891
|
Quote:
Originally Posted by Justin
In the next build (4.5rc2), you will be able to use _global.* across instances, and regXX are mapped to _global.regXX.
You can also use the namespace facility with this, so you could do:
Code:
function inc() (
this.value += 1;
);
_global.inc(); // _global.value += 1;
_global.boo.inc(); // _global.boo.value += 1;
|
Awesome!
|
|
|
05-23-2013, 02:23 PM
|
#10
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,653
|
Quote:
Originally Posted by Justin
In the next build (4.5rc2), you will be able to use _global.* across instances, and regXX are mapped to _global.regXX.
You can also use the namespace facility with this, so you could do:
Code:
function inc() (
this.value += 1;
);
_global.inc(); // _global.value += 1;
_global.boo.inc(); // _global.boo.value += 1;
|
Hmm, interesting... Cool, thanks.
|
|
|
05-23-2013, 07:44 PM
|
#11
|
Human being with feelings
Join Date: Jun 2007
Location: Palm Beach FL
Posts: 265
|
Quote:
Originally Posted by Justin
Not possible, no.
|
:-) Come on Justin, You are one of the best programmers in the world! Of course it is possible for you. Features like globally linked, runtime compiling Jesusonic is what makes Reaper superior to the rest. There would need to be time stamped, properly synchronized delay buffers. Weather it is easy or a priority right now is another question.
I am almost done on a realtime chord and scale recognition system that sends from a master track the transpose, scale, the chord and dynamics to the many children transforming midi patterns that follow. Using synced global variables would be much more ideal than duplicating and changing master connected children tracks. But I understand fixing the basic like the solo mute issues of midi tracks are a priority right now.
|
|
|
05-24-2013, 08:48 AM
|
#12
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,746
|
Quote:
Originally Posted by beyond
:-) Come on Justin, You are one of the best programmers in the world! Of course it is possible for you. Features like globally linked, runtime compiling Jesusonic is what makes Reaper superior to the rest. There would need to be time stamped, properly synchronized delay buffers. Weather it is easy or a priority right now is another question.
I am almost done on a realtime chord and scale recognition system that sends from a master track the transpose, scale, the chord and dynamics to the many children transforming midi patterns that follow. Using synced global variables would be much more ideal than duplicating and changing master connected children tracks. But I understand fixing the basic like the solo mute issues of midi tracks are a priority right now.
|
You could disable anticipative FX rendering, and don't use PDC, and hope for the best (or probably code something that would adapt to the PDC)... but having "synced global variables" probably would end up defying causality logic in many cases.
|
|
|
05-24-2013, 10:03 AM
|
#13
|
Human being with feelings
Join Date: Jun 2007
Location: Palm Beach FL
Posts: 265
|
Quote:
Originally Posted by Justin
You could disable anticipative FX rendering, and don't use PDC, and hope for the best (or probably code something that would adapt to the PDC)... but having "synced global variables" probably would end up defying causality logic in many cases.
|
Well, a track with a JS writing to a global variable is like giving that track a "Send" classification to tracks with JS's reading that global variable. In which case, these groups of dependant tracks all have to be synced and rendered as a bundle and all be capable of rendering ahead, or none at all.
So perhaps than, there needs not be time-stamped buffers (which would work in send situations serving both the future (render ahead) and the present, but would cause causality ambiguities in replies from the present JS's to the future, but 2 way communication is rarely used in JS communication).
Instead this design would check for virtual send connection treatment between JS's that write, and JS's that read detected global variables.
What are your thoughts, just for the puzzle of it...
My older design was working with disabled anticipative FX rendering on tracks that needed to hear the master (for special virtual instruments like piano and electric guitar sympathetically resonating and feeding back to themselves and to the drums, vocals and everything else around them). A simple transpose was also passed to all using globals, but unless all tracks using it were anticipative disabled, you could not change the transpose in the middle of a song musically in sync. This was not needed for most songs.
The new design is using MIDI controller messages sent to children receiving all their musical guidance from the master. If the master is on live input, they all get their chord and scale updates real time, otherwise they are free to happily render ahead.
There were some challenges solved, such as MIDI messages quantized and time-stamped on the same buffer offset coming in an unpredictable order, causing pattern notes to slice and dice to zero length as they updated from some of the chords unpredictably late. These were cleaned by keeping time-stamped note buffers in JS! Your amazing new updates to JS with functions was essential!
|
|
|
08-01-2013, 06:35 AM
|
#14
|
Human being with feelings
Join Date: Mar 2007
Location: I'm in a barn
Posts: 4,467
|
I have been using gmem[] for linking between effects. Is there any advantage in using regxx instead?
gmem[], because there are over 1 million slots, it's easier to avoid collisions. With the gmem VCA plugins I'm working on (slowly but surely) I need about 800 slots .
does regxx work across tabs like gmem[]? If not, that can be an advantage, in that you could choose one over the other if you did not want inter - tab communication.
I suppose I'll just test it when I get a chance.
|
|
|
08-24-2013, 06:37 PM
|
#15
|
Human being with feelings
Join Date: Mar 2007
Location: I'm in a barn
Posts: 4,467
|
I'm noticing that _global.variables stick around in the editor monitor after the effect is deleted. Is there a way to clear them from the list?
|
|
|
10-16-2013, 11:15 PM
|
#16
|
Human being with feelings
Join Date: Apr 2010
Location: Portland OR
Posts: 217
|
Quote:
Originally Posted by James HE
I have been using gmem[] for linking between effects. Is there any advantage in using regxx instead?
|
It appears that ReaJS doesn't support gmem, but does support regXX. So using regXX lets your effect run in other DAWs.
|
|
|
11-20-2013, 06:57 AM
|
#17
|
Human being with feelings
Join Date: Mar 2007
Location: I'm in a barn
Posts: 4,467
|
Collisions are now easy to avoid with _globals, but listing the _globals I've used here.
"ID", for example, is probably not a good label here, as it is too general. but I got here first, so don't use ID...
for VCA's
_global.ID
_global.slaveset
_global.resetoffset
for hardware router
_global.hardwaresel
_global.outonelev
_global.outtwolev
_global.outrestlev
(future) recording setup delay
_global.isp
|
|
|
11-20-2013, 01:48 PM
|
#18
|
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,891
|
Quote:
Originally Posted by James HE
Collisions are now easy to avoid with _globals, but listing the _globals I've used here.
"ID", for example, is probably not a good label here, as it is too general. but I got here first, so don't use ID...
for VCA's
_global.ID
_global.slaveset
_global.resetoffset
for hardware router
_global.hardwaresel
_global.outonelev
_global.outtwolev
_global.outrestlev
(future) recording setup delay
_global.isp
|
I'd use _global.pluginName.varName. That way there's no chance of collision.
|
|
|
11-20-2013, 03:06 PM
|
#19
|
Human being with feelings
Join Date: Oct 2013
Location: Seattle, WA
Posts: 876
|
Proper namespacing FTW!
Would this include functions as well, or just variables?
|
|
|
11-21-2013, 02:54 AM
|
#20
|
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,891
|
Quote:
Originally Posted by SaulT
Proper namespacing FTW!
Would this include functions as well, or just variables?
|
Functions aren't global but careful naming is a good idea if you're designing or using an import file. I think function names can belong to namespaces now, so myLib.myFunc() might be a good pattern to use for that kind of thing.
|
|
|
07-02-2014, 02:06 PM
|
#21
|
Human being with feelings
Join Date: Apr 2010
Location: Portland OR
Posts: 217
|
Getting back to the original topic...
My JSFX alt-tuner uses regXX in blocks of 5. It defaults to reg0-reg4, but you can set it to any block of 5. Register block 1 = reg0-reg4, block 2 = reg5-reg9, etc.
I don't use _global because I want my JSFX to work in other DAWs besides Reaper, so I keep everything ReaJS-compatible.
Last edited by Kite; 07-02-2014 at 02:14 PM.
|
|
|
12-05-2014, 12:21 PM
|
#22
|
Human being with feelings
Join Date: Jun 2009
Location: vancouver
Posts: 6
|
Is it possible...
Is it possible to pass globals from eel to JSFX, (maybe OSCii-bot, and WALTER(?is eel?)). I realize that that they are probably implementations of eel inside different programs, and if so that pretty well would sum up why not. but It would open up (I'm gonna call it routing )routing.
for instance say you want some way to make a dockable gui (stuck in JSFX) of dynamic midi sliders or controls(OSCII-bot,JSFX) to control Reascript sytle stuff(eel) and send the data back to the Gui.
or +walter... use osciibot or jsfx to take in my controls and pass them to an eel script actively updating variables in walter.
|
|
|
02-26-2015, 05:03 AM
|
#23
|
Human being with feelings
Join Date: Jun 2012
Location: Spain
Posts: 7,268
|
could someone put some example code of how to use _global in EEL? Where are _global variables documented?
|
|
|
05-11-2020, 08:52 AM
|
#24
|
Human being with feelings
Join Date: Mar 2018
Location: Belgium
Posts: 43
|
Quote:
Originally Posted by Justin
Not possible, no.
In the next build (4.5rc2), you will be able to use _global.* across instances, and regXX are mapped to _global.regXX.
[/code]
|
What is the mechanism behind the sharing of a global variable? Are they shared once per block, or even less often? If one sets a value, what is the maximum delay before other filters will see that value? (Would be good to add that info to the JS programming doc.)
|
|
|
05-12-2020, 05:34 AM
|
#25
|
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,789
|
As the global variables are shared between tracks (and the Reaper "Control" / GUI ) and all of these might use their own OS threads, and each thread does it's work as fast as it can, disregarding any synchronization between the tracks unless its necessary (at mixing points), the "musical" (i.e. sample / block number at final audio result) time at which the globals are seen from the various possible sources is completely undefined in a render (or recording) process.
That is why it's not recommended to route any audio via globals.
For "live" / realtime applications, this is a lot better, as here you need to provide enough CPU power for all processes to be done appropriately timely, and hence there will be enough synchronicity for the globals as well.
-Michael
|
|
|
05-26-2023, 12:47 PM
|
#26
|
Human being with feelings
Join Date: Aug 2020
Location: Brasil
Posts: 690
|
First post in this thread, I hope it's the right one for this.
I would like to reserve a range of _globals for a video preset library I'm about to release:
_global.girafx.[my lib vars]
any future update would follow this naming convention.
|
|
|
05-31-2023, 10:29 AM
|
#27
|
Human being with feelings
Join Date: May 2011
Location: KZ ALA
Posts: 110
|
I would like to reserve a range of _globals for a any other variable I'm about to release:
_global.BW.[my lib vars]
_global.BW_[my lib vars]
|
|
|
06-01-2023, 11:22 PM
|
#28
|
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,789
|
IMHO it would be more secure/appropriate to use at least four "speaking" letters (e.g. followed by an underscore) for reserved globals.
(AFAIU this is not case sensitive.)
-Michael
|
|
|
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 04:56 AM.
|