Welcome to %s forums

BrainModular Users Forum

Login Register

Using Global Arrays

I need help on a Patch
Post Reply
woodslanding
Member
Posts: 1327
Contact:

Using Global Arrays

Unread post by woodslanding » 30 Apr 2025, 16:05

I am having a problem with global arrays. The most recent such array I used is not being recognized after restarting the app and loading the wkp.

Before filing a bug report, I want to make sure there isn't something I'm forgetting about.

Should the following situation be possible?? Can you create a GA and name it, and have it not show up in the GA list?
GA not found.png
Let me know, thanks.

I am using the October version of Usine, until such time as I have a reason to buy a new license. If this is a known issue that has been fixed, let me know.
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify

woodslanding
Member
Posts: 1327
Contact:

Unread post by woodslanding » 30 Apr 2025, 16:16

I may be in a catch-22 here. If I try to remove or rename the non-functioning GA, I get this error:

[1408] Error :
PROC:globalArrayRemoveClient
ERROR:Access violation at address 0000000000523CEB in module 'Usine.exe'. Read of address
FFFFFFFFFFFFFFFF

Maybe this prevents the wkp from saving correctly?

This GA is referenced in multiple scripts, so every time I start up, it creates Access violation errors, because the array is not found. Maybe that is why it doesn't save correctly. I'll search and see if there is a test for the existence of a global array that I can put in the scripts. Maybe then the wkp can save correctly.

EDIT: if there is a test for the existence of a GA, it is not in the docs....
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify

woodslanding
Member
Posts: 1327
Contact:

Unread post by woodslanding » 30 Apr 2025, 16:22

Okay, removing the lines referring to the GA from the scripts cured the problem.

So an actual patching question:

How can I let the script know when the GA is actually operational so I can read and write to it?
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify

woodslanding
Member
Posts: 1327
Contact:

Unread post by woodslanding » 30 Apr 2025, 17:03

Okay, if I mis-name the GA, it is properly created! Usine doesn't have a problem with the script trying to access a non-existent array. (Although it does throw an error, it is not an access violation). But if I try to access an existing array too early, it causes an access violation.

I solved this by creating an initializedIN tparameter in the script that references the array, and attaching it to an ON INIT module. I don't run any callbacks until I get the trigger from INIT. Now everything loads and starts up without errors.

Seems like scripts should wait for their patch to be initialized before running callbacks, but I guess they do not.

Hopefully this thread is helpful to someone else.

cheers,
-e
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify

User avatar
oli_lab
Member
Posts: 1261
Location: Brittany, France
Contact:

Unread post by oli_lab » 30 Apr 2025, 17:46

Hi,
there could be only one instance of Global array creation, maybe you create the same array in different scripts ?
cheers

Olivar
http://oli-lab.org

Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social

SylvainT
Site Admin
Posts: 494
Contact:

Unread post by SylvainT » 01 May 2025, 10:19

Hi,

Global Arrays are working really fine. It is one of the strongest features in Usine from these last years to have fast and strong access to data everywhere and communicate with shared Usines.
Only one Global Array definition can exist since it is accessible from everywhere in the workspace.
Global Arrays can have a variable length. You can create a GA with a size of 0 but still enter values. But, if you want to access it with script, you need to define a size at creation.
To access it with script, the GA should have a name written with alt-click on the module itself. Can be the same name, but this is its reference name for scripting.
When loading the wkp, Usine starts with rack 1 until the last one. Everytime a rack is loaded, it is immediately initialized. That means, GA declaration must be loaded before a script that used it to avoid errors.
Best
Sylvain

woodslanding
Member
Posts: 1327
Contact:

Unread post by woodslanding » 24 May 2025, 18:33

Thanks that is very helpful. All my GA's are in track 1, but so are most of the scripts!
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify

Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests