Welcome to %s forums

BrainModular Users Forum

Login Register

Alternatives to 'has changed'?

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

Alternatives to 'has changed'?

Unread post by woodslanding » 04 Dec 2024, 18:48

I have a recurring type of small bug in my wkp. This happens when I set an object's value, and that value happens to be the same value it was before, so hasChanged doesn't see it... but the user has changed the next thing in line in the meantime, so now the two objects are out of sync. I'm contrasting this with the way max operates, where you have discreet events that can always trigger the next thing in line. Is there a way to model this with usine's signal paradigm?

I get around this most times by using a mousedown to actually trigger the next thing, so it happens regardless whether there has been a change in value. But when I set a value by object, that doesn't happen. This is especially an issue in scripts that need to do some kind of refresh.

I guess I can have my recall of the object fake a mouse click. But maybe there's a less awkward way to do it? Is there any way that a control can know that its value has been set via usine objects, if the value doesn't actually change?

Another option I guess is to adjust my recall script to also change whatever is downstream from the main object, so the object doesn't have to do it. That might be a better solution.... or maybe there is a better alternative to hasChanged, that I don't know about?

Thanks as always!
-eric
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify

sm_jamieson
Member
Posts: 551
Contact:

Unread post by sm_jamieson » 26 May 2025, 21:46

The answer is to have an event that does change. A Usine event can be any size but to use cleverly you need to use the sdk. You make the event with an extra word, and increment that each time. At the other end the extra word is ignored. This should create a message that always triggers. Not tried it except on a custom event that might not be compatible with all modules.

woodslanding
Member
Posts: 1327
Contact:

Unread post by woodslanding » 27 May 2025, 19:49

well, I've not tried using the SDK, but I'll keep that in mind.
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 » 29 May 2025, 12:09

Hi,
I did something like this for Arduino talking to Usine in OSC :
each time a value is sent (generally a character from a keyboard) the micro-controller send an OSC message with the char.value and a random 16bit integer.
On Usine side, the second value will go to a "has change" module to trigger the inserting of the character in the string.

because you need 2 informations : the value of you data (the Char) AND the information that it should be taken into account (the trig)
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

woodslanding
Member
Posts: 1327
Contact:

Unread post by woodslanding » 31 May 2025, 18:42

I was just thinking along these lines, oli! My values are text strings, and I was thinking I could add a character at the beginning or end, that gets stripped out later. If the character is different when the data comes from the UI vs. when it is read off disk, that will trigger the hasChanged, even if the two strings are the same.

It's a bit complicted, but I will try that.
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