Advanced Scene Switcher

Advanced Scene Switcher 1.31.0

Warmuptill

Active Member
hi everyone! long time lurker, first time caller. We're using OBS and ASS to automate a great deal of our radio station output, including live air and dead air detection, ad breaks, remote and outside broadcast, it's really fun!

I'm now looking into how to automate things like turning on and off, and change dates and times of, prerec slots, which are specified via macro actions. this allows me to add the functionality to put on a pre-recorded show in a DJ's slot if they can't turn up that week, or swap slots.

I can do that via the OBS interface, but I'd be interested in how I can do this programmatically, so I don't need to remote into the studio. I could even expose a screen to allow a DJ to upload a show, and it would update the media source in OBS to the new file, and unpause the macro to play his prerec screen on his two hour slot.

This last bit - programmatically updating stuff in ASS - I can't get my head around. Can I get some pointers as to where to look? Am I going to be writing some Python scripts to do this, or can I hang it off Websocket commands?

Thanks again WarmUpTill and the community!
You can find more information about the scripting interface here:
It will allow you to implement custom actions / conditions and change variables.

More information about the websocket interface can be found here:

I hope that is what you were looking for / will help getting you started!
If you have any questions do not hesitate to reach out! :)
 

effortnottalent

New Member
You can find more information about the scripting interface here:
It will allow you to implement custom actions / conditions and change variables.

More information about the websocket interface can be found here:

I hope that is what you were looking for / will help getting you started!
If you have any questions do not hesitate to reach out! :)
That's great, much thankings! Will take a look and come back with any questions.

Thanks for replying to my post!
 

Dan_of_Earth

New Member
I would suggest to use the "Source" condition type for that purpose.
It will allow you to check the settings configured in a source.

View attachment 115010

You can enable pattern matching using regular expressions by clicking the ".*" button.
In you case enabling the highlighted options should suffice.


You can do that using the "Source" condition in combination with the "Variable" action.
Here is an example:

View attachment 115011

Let me know if you have questions!


Without knowing the details of the macros you have set up it is a bit difficult to say what the best approach would be.

However, I assume you can achieve this effect by simply adding a "Wait" action after the "Switch scene" action, which switches to the "main" scene.

View attachment 115013

This will "block" other actions / macros from executing unless you have configured them to be executed in parallel to one another.
Feel free to share you more details about your macro setup (screenshots or export the macros to a file) and ask further questions if this suggestion should not work for you! :)
I appreciate your reply. I don't have a dedicated setup currently. I had it set up originally in a very over-complicated way, and things weren't working the way I wanted. So before posting here (which you replied to) i had re-done the setup, and i just copied the "podcast setup" in the wiki. Im honestly willing to set it up in any way you or any other knowledgeable user suggests.

My setup is this: 3 speakers. I have a "main" scene, which is all 3 of us on screen. The Behavior I'm looking for using the plugin is to switch to a solo shot of whichever speaker is "active," and I want that switch to happen if they are talking for an extended period, like 10 seconds or so. This was functioning easily.

Where I'm complicating things and running into issues (I think) is the remaining behavior I'm looking for. After a solo shot is active for an extended period, OR if that speaker stops for a few seconds, I'd like it to return to the "main" scene. I also want any of the solo scenes to return to the "main" scene and hold there before switching to any solo shot.

Im trying to make it so that it bounces back and forth between active speakers and the "main" scene in a dynamic way that doesn't ever really hold on any solo speaker for too long, whilst taking into consideration any misfires or things like that. Really trying to just fully automate this thing so i never really have to touch it.

I thought i had a good grip on the plug in but it seems i keep running into issues. Im open to completely starting over and whatever you or anyone else might recommend for my desired behavior. i appreciate the help. Sorry if this was all confusing.
 

canarion

New Member
How do I use potentiometers to adjust the input and output audio in my obs? The plugin doesn't allow you to adjust potentiometer ranges and associate them with input or output audio values.
 

Warmuptill

Active Member
Where I'm complicating things and running into issues (I think) is the remaining behavior I'm looking for. After a solo shot is active for an extended period, OR if that speaker stops for a few seconds, I'd like it to return to the "main" scene. I also want any of the solo scenes to return to the "main" scene and hold there before switching to any solo shot.
I would set this up as an additional macro, which might look something like this:

1755099566231.png


The "wait" action in combination with this macro *not* running in parallel to other macros will ensure that we remain on the main scene for at least 10 seconds.
(If blocking other macros like that is not an option for your setup you can of course also simply "pause" the other macros using the "Macro" action instead)

The helper macro "Nobody is talking" looks like this:

1755099351854.png


I hope that is the correct interpretation of "if that speaker stops for a few seconds".
Let me know if you run into any issues with that suggestion! :)

How do I use potentiometers to adjust the input and output audio in my obs? The plugin doesn't allow you to adjust potentiometer ranges and associate them with input or output audio values.
As this came up a few times already I added a brief wiki page describing how to set this up:

However, the "obs-midi-mg" might also be of interest to you:



As a first step, create a new MIDI condition and select the desired device to read the input from.
Next up, click the "Start listening" button and use the slider, knob, ... to figure out which MIDI messages the Advanced Scene Switcher has to check for.

<see wiki for example image>

Once you have figured out which value is representing the volume range in the incoming MIDI messages click "Stop Listening" and set that field to Any.
In the example below this is Value(2).

<see wiki for example image>

Finally, uncheck the "Clear message buffer when matching message was found" as we don't want to discard any volume change messages.

Now let's add actions to read out the incoming values and use them to change the volume of a source.
To read the value we need a Variable action.
We want assign the Value(2) field to the variable of our choice so we configure it like this:

<see wiki for example image>

Finally, we need an action of type Audio to change the volume of the desired source in OBS.
You can click the highlighted button to use the variable you had previously assigned the MIDI value to.

<see wiki for example image>

The final macro will look and behave something like this:

<see wiki for example image>

You can, if necessary, add another optional action step of type Variable, which scales the incoming MIDI values to a desired range.
Here is an example if you would want to scale the 0 to 127 from the above example to 0 to 100:

<see wiki for example image>



Sorry about omitting the images here.
Unfortunately, the forum limits the amount and size of the attachments per post.

Let me know if you have any questions!
 
I have a set of videos, i already have advss randomizing/shuffling the playback... but i still notice, when testing, not everything is getting played, duplicate plays, etc. The only thing I can come up with is after a video is played, move it to a played folder, somehow check the playlist folder to see if anymore files exist, if not, reset/move all the files in the played folder back...

Not asking you to write this for me, but do need some help, trying to figure out how to get current playing filename, to move it, how to check the folder for files... Or if u have a better idea for me...

would be great if advss could keep track of what was played and not, and prioritize non-played... but I dont think thats possible.
 

Warmuptill

Active Member
I have a set of videos, i already have advss randomizing/shuffling the playback... but i still notice, when testing, not everything is getting played, duplicate plays, etc. The only thing I can come up with is after a video is played, move it to a played folder, somehow check the playlist folder to see if anymore files exist, if not, reset/move all the files in the played folder back...

Not asking you to write this for me, but do need some help, trying to figure out how to get current playing filename, to move it, how to check the folder for files... Or if u have a better idea for me...

would be great if advss could keep track of what was played and not, and prioritize non-played... but I dont think thats possible.
Depends on how you have set it up already.
If you use the "Random" action you can configure it to not allow consecutive executions of the same macro.

1755165829221.png


And you could rely on the fact that paused macros are ignored to prioritise the macros which were not yet executed.
The "Play video X" macros would just need to pause themselves like this:

1755165912054.png


Then you can add another macro which checks if all "Play video X" macros are paused and if that is the case unpauses all of them.
 

canarion

New Member
I would set this up as an additional macro, which might look something like this:

View attachment 115146

The "wait" action in combination with this macro *not* running in parallel to other macros will ensure that we remain on the main scene for at least 10 seconds.
(If blocking other macros like that is not an option for your setup you can of course also simply "pause" the other macros using the "Macro" action instead)

The helper macro "Nobody is talking" looks like this:

View attachment 115145

I hope that is the correct interpretation of "if that speaker stops for a few seconds".
Let me know if you run into any issues with that suggestion! :)


As this came up a few times already I added a brief wiki page describing how to set this up:

However, the "obs-midi-mg" might also be of interest to you:



As a first step, create a new MIDI condition and select the desired device to read the input from.
Next up, click the "Start listening" button and use the slider, knob, ... to figure out which MIDI messages the Advanced Scene Switcher has to check for.

<see wiki for example image>

Once you have figured out which value is representing the volume range in the incoming MIDI messages click "Stop Listening" and set that field to Any.
In the example below this is Value(2).

<see wiki for example image>

Finally, uncheck the "Clear message buffer when matching message was found" as we don't want to discard any volume change messages.

Now let's add actions to read out the incoming values and use them to change the volume of a source.
To read the value we need a Variable action.
We want assign the Value(2) field to the variable of our choice so we configure it like this:

<see wiki for example image>

Finally, we need an action of type Audio to change the volume of the desired source in OBS.
You can click the highlighted button to use the variable you had previously assigned the MIDI value to.

<see wiki for example image>

The final macro will look and behave something like this:

<see wiki for example image>

You can, if necessary, add another optional action step of type Variable, which scales the incoming MIDI values to a desired range.
Here is an example if you would want to scale the 0 to 127 from the above example to 0 to 100:

<see wiki for example image>



Sorry about omitting the images here.
Unfortunately, the forum limits the amount and size of the attachments per post.

Let me know if you have any questions!
Thank you very much. The explanation was very helpful. I've used obs-midi-mg, but it lacks some features that this one does have.
 

canarion

New Member
I would like to make a key blink with its respective LED when performing an action and I can't find the way. Could you help me?
 

Warmuptill

Active Member
I would like to make a key blink with its respective LED when performing an action and I can't find the way. Could you help me?
Unfortunately, I can't really give any better advice than checking the documentation of your MIDI device to figure out which MIDI message enables / disables the LED.
 

cdante100

