Advanced Scene Switcher

Advanced Scene Switcher 1.28.1

Destroy666

Member
Speaking of, is OBS Websocket/Advanced Scene Switcher websocket implementation not capable of processing 2 vendor messages in succession? Or is there some rate limiting? Or is the JS library failing without error somehow? I don't understand why when sending these 2 messages:
1705806012880.png

only the 1st one gets processed by OBS. If I comment out sending the 1st one, then the 2nd one is processed. I could try batching, but I'd like to understand what's going on first.

EDIT: or I guess both get accepted at the same time by the same condition? Matching "Result" that is. Or is the vendor request overwritten?
 
Last edited:

Destroy666

Member
Ok, I see in source code that it goes through all messages and matches first one + sets it as var value: https://github.com/WarmUpTill/Scene.../macro-core/macro-condition-websocket.cpp#L45
And then clears all at next tick: https://github.com/WarmUpTill/Scene...src/utils/websocket-helpers.cpp#L32C21-L32C22

Is that right? Would it be possible to change the behavior to only clear the processed message(s)? Or is there any workaround for this?Other than adding an async wait in my script which is far from perfect.
 

Warmuptill

Active Member
Ok, I see in source code that it goes through all messages and matches first one + sets it as var value: https://github.com/WarmUpTill/Scene.../macro-core/macro-condition-websocket.cpp#L45
And then clears all at next tick: https://github.com/WarmUpTill/Scene...src/utils/websocket-helpers.cpp#L32C21-L32C22

Is that right? Would it be possible to change the behavior to only clear the processed message(s)? Or is there any workaround for this?Other than adding an async wait in my script which is far from perfect.
A build where websocket messages are buffered until they are processed can be found here in a few minutes:
 

AaronD

Active Member
The percentage value is an absolute value based on 0% being no sound and 100% being full volume.
I wonder if he meant dB instead of %. I agree that that would be useful...if it would work with everything else. You know someone's going to want a variable to store dB values and use that variable somewhere, while someone else wants to do the same thing with %, and someone else wants to mix both units...
 

Warmuptill

Active Member
I wonder if he meant dB instead of %. I agree that that would be useful...if it would work with everything else. You know someone's going to want a variable to store dB values and use that variable somewhere, while someone else wants to do the same thing with %, and someone else wants to mix both units...
Agreed.
The option to toggle between % and db is already implemented on the master branch.
It was just not part of any release yet.

293423065-c1469ea0-1dfd-4645-8634-ef9f8b6c0644.gif
 

ATs_fm

New Member
Hey Warmuptill, thanks again for all your helpfull tips.
I've got a question regarding the correct syntax of websocket commands:
How exactly should I type the StartRecording Request in the websocket action to trigger recording in the OBS instance of my second PC?
The obs-websocket protocol is rather difficult to understand for one with little to no coding knowledge.
Could you provide an example to me as a basis to learn more about how to correctly write websocket commands?
 

Warmuptill

Active Member
I would suggest to simply install advanced scene switcher on both machines.
Then manually constructing websocket messages will not be necessary.

On the remote machine which is supposed to start the recording set up a macro like this:
1705866523395.png


On the machine sending out the message to trigger the recording start on the remote machine set up a macro similar to this:
1705866596919.png


The content of the message - "Start recording" in this example - does not matter as long as it is the same on both setups.

For a more in depth description of the websocket functionality of the advanced scene switcher plugin you can have a look at this wiki page:

Hope that helps!
 

AaronD

Active Member
Another possibility, if you'd rather not have OBS running on the local machine *just* to send Websocket messages, is to go ahead and do that temporarily and capture what it actually sends with Wireshark:
Once you have that, you can make your preferred controller send the same thing, and use Wireshark again to see that it does. Unfortunately, Wireshark itself requires some technical knowledge in order to filter out what you actually want to see, from all the "crowded room conversation" that a network connection often carries. So if you don't think that way, it could still be a challenge for you.
 

AccidentalGrenade

New Member
Hello,

I am a poker streamer. I have used Advanced Scene Switcher to create a "Situation Room" scene which shows all of my poker tables. The idea is that I select a table, which is highlighted and then the scene will transition to my main scene showing only that chosen table. However, I'm finding that the scene keeps reverting back to the starting scene. Do you know why this might be occurring and if there is a fix or workaround?

Screenshots of Macro settings attached. Google Drive link to video of the issue https://drive.google.com/file/d/1V4S-CL9n33yicUYjbeTulJKXN8dcSxhM/view?usp=sharing

Thank you!
 

Attachments

  • Macro Settings 1.png
    Macro Settings 1.png
    34.3 KB · Views: 20
  • Macro Settings 2.png
    Macro Settings 2.png
    42.2 KB · Views: 23
  • Macro Settings 3.png
    Macro Settings 3.png
    41.1 KB · Views: 17
  • Macro Settings 4.png
    Macro Settings 4.png
    35.6 KB · Views: 19

Warmuptill

Active Member
Hello,

I am a poker streamer. I have used Advanced Scene Switcher to create a "Situation Room" scene which shows all of my poker tables. The idea is that I select a table, which is highlighted and then the scene will transition to my main scene showing only that chosen table. However, I'm finding that the scene keeps reverting back to the starting scene. Do you know why this might be occurring and if there is a fix or workaround?

Screenshots of Macro settings attached. Google Drive link to video of the issue https://drive.google.com/file/d/1V4S-CL9n33yicUYjbeTulJKXN8dcSxhM/view?usp=sharing

Thank you!
Unfortunately, it is a bit difficult for me to understand what could potentially trigger scene changes in your setup as most of your screenshots only seem to show the action section of a given macro.
Or - just in case I misunderstood - do you only have one single macro?

Would you mind sharing your complete macro setup either by exporting the macros and sharing the import code, or preferably exporting all plugin settings to a file?

It might also help to have a OBS log file of the issue with verbose logging enabled (preferably with a timestamp of when the issue happened) to analyze the root cause for the unexpected scene switches.
 

AccidentalGrenade

New Member
The trigger is a hotkey - I play six poker tables, and use six hotkeys to switch between displaying each table. In the "Macro Settings 1" screenshot, the trigger for the scene swtich is me depressing the hotkey for Table 1.

I will work on exporting the plugin settings and/or macros here for you, as well as an OBS log file.
 

AccidentalGrenade

New Member
Here are the exported macros as well as an export of all plugin settings.
 

Attachments

  • AccidentalGrenade - Macro Export.txt
    1.7 KB · Views: 10
  • AccidentalGrenade - All Plugin Settings Export.txt
    26.1 KB · Views: 22

AccidentalGrenade

New Member
To answer your question, I have six different macros like this for each poker table (as well as other macros which are working fine). I only shared screenshots of one of the macros, as they are all exhibiting this behavior and I felt sharing them all could/would be redundant.
 

Warmuptill

Active Member
To answer your question, I have six different macros like this for each poker table (as well as other macros which are working fine). I only shared screenshots of one of the macros, as they are all exhibiting this behavior and I felt sharing them all could/would be redundant.
I have a suspicion what might be causing problems.
At the end of your "Situation Room" macros, after performing the scene switch, you are modifying type of the currently active transition type and its duration.
Changing type or settings of the active transition while a transition is still ongoing can lead to those strange "canceled" transition effects.

Can you test if removing that last step in your macros resolves the issue?

1705959370037.png


I hope that helps! :)
If it does not I will try to have a deeper look tomorrow.

EDIT:
Hm .. after having another look I don't believe this is the root cause, as "wait until transition to target scene is complete" is checked.
It might still be worth testing if removing that step helps just to rule out that this is somehow causing the problem.
 
Last edited:

Bairespm

Member
Hello, @Warmuptill , please I need help?

I have 4 buttons (hotkeys)
one for each participant for a trivia game

A question is asked and the one who presses their button the fastest is the only one that will be marked on the screen (visibility of element in the scene (color frame e.g. "RED")

I need to make advss with a Macro work like this.

If the hotkey "A" is pressed first, the "RED" frame is displayed only in scene 1 and the rest of the hotkeys stop working for a period of 10 seconds.

or if the hotkey "B" is pressed first, the "RED" frame is displayed only in scene 2 and the rest of the hotkeys stop working for a period of 10 seconds.

or if the hotkey "C" is pressed first, the "RED" frame is displayed only in scene 3 and the rest of the hotkeys stop working for a period of 10 seconds.

or if the hotkey "D" is pressed first, the "RED" frame is displayed only in scene 4 and the rest of the hotkeys stop working for a period of 10 seconds.

I have tried doing this but it leads me to create too many macros. and it doesn't work well... could you help me simplify it? How could I make a macro that works like that?

Thank you so much for your help
 

AaronD

Active Member
Hello, @Warmuptill , please I need help?

I have 4 buttons (hotkeys)
one for each participant for a trivia game

A question is asked and the one who presses their button the fastest is the only one that will be marked on the screen (visibility of element in the scene (color frame e.g. "RED")

I need to make advss with a Macro work like this.

If the hotkey "A" is pressed first, the "RED" frame is displayed only in scene 1 and the rest of the hotkeys stop working for a period of 10 seconds.

or if the hotkey "B" is pressed first, the "RED" frame is displayed only in scene 2 and the rest of the hotkeys stop working for a period of 10 seconds.

or if the hotkey "C" is pressed first, the "RED" frame is displayed only in scene 3 and the rest of the hotkeys stop working for a period of 10 seconds.

or if the hotkey "D" is pressed first, the "RED" frame is displayed only in scene 4 and the rest of the hotkeys stop working for a period of 10 seconds.

I have tried doing this but it leads me to create too many macros. and it doesn't work well... could you help me simplify it? How could I make a macro that works like that?

Thank you so much for your help
That sounds to me like a race condition waiting to happen. (electronic/software term) What happens if two buttons (hotkeys) are pressed at exactly the same time, or within a certain time (milliseconds) of each other? Do you get both, because neither of them knows about the other yet? Do you always get the same one, so that that one has a slight advantage? How important is it to know and design all of that anyway?

If it's really important to be absolutely fair and never have multiple, then I'd be tempted to make a hardware circuit to do the sub-millisecond timing part (look at pinewood derby finish lines for one example; the ones that use logic chips instead of relays), and then figure out how to much-more-leisurely feed the result of that circuit into your software/macros.

There are some USB-connected devices that add a set of GPIO pins to your PC like a Raspberry Pi has, and allows you to script them, so you might use those scripts in the Run action of Adv. SS.

At any rate, I'd skip the keyboard altogether, and look at dedicated buttons feeding a dedicated circuit that is far better at determining a handful-of-microseconds winner (yes, I'm serious about the short timescale) than the macros could ever hope to be. Then once you have a steady output from that dedicated circuit, in a way that a macro can read it, the rest should be easy.
 
Last edited:

ATs_fm

New Member
The "set to substring of current value" was used to extract the values received from the midi device and assign them to a variable.
This got a bit easier to set up since the last update of the plugin.
You don't need to worry about regular expressions to match text patterns to extract only the specific value you need.
Instead you can directly assign the required values to a variable using "Set to macro property" option.

So something like this should work just fine:

View attachment 99677

If you want to import this example you can use this code:
Code:
AAAIoXicnVbbbtswDP0VQU+7NFmSXlb0betSLMC6Bk3Xl6EYFJt2hMqSIclZuiL/PlKyHSXFNmAPBWReD8lDps+8Epk1jl98f+ZaVMAv+HQjqloBP+K1aBxKCqEc0JcVSoHqBUZfroQudxbuUdbTDWQ3euGF9b28tKap+6/cZI8L8F7qEvM+cwuldB5sb7AS7rbRHxvvjeYX3jZRNic0L6SYyTfui1gmwFayXCn887Pi0uhcemm0u0OP3sJ28e9ggzg55uvq3ZOHnKhp9EvdtyhDbbaXJCJqjXb5mbDACPZwz+OKAP3NJSAe8u1RHNWHjFS9zaJW0mPz5saF7zDImgZ6fD7eHiXvhzbAFMPFIH/xPTnufUfk2c3os/GP8OQSTmAHohC9H/pGpSJvylLB/FC8a0HImxmlRO0g72NLfPJK5hL7pUwpM8SC7GmsIK9rk8tCEmueuZcV/MB4zlshtQ92DihBINhaKBp9/xgNUe+fanpuCbKMLmuwLrRhvKVuY+ZrcE6UwZfsZ+6mptxiR7UYZvz+DAvCZdDEwj7ROE2jjU9BvE91hwgHiWcL5ROsZdYjCXhrQzuGYLGbIvtnK9fCSrEMiw2aHnm3Rp3mazwA90Y1FZl18kmrmGnEJ3MW5GoJzIGCkBiNsfn3ET3HL91U90m3+2Ej3jMaTlmB9rN8E2t1zXLhLR6E9m6MUpH8FctFDsJmLoixGIYP3/BWdi18tgqx0KqQOkdHNKB1Yt4wkgTTWokM9nWtkP2UftWFw90qZEmdjm1KD6CXNPvYNVO3LR+F3fSr6aa2SJhQJX/Fxuwtm7A37Ji9Zu/YCV0RB5eN86aaW1PVu/sodd34TsY/YIhSs0AFwthN4SJGmAVjQr0yKk/Opnyh4IMBdhks81juYBAGv5bWaGr+/f7Qvy2mt/Pbm6vZlykNMwMNi366KevaXwk6SB6qGsPs1GOiWpxDSzmsYcK3dEz+wErR5NK8pGS35v+5v0cx7sI09mBpdEdlbw3VINoKJzhDg5GMjfR70tlNUTjwaeI07VIoobN9XKd7Sx3XaM+938Fky9rWoQeWnNqPRweVFiLfsZE+7rqqfgq5o5NY4mGgE7+Gq9Qj6Q9eDOh/B+hqPJCoQ/eHfwecWLce8RJDIRrl+6WnIeuDC/Ivl4cEFR8PJyfD0eBsUJ5n2YmYnJ/y7W/j9Oyo
You will of course adjust the MIDI condition settings to your devices.

If you need more guidance feel free to send me a message!
Works really well thank you! :)
Is there a way to send back a MIDI Value (2) to set the MIDI Fader to the corresponding audio level, like the other way around?
So if I change audio levels in OBS via other scene switcher macros the fader on my virtual MIDI pad changes accordingly.
 
Top