Advanced Scene Switcher

Advanced Scene Switcher 1.28.1

Warmuptill

Active Member
I was referring to media actions and signals, as currently I don't see my custom source in Media conditions
Ah, I see.
For now I simply added your source type to the list of supported media sources.
A build will be available here in a few minutes:
 

Warmuptill

Active Member
I'd rather have the Or... option that I added later:


But even better still - and would certainly break *everyone's* rig, so it probably won't happen - would be to have a Ladder Logic editor like most industrial controls platforms have, or at least something that covers all of the same functionality.

Ladder Logic started as a literal, physical relay schematic, with electrical power split into two rails, and each "rung" on the "ladder" is its own independent circuit, with switches and relay contacts on the left and relay coils on the right. Each coil controls its own set of contacts, and from that you can build pretty much any logic you want. When you walk into a plant that still uses this old control method and open the cabinet, it sounds like popcorn whenever something happens!

A classic ladder rung, used to control something with a separate button for ON and OFF, that will stay in either state until you push the other button:
Code:
|                                                        |
|------NOT [OFF]------+------[ON]------+------(Run)------|
|                     |                |                 |
|                     +------[Run]-----+                 |
|                                                        |
For a computer program, it doesn't matter whether the OFF button comes first or the branch does, but in the old electrical version, it does matter, because the branch isn't even powered at all when you push the OFF button. Could make a small difference for troubleshooting or for electrical safety.

Now with software, each relay - really each unique name - has become a bit in a computer, and we're no longer limited to a finite number of contacts per relay. And we can modify the behavior so that it behaves *mostly* like the electrical circuit that it once was, but not quite, in ways that are plumb easy for an interpreter to make sense of.

I especially like the way that Allen-Bradley / Rockwell Automation does it. Each expression starts on the left side with a default of "true", and as you follow an imaginary dot along the line to the right, it gets modified by each block that it encounters:
  • When it hits a block, its value is AND'ed with the value of that block. Almost equivalent to a Condition in Adv. SS, and of course each block has both a "straight" version and an "inverse" or NOT version.
  • When it hits a branch, the value at that moment is copied to both/all branches.
  • When branches combine, their values are OR'ed to continue across the screen.
  • When the single, possibly recombined (OR'ed) dot reaches the end, its value is the result of the expression.
  • Important for this discussion, a one-shot is simply a block like any other, that can go anywhere, not necessarily at the end and not necessarily in every branch. It could easily be all of the above or any subset. Its value to AND with the incoming value, is simply NOT the previous incoming value.
Thus, it becomes obvious what happens if you put a "NOT Startup" block after a one-shot, and then branch around both with something else, just for one example.

With the present list of conditions, you kinda have to "just know" that you effectively have all of your open parentheses up front (remember math class?), and you close one with every condition. It's the easiest way to write an interpreter of that kind, and I've done it too, but the existence of others means that a newbie can't know for sure. And it's still ambiguous what the "only on change" one-shot actually does in detail.

Not so with Ladder. The graphical nature makes it obvious what's actually happening...until you start doing something complicated, at which point you probably need to split it anyway.

A-B / RA even allows intermediate output blocks, which would radically change the behavior of a physical circuit, but in their version, it continues to work as above, and simply takes the value at whatever point the output happens to be, and sends it somewhere else while also passing it down the line unchanged. This might not be necessary in Adv. SS (yet?), but I thought it was worth mentioning.

A-B / RA is also interpreted sequentially, not simultaneously, so that an intermediate output on a higher branch (visually) can affect what happens on a lower branch, or towards the right, on the *same* scan, if another block in either of those positions happens to look at the same bit in the computer. This seems like a trivial way for an interpreter to do it, and has some...interesting ramifications for those that want to do something detailed.

---

What I'm thinking for Adv. SS, at least to start with, if it even happens at all, is to have a sequential interpreter that behaves as above, with a single fixed output on the far right side. If this output is true, the macro runs on this scan. If false, it doesn't.

Some essential blocks:
  • [Always false], used to disable a branch or the whole thing. Considered bad practice for production (just delete that branch or macro), but useful for troubleshooting. To force something true, just branch around it with nothing in that branch, which is also considered bad practice for production, but useful for troubleshooting.
  • [One-shot], as above. Its own value to AND with the incoming value, is NOT the previous incoming value.
  • [This macro running], used to prevent parallel copies of the same macro, usually while it runs a Wait action.
  • [Startup], true on the first scan, and never again. The existence of this one might affect the decision of which default value the [One-shot] should have.
The default logic for a new macro is not empty - which would be "always true": there must always be a complete "circuit", and the start is always true - but:
Code:
|                                                                               |
|------[Always false]------[One-shot]------NOT [This macro running]------(Run)--|
|                                                                               |
Add things in between and delete them as needed. When you're ready to run, delete the [Always false] if you haven't already.
From the descriptions above, I'm sure you can guess what this default does in a variety of different cases, if you replace any of them with anything...except the (Run) at the end; that's permanent.

Pausing a macro might make its starting value "false", which because it's AND'ed all the way across, never replaced, makes the Run output always false as well. But the conditions still run.

---

And once you've got *that* idea, then we can move the Actions up into the rungs as well, as their own output blocks, and remove the one fixed (Run) block: the rung value is always passed through an Action unchanged, and if it's "true" at that point, the action runs.

The Wait action doesn't really make sense anymore with that structure, but there are always ways to get that functionality back, using Timers.

At this point, Timers become their own Actions or output blocks, not part of any Condition or input, and their state can be read by an input block...

So this:
Code:
Do A
Wait 5
Do B
Wait 3
Do C
might become this:
Code:
|                                                                                              |
|------+------[Conditions...]------[One-shot]------[Do A]------+------[Timer A, set to 5]------|
|      |                                                       |                               |
|      +--------------------------------[Timer A Running]------+                               |
|                                                                                              |
|                                                                                              |
|------+------[Timer A Done]-------[One-shot]------[Do B]------+------[Timer B, set to 3]------|
|      |                                                       |                               |
|      +--------------------------------[Timer B Running]------+                               |
|                                                                                              |
|                                                                                              |
|---------------------------------------[Timer B Done]-------[One-shot]------[Do C]------------|
|                                                                                              |
or this:
Code:
|                                                                                       |
|------+------[Conditions...]------[One-shot]------+------[Timer, set to <enough>]------|
|      |                                           |                                    |
|      +----------------------[Timer Running]------+                                    |
|                                                                                       |
|                                                                                       |
|---------------------------------[Timer Value > 0]---------[One-shot]------[Do A]------|
|                                                                                       |
|                                                                                       |
|---------------------------------[Timer Value > 5]---------[One-shot]------[Do B]------|
|                                                                                       |
|                                                                                       |
|---------------------------------[Timer Value > 5+3]-------[One-shot]------[Do C]------|
|                                                                                       |
Assuming that:
  • The Timer is enabled by a true input value, and both disabled and reset by a false input value.
  • [Timer Running] is only true when the Timer is enabled but not expired yet.
  • [Timer Done] is only true when the Timer is both enabled and expired.
Thank you for the very interesting writeup / proposal!
Unfortunately I assume redesigning the plugin in such a way is probably too late already.

"if not startup" could work much better as well, new macros wouldn't have to be created, at least. Just one more condition per existing macro, which is much cleaner.
A condition like this already exists (Plugin state), but would not solve your issue I believe.
On startup the condition would be false but in the first interval after the startup the condition would evaluate to true, which would trigger the actions of the macros to be run again.
So effectively the problem would only be delayed by a single interval.

But I will try to think of a solution on the weekend.
(Probably just a checkbox to tick whether or not the first execution of a macro should be "skipped")
 

Destroy666

Member
A condition like this already exists (Plugin state), but would not solve your issue I believe.
On startup the condition would be false but in the first interval after the startup the condition would evaluate to true, which would trigger the actions of the macros to be run again.
So effectively the problem would only be delayed by a single interval.

But I will try to think of a solution on the weekend.
(Probably just a checkbox to tick whether or not the first execution of a macro should be "skipped")

Ah, I though it would evaluate that recording stopped under the hood and then not consider it stopping again, but I guess all conditions have to be met.
 

Warmuptill

Active Member
"if not startup" could work much better as well, new macros wouldn't have to be created, at least. Just one more condition per existing macro, which is much cleaner.
A build with the additional option to selectively mark macros, whose actions shall not be executed on OBS startup, can be found here in a few minutes:

SkipExec.png


Let me know if that works as you would expect it to or if there are any issues! :)
 