New Member
I cannot think of a reason why the plugin would have trouble reconnecting to the Twitch API.
Can you try replicating the issue with verbose logging enabled?

View attachment 115098

Note that the log file will be rather large.
So you might want to set it back to default if you were able to reproduce it.

Thanks for your support in figuring out what the problem is!


You can use regular expressions for that purpose.
Click the .* button to enable regular expressions and match for the string (MARK)|(BEN)|(ROBERTW) and you should achieve the desired effect.

View attachment 115100

I hope this helps!
Let me know if you have questions!
Hi, that's the link for the verbose log with the same problem, ty.
 

Dan_of_Earth

New Member
I would set this up as an additional macro, which might look something like this:

View attachment 115146

The "wait" action in combination with this macro *not* running in parallel to other macros will ensure that we remain on the main scene for at least 10 seconds.
(If blocking other macros like that is not an option for your setup you can of course also simply "pause" the other macros using the "Macro" action instead)

The helper macro "Nobody is talking" looks like this:

View attachment 115145

I hope that is the correct interpretation of "if that speaker stops for a few seconds".
Let me know if you run into any issues with that suggestion! :)
Thanks for the guidance. I spent some time experimenting before reading your reply and tested it. It seems to mostly work ok. I might need to tweak some timings. But i attached my current settings that i exported, i wonder if you would leave things as i current have them set, or incorporate your suggested settings. Thanks
 

Attachments

  • Scene Switcher Settings.txt
    29 KB · Views: 9

Warmuptill

Active Member
Hi, that's the link for the verbose log with the same problem, ty.
Thanks a lot!

I think I understand what can lead to this behavior:
Repeated invalid event subscriptions requests will lead to the whole connection to be dropped from Twitch's side.
This can happen because a channel was selected which does not exist.

I added a safe guard for this behavior.

A build will be available here in a few minutes:

You will have to be logged into GitHub to be able to download it at the bottom of the page.
Let me know if that should be an issue and I can try to upload it somewhere else once it is ready.

Thanks for the guidance. I spent some time experimenting before reading your reply and tested it. It seems to mostly work ok. I might need to tweak some timings. But i attached my current settings that i exported, i wonder if you would leave things as i current have them set, or incorporate your suggested settings. Thanks
If you got something, which works for you, I don't dare to mess with it :D
What you have set up seems fine to me on a first glance.
 

Warmuptill

Active Member
Hello.

Installed 1.31.0 on Mac (Silicon) and OBS 31.1.2 starts only in Safe Mode.

Hpw to solve this issue or uninstall?
I am sorry to hear that!

Do you have a crash log?

How did you install the plug-in? (Installer or manually)
If you did install it manually please have a look at the signing step mentioned here:

To uninstall the plug-in you must remove this folder:
~/Library/Application Support/obs-studio/plugins/advanced-scene-switcher.plugin
(The ~ represents your home directory)

Let me know if you run into any issues!
 
Last edited:

Warmuptill

Active Member
Also, plugin is not in that specific folder, but installation was succesfull.
If the advanced-scene-switcher.plugin folder doesn’t exist then the plug-in was probably not installed successfully.

Are you sure you are looking into the correct Library folder?
There is one in the root of the MacOS installation, but the one off interest is the one in your user’s home directory.

Where can I see crash log to share it? Because I would like to try it if fixed.
Usually a dialog windows with a crash log should pop up if OBS crashes on macOS.
I need the information contained in that dialog window.
 

damjanjagar

New Member
If the advanced-scene-switcher.plugin folder doesn’t exist then the plug-in was probably not installed successfully.

Are you sure you are looking into the correct Library folder?
There is one in the root of the MacOS installation, but the one off interest is the one in your user’s home directory.


Usually a dialog windows with a crash log should pop up if OBS crashes on macOS.
I need the information contained in that dialog window.
Yes, I find that "user" one imedeatlly after I replied, but did not manage to edit post before your reply.

Found it, delete it, OBS starts normally.

Than I installed plugin once more time, with OBS running. Same issue.

Delete it and tried to install it with OBS closed. No issues, everything is now OK.
 

cdante100

New Member
Thanks a lot!

I think I understand what can lead to this behavior:
Repeated invalid event subscriptions requests will lead to the whole connection to be dropped from Twitch's side.
This can happen because a channel was selected which does not exist.

I added a safe guard for this behavior.

A build will be available here in a few minutes:

You will have to be logged into GitHub to be able to download it at the bottom of the page.
Let me know if that should be an issue and I can try to upload it somewhere else once it is ready.


If you got something, which works for you, I don't dare to mess with it :D
What you have set up seems fine to me on a first glance.
Hi, i've tried the build but the problem reoccurs, this is the log.
 

Warmuptill

Active Member
Hi, i've tried the build but the problem reoccurs, this is the log.
I am at a bit off a loss.
The log does unfortunately not give any conclusive hints as to what the problem might be.

Can you please send me an export of your settings?
You can export them to a file on the General tab.
Please send them to me via DM and not here to make sure your Twitch token does not get leaked.

I apologise that it is such a chore to get it working for you for some reason.
 
Top