How do I create a global variable in patches?
Hi All,
After searching the forum archives, there was mention of a global variable module but usine seems to no longer have one.
I have been using the following approach but it doesn't seem to work. Can anyone point out what is wrong with this method?
I created a patch with a ''set variable'' bus coming in and a ''get variable'' bus going out. Inside the patch is a variable module with the ''set variable'' bus going in to the input pin and a ''has changed'' module coming from the ''set variable'' bus going into the affect pin. The output of the variable module goes to the ''get variable'' bus.
I am writing to my global variable by sending the output from a pass module to the "set variable'' bus whenever I want to change the value... however the value in the global variable patch doesn't change.
Any ideas as to what's wrong with this approach or a better way of doing it I would be glad to hear.
Thanks
After searching the forum archives, there was mention of a global variable module but usine seems to no longer have one.
I have been using the following approach but it doesn't seem to work. Can anyone point out what is wrong with this method?
I created a patch with a ''set variable'' bus coming in and a ''get variable'' bus going out. Inside the patch is a variable module with the ''set variable'' bus going in to the input pin and a ''has changed'' module coming from the ''set variable'' bus going into the affect pin. The output of the variable module goes to the ''get variable'' bus.
I am writing to my global variable by sending the output from a pass module to the "set variable'' bus whenever I want to change the value... however the value in the global variable patch doesn't change.
Any ideas as to what's wrong with this approach or a better way of doing it I would be glad to hear.
Thanks
so you have something like this...?


Yes, exactly like that (nice graphic btw, I must find a good screenshot utility) but it isn't working for me... I must have put a spanner in the works somehow (assuming your example works for you.)
yes , this patch works here..
be carefull to have exactly the same name for get / send bus ..? check space for example..
about capture tool , check FastStone Capture 6.5...
be carefull to have exactly the same name for get / send bus ..? check space for example..
about capture tool , check FastStone Capture 6.5...
I think I have identified the problem. If you have more than one thing sending a signal into the set variable bus, then even though the flow has been halted using the pass module, the values going through the bus don't stop with the result that on the GetBus end, the value is randomly flicking through the last values that came in through the SendBusses. It is as if the flow was never stopped and there's no predictable behaviour for 2 different signals going into the same bus from different patches.
This leaves me back to working out how to make a global variable...
This leaves me back to working out how to make a global variable...
hu , not sure to follow you...
first you said "the value in the global variable patch doesn't change." now "as if the flow was never stopped"...?
and if you send send many information to the same bus , and if there is always something coming in , it's normal that the " has changed " module let always pass information ...?
first you said "the value in the global variable patch doesn't change." now "as if the flow was never stopped"...?
and if you send send many information to the same bus , and if there is always something coming in , it's normal that the " has changed " module let always pass information ...?
In my original workspace, I had several SendBusses sending information to the same named bus. This had the effect of one blocking the other.nay-seven wrote:hu , not sure to follow you...
first you said "the value in the global variable patch doesn't change." now "as if the flow was never stopped"...?
If a value is sent to a bus and then the flow stopped, the value is still present on the receiving end.nay-seven wrote:and if you send send many information to the same bus , and if there is always something coming in , it's normal that the " has changed " module let always pass information ...?
...
So, after some more searching of the forums, I realise that usine works with only one SendBus of a particular named bus. So my solution to the global variable idea is to have many busses called for example: "set variable1", "set variable2", etc that are only used once in other patches but all lead to the same "get variable" bus as an output which can then be used all over the place.

Note that the var module isn't needed as the "get variable" bus retains it's value.
Who is online
Users browsing this forum: No registered users and 83 guests