Bairespm

Member
Hi
I saw this in the update and I think it's great, but I couldn't use it correctly or I didn't understand how to use it. This is so you can rebroadcast to other sites. for example I broadcast on youtube. But with this macro can I also transmit to facebook or twitch? I did some tests I was able to transmit to face but not to twitch at the same time and everything seemed to be ticking.

Could you show me if there is a manual on how to use these functions, I couldn't find anything on the wiki

1691409610953.png
 

Warmuptill

Active Member
I just tested and it seems to work perfectly, thanks!
Perfect - thanks for the quick feedback!

Hi
I saw this in the update and I think it's great, but I couldn't use it correctly or I didn't understand how to use it. This is so you can rebroadcast to other sites. for example I broadcast on youtube. But with this macro can I also transmit to facebook or twitch? I did some tests I was able to transmit to face but not to twitch at the same time and everything seemed to be ticking.

Could you show me if there is a manual on how to use these functions, I couldn't find anything on the wiki

View attachment 96496
These actions do not allow you to stream to multiple platforms at the same time.
All they do is change the currently configured settings (to enable users to automate this).

Unfortunately, I am not familiar with how to stream to multiple services myself, so I cannot really provide much help here.
 

AaronD

Active Member
Unfortunately, I am not familiar with how to stream to multiple services myself, so I cannot really provide much help here.
I've never actually done that myself either, but I've seen two basic ideas:
  • Hijack the recording output to be a second stream. The recording path can be a URL instead of a file...

  • Stream to none of your intended destinations, but to a restreamer instead. Then the restreamer copies the data to everywhere that you set it for.
    • You can stream to a server in the cloud somewhere. There are free and paid versions of those.
      • Your internet connection only has to support one stream this way, but you don't necessarily control all of what the restreamer does with your data.
    • Or you can install a restreamer onto your local machine. Either the same machine that runs OBS, or a different one on your network. Here's one of those:
      • Your internet connection has to support ALL of the simultaneous destination streams this way, which it may or may not be able to do, but you do control all of what the restreamer does.
 

Bairespm

Member
Perfect - thanks for the quick feedback!


These actions do not allow you to stream to multiple platforms at the same time.
All they do is change the currently configured settings (to enable users to automate this).

Unfortunately, I am not familiar with how to stream to multiple services myself, so I cannot really provide much help here.
ahhhh ok ok, I had misunderstood. apologies. Now I understand its usefulness. thank you
 

Bairespm

Member
I've never actually done that myself either, but I've seen two basic ideas:
  • Hijack the recording output to be a second stream. The recording path can be a URL instead of a file...

  • Stream to none of your intended destinations, but to a restreamer instead. Then the restreamer copies the data to everywhere that you set it for.
    • You can stream to a server in the cloud somewhere. There are free and paid versions of those.
      • Your internet connection only has to support one stream this way, but you don't necessarily control all of what the restreamer does with your data.
    • Or you can install a restreamer onto your local machine. Either the same machine that runs OBS, or a different one on your network. Here's one of those:
      • Your internet connection has to support ALL of the simultaneous destination streams this way, which it may or may not be able to do, but you do control all of what the restreamer does.
Thank you very much for your advice. I will take them into account. I currently use a very nice obs plugin called obs-multi-rtmp . which works very well, I just thought that the functionality they added to adv ss worked similarly and that's why I asked to simplify everything in a plugin... anyway, thanks
 

MMedia

New Member
Hello everyone.
Sorry if this sounds like a rookie question, but I'm looking for a simple way to set up random scene switching that will resume its random function after being interrupted by a manual scene switch. I used an older version of Adv Scene Switcher which did this by default. Doesn't seem to work quite the same in versions of Adv Scene Switcher since Macros were introduced.

