Just send changed numbers OSC
Hello,
I need help about sending numbers (0 or 1) from Max to Unity using osc.
I have multiple senders in Max and multiple receivers in Unity.
I need to use also presets in Max.
I record the Max’s numbers in the presets.
But when I change the preset, all the osc numbers are sended in Unity, and in Unity it cause a wrong action.
How can I just send numbers who had been changed ?
Or how can I not send all the osc message at each preset changing?
(I am trying with the change object, but it’s functionnal)
Hoping I am clear...
Thanks for you help
Max 8.3.1
Unity 2021.3.2
Win 11
your logic is all wrong.
You can not use presets to store all that actions and recall them at same time.
You should assign each state an ID and send that instead.
Only 1 at time.
Thanks for your answer.
Do you mean that recall a preset and send an osc message, couldn't be done at the same time ?
At each preset recalled I have to construct a unique message which can be sent to osc ?
Like with "t b 0 1" ?
no, I mean that you can't tell a player to play, pause, resume, go next etc, all at same
time.
Yes, I know that, but it's not my problem.
Each preset I recall in Max send all messages at the time, via osc, which are received in Unity animation player.
How can I select, in a preset system in Max, what osc message should be sent ?
you can do this is you use the patty system for preset management. for instance using the @changemode attribute for pattrstorage.
The problem is not the storage, but player logic.
You send 1 message to the player,
because it can do only one thing at a time.
It is nonesense to store all that toggles and recall them.
Different thing is to store one player action at given time,
to execute automation for example.
But to remotely control a player one needs to know it's current state,
What sense makes to send resume if player is in any other state that paused ?
Is what you posted in that patch what that unity player understands ?
fade play pause restart previous next
is restart actually resume or is pause 1 pause and pause 0 resume ?
or maybe restart forces play current whatever from beginning ?
why then $1 ? does only 1 execute that action ?
if so, why send zeros ?
Post the details and what you exactly want or have to do.
Otherwise it makes no sense to post any further answers.
Hello and thank you all for your help !
The solution of @TestCase is what I needed, it's really helpfull for me !
@Source Audio,
excuse me if I am not clear, in my first language it's difficult to express what I want, so in english it's harder, so sorry if I wasn't clear.
Using Unity is an evolution of my workflow.
I send video from Max in Unity. In Unity I have 3D environment done in VR in Tilt Brush, with a path camera controlled by an animation camera script.
I need to send via Osc informations to play, pause etc. the animation of the path camera, because the control of the workflow is done in Max, (when I will have time I will look at "Ossia Score" to manage all my features in differentes software.
https://ossia.io/
What you say about "state" at one time, informations stored, and Unity animation... break my head.
First I thought sending bangs, a simple message of a button activated at each preset, but it's not possible to store a button action, with a "sel" object and "t 0 b" it's possible but it causes heavy problem to manage when there is change in the preset wokflow.
I am an artist and I miss logical features in my mind...
So that's why forum is really helpfull.
Thank you again for your time.
Why don't you post what unity needs to receive to execute play, fade etc actions ?
is it /play 1 to start and /play 0 to stop playback ?
Or is it only /play 1 to start playback ?
makes a big difference.
pattr changemode 1 could be problematic for such things,
because repeated commands will not get sent.
What if you send play, the thing plays to the end and stops.
And then you want to send play again ?
here it is the Unity script (done by a friend) who manage the control of the animation of the camera path.
I use Oscjack created by Keijiro:
https://github.com/keijiro/OscJack
I use "Int" to drive the animation

That's why just changing the state in the Max preset storage with changemode activated looks like to work properly.
why don't you use 6 numbers to trigger that 6 actions ?
For example like this

then you store that number into whatever you want.
Or use umenu with more descriptive look
I first thought something like this with "sel" and "t 1" or "t 0",
but it's not enough flexible, for this moment I have 50 presets.
And the stored data in presets will change because my artistic content is not closed.