Thanks for any help.
 

AaronD

Active Member
Hello everyone.
Sorry if this sounds like a rookie question, but I'm looking for a simple way to set up random scene switching that will resume its random function after being interrupted by a manual scene switch. I used an older version of Adv Scene Switcher which did this by default. Doesn't seem to work quite the same in versions of Adv Scene Switcher since Macros were introduced.

Thanks for any help.
Do you want the macro to override the manual switch? Or do you want a set of scenes that shuffles itself *only* when you're already in that set? Both are possible, and the wrong one will likely be annoying!

The old tabs still exist, if you uncheck the box on the General tab to hide them, but they're not maintained anymore and might even go away at some point. So try to migrate everything to the macros.
 

CodeYan

Member
Ah, I see.
For now I simply added your source type to the list of supported media sources.
A build will be available here in a few minutes:
Thanks! I tested it and now it shows up. An alternative solution (so you don't have to add a line for every plugin) is to check for obs_source_info.OBS_SOURCE_CONTROLLABLE_MEDIA of the sources. If i'm not mistaken, media/vlc/slideshow should all have that flag as well.

I still have yet to test the scene item feature i requested a while back, sorry!
 

Bairespm

Member
A build with the additional option to selectively mark macros, whose actions shall not be executed on OBS startup, can be found here in a few minutes:

View attachment 96441

Let me know if that works as you would expect it to or if there are any issues! :)
this is great, it saves me a lot of headaches. Ask how do I find out if this version contains all of the above... from version 1.23?
 

Warmuptill

Active Member
An alternative solution (so you don't have to add a line for every plugin) is to check for obs_source_info.OBS_SOURCE_CONTROLLABLE_MEDIA of the sources. If i'm not mistaken, media/vlc/slideshow should all have that flag as well.
That's a good idea!
I will try this later today! :)

I still have yet to test the scene item feature i requested a while back, sorry!
No worries :)

this is great, it saves me a lot of headaches. Ask how do I find out if this version contains all of the above... from version 1.23?
The build I shared with you is based on 1.23 and contains all its changes.

Hello everyone.
Sorry if this sounds like a rookie question, but I'm looking for a simple way to set up random scene switching that will resume its random function after being interrupted by a manual scene switch. I used an older version of Adv Scene Switcher which did this by default. Doesn't seem to work quite the same in versions of Adv Scene Switcher since Macros were introduced.

Thanks for any help.
As already mentioned by @AaronD there are multiple ways of achieving this.
Here is an example guide which might help you get started:

If you have any questions do not hesitate to ask! :)
 

Bairespm

Member
@Warmuptill

Suggestion to add

one more level in macro group tree

example
-group (resources) -
- sub group zoom - zoom 1
- zoom 2
- zoom 3
- zoom 4

and It would be nice to have the buttons here too
1691519324432.png


and
When you want to delete a macro or some action, a confirmation popup appears... so as not to delete an important macro by mistake.
currently it is deleted without asking anything
1691519406264.png


and something that would be great, a macro browser. Because if you're like me who has like 50 macros, it's hard to find a macro to modify.

It would also be good for the groups to be able to assign them a color. to make it easier to prioritize.

Take it as suggestions, it's not something I need. I just think it would be great if the plugin had this

They are details that make the plugin more perfect. thanks for that
 

Enma

New Member
I'm wondering if it would be at all possible to also add the enable/disable toggle to the conditions/triggers as well.
That'd make creating and troubleshooting macros a lot easier, instead of having to remove and re add triggers whenever you need to test something while meeting only some of the criteria you want.
 

Warmuptill

Active Member
I'm wondering if it would be at all possible to also add the enable/disable toggle to the conditions/triggers as well.
That'd make creating and troubleshooting macros a lot easier, instead of having to remove and re add triggers whenever you need to test something while meeting only some of the criteria you want.
For conditions the "ignore entry" logic type exists, which just skips over that given condition element.
Capture.PNG


And just to mention it - you can also enable visual guides indicating which condition is currently evaluating to "true":
 
Top