Advanced Scene Switcher

Advanced Scene Switcher 1.28.1

qwe1154323937

New Member
Hello, I updated the Chinese localization file of 1.17.4. Please add it to the compressed file.
I found a known bug and an unknown bug.

Macro -- Transition

AdvSceneSwitcher.condition.transition.type.transitionSource="转场特效来自"
AdvSceneSwitcher.condition.transition.type.transitionTarget="转场特效到"

Their option buttons are misplaced.
There is also an unknown dislocation button. It appears when I check whether there is any untranslated text. After debugging, it no longer appears, but it must be caused by a bug. I didn't turn on the log output, so I don't know what problem caused it.
This error may show the button to select the source or scene
 

Attachments

  • 1.17.4 - chinese.zip
    12.8 KB · Views: 21

Warmuptill

Active Member
Hello, I updated the Chinese localization file of 1.17.4. Please add it to the compressed file.
I found a known bug and an unknown bug.

Macro -- Transition

AdvSceneSwitcher.condition.transition.type.transitionSource="转场特效来自"
AdvSceneSwitcher.condition.transition.type.transitionTarget="转场特效到"

Their option buttons are misplaced.
There is also an unknown dislocation button. It appears when I check whether there is any untranslated text. After debugging, it no longer appears, but it must be caused by a bug. I didn't turn on the log output, so I don't know what problem caused it.
This error may show the button to select the source or scene
Thank you very much!
I will make sure to include it in the next release.

Regarding the buttons / other widgets which are "floating" around:
I use a function to place the widgets according to placeholders in the locale file.
Widgets placeholders are marked by two sets of curly braces. For example: {{button}}
If there is a translation for something which is intended to place some widget, but is not using all of the {{widget}} placeholders it will result in the plugin not knowing where to place a particular widget.
In that case the widget will just live in a separate window to the rest of the plugin.

So by providing an updated version of the Chinese translation you have most likely already resolved the issue - so thank you again for that! :)
 

qwe1154323937

New Member
Thank you very much!
I will make sure to include it in the next release.

Regarding the buttons / other widgets which are "floating" around:
I use a function to place the widgets according to placeholders in the locale file.
Widgets placeholders are marked by two sets of curly braces. For example: {{button}}
If there is a translation for something which is intended to place some widget, but is not using all of the {{widget}} placeholders it will result in the plugin not knowing where to place a particular widget.
In that case the widget will just live in a separate window to the rest of the plugin.

So by providing an updated version of the Chinese translation you have most likely already resolved the issue - so thank you again for that! :)

The solution is to wait for your next version update? If so, there will be no problem. If not, where do I need to put {widget}}?
 

Warmuptill

Active Member
The solution is to wait for your next version update? If so, there will be no problem. If not, where do I need to put {widget}}?
Yes, you can just wait for the next release and it should be fixed - But I don't know yet when that will be.
I added an automated test which checks for any issues in the locale files so these kinds of problems can be found more easily on my end.

A build with your locale files will be available here in a few minuets in case you already want to try it:
But note that you have to be logged into GitHub to be able to download it.
 

qwe1154323937

New Member
Yes, you can just wait for the next release and it should be fixed - But I don't know yet when that will be.
I added an automated test which checks for any issues in the locale files so these kinds of problems can be found more easily on my end.

A build with your locale files will be available here in a few minuets in case you already want to try it:
But note that you have to be logged into GitHub to be able to download it.
Thank you for your help. I think I'd better wait for the update, because I can't understand it ~ XP
 

ottawafro

Member
Does anyone else have an issue with the latest update whereas it does not allow you to edit your macro.
Everytime i have tried , it crashed. Doesn't load the macro details , just crashes.

Macros work but plugin crashes OBS when trying to modify .
 

Attachments

  • Advanced Scene switcher crash.PNG
    Advanced Scene switcher crash.PNG
    65.8 KB · Views: 25

ottawafro

Member
Does anyone else have an issue with the latest update whereas it does not allow you to edit your macro.
Everytime i have tried , it crashed. Doesn't load the macro details , just crashes.

Macros work but plugin crashes OBS when trying to modify .
DISREGARD -> REBOOT FIXED
 

Hewie

New Member
Hi! I have a show where I have 4 people with mics and 4 cameras, one for each host. How would I set it up so whoever is talking at the current moment, I can switch the OBS scene to their camera?
I already have 4 audio levels of the different presenters in OBS.
Thanks!
 

Warmuptill

Active Member
Hi! I have a show where I have 4 people with mics and 4 cameras, one for each host. How would I set it up so whoever is talking at the current moment, I can switch the OBS scene to their camera?
I already have 4 audio levels of the different presenters in OBS.
Thanks!
I would suggest to set up four macros similar to this one:
AudioExample.PNG

You will probably have to tweak the volume threshold and time restrictions to your liking.
Let me know if you have any questions.
 

AaronD

Active Member
I would suggest to set up four macros similar to this one:
View attachment 81413
You will probably have to tweak the volume threshold and time restrictions to your liking.
Let me know if you have any questions.

That's about what I would have done too, which leaves the uncertainty of what happens when they all try to talk over each other, or if there's some noise that happens to be above the threshold for that mic but still less than the current (actual) speaker. Is there a priority scheme? Or better yet, a sort of Dan Dugan automixing algorithm (*) with not only an audio output but also an indication of the applied levels that can be used instead of the audio itself to switch scenes?

(*) The Dan Dugan algorithm is essentially a bunch of cross-coupled compressor/expanders. Each channel expands itself and compresses the rest, with all N of the level-detection signals added together N separate times with the right polarity for each, to drive the N gain elements, one for each channel, before mixing them all together into a single audio output. This turns up the loudest one at the moment while turning the rest down, which reduces noise in the ones that aren't speaking at the moment, and helps to prevent feedback in a live venue.

What I'm asking about here is if there's something like that, that can also provide the gain elements' drive signals as a potentially more foolproof activity indicator. That would then drive the scene switcher, instead of the raw audio levels on their own.
 

Warmuptill

Active Member
That's about what I would have done too, which leaves the uncertainty of what happens when they all try to talk over each other, or if there's some noise that happens to be above the threshold for that mic but still less than the current (actual) speaker. Is there a priority scheme?
The macros are executed in order from top to bottom.
So if there are frequent occurrences where multiple people are speaking for expended periods of time one could expand the macro with an additional condition to only switch scenes if not done so already.
This would effectively result in the top macro having the highest priority and the priority decreasing the further down the macro list you go.
AudioExample2.PNG


Or better yet, a sort of Dan Dugan automixing algorithm (*) with not only an audio output but also an indication of the applied levels that can be used instead of the audio itself to switch scenes?
Nothing like this is currently implemented unfortunately.
 

FoxKeegan

New Member
Would it be possible to listen to the output volume of a device after it has run through its filters?
While certainly not a priority, it would allow far greater control over mic activation, and also allow users like Aaron to source mirror audio devices to create new ones filtered solely to act as nothing more than activators for the macro.

On a completely different topic: What's the best practice to reduce CPU cycles when creating macros? By default it seems it will be checking every macro's conditions every 300ms. While it's probably negligible usage compared to encoding and rendering, while creating a macro to simply launch a program I use while streaming (replacing a batch script in the process) I realized there was no "Run Once" sort of condition. Instead I used a timer condition of simply if more than 1 second has passed execute, and then never run again. This works fine, but I then realized this would be checked 3 times every second, needlessly and indefinitely.
So what would you consider the "best practices" and pitfalls to avoid when creating macros? Thank you in advance, both for your advice and for such a wonderful plugin!
 

Warmuptill

Active Member
Would it be possible to listen to the output volume of a device after it has run through its filters?
While certainly not a priority, it would allow far greater control over mic activation, and also allow users like Aaron to source mirror audio devices to create new ones filtered solely to act as nothing more than activators for the macro.
I am not sure if that will be possible, but I will look into it.

On a completely different topic: What's the best practice to reduce CPU cycles when creating macros? By default it seems it will be checking every macro's conditions every 300ms. While it's probably negligible usage compared to encoding and rendering, while creating a macro to simply launch a program I use while streaming (replacing a batch script in the process) I realized there was no "Run Once" sort of condition. Instead I used a timer condition of simply if more than 1 second has passed execute, and then never run again. This works fine, but I then realized this would be checked 3 times every second, needlessly and indefinitely.
So what would you consider the "best practices" and pitfalls to avoid when creating macros? Thank you in advance, both for your advice and for such a wonderful plugin!
To be honest performance hasn't really been a concern of mine as most conditions checks are rather "cheap" to perform. (A notable exception is the "Video" condition type)
If you want to skip the condition checks I would suggest to just add an additional action to the end of your macro which pauses the macro itself.
So something similar to this:
RunOnce.PNG

The next step in reducing the CPU load would be to just increase the interval at which the macros are checked.
Hope that helps!
 
Last edited:

FoxKeegan

New Member
Interesting! So "Pause" both prevents additional conditional checks, but doesn't "block" other macros from running? Thanks, that does help! I'll have to play with it a bit more.
 

Warmuptill

Active Member
Interesting! So "Pause" both prevents additional conditional checks, but doesn't "block" other macros from running? Thanks, that does help! I'll have to play with it a bit more.
Yes, pausing a macro will prevent any condition checks being performed for that macro.
I am not sure what you mean by blocking other macros.
You can pause individual macros without affecting other macros (unless of course the other macros are referring to the paused macro).
You also manually pause macros by unchecking the box before the particular macro you want to pause.
PauseIndividualExample.PNG

You can also bind hotkeys to pause / unpause individual macros in OBS's settings window in the hotkey section.

---

Just a note:
In the current release the UI will not automatically update the paused checkboxes of the macros if they happen to be paused by a macro while the settings dialog is already opened.
You will have to reopen the settings dialog of the advanced scene switcher to see the change on the UI side.
A build with a fix for this behaviour should be available here in a few minutes:
(You will have to be logged into GitHub to be able to download it)
 

FoxKeegan

New Member
I am not sure what you mean by blocking other macros.

Perhaps I misunderstood. I was under the impression only one macro would run at a time, unless "Run macro in parallel to other macros" was checked. I thought "Pause" would freeze the macro, and thus all other macros waiting for it to finish, the way "Wait" does. I'm glad to see it doesn't. I didn't even notice it unchecks the macro, and actually just realized that won't work for me, because it doesn't re-check (unpause) the macro when OBS starts. (I've a few macros that I only need to run when OBS starts up.) I'll look into making one that re-checks those macros as OBS is shutting down. Failing that, I'll just let them keep checking every 300ms, since their so "cheap" to run. :)

Edit: Curious. You don't seem to be able to use "Plugin state => OBS is shutting down" to unpause other macros
 
Last edited:

Warmuptill

Active Member
Edit: Curious. You don't seem to be able to use "Plugin state => OBS is shutting down" to unpause other macros
The macro is actually being executed, but unfortunately at this point in the shutdown procedure any settings changes will not be saved including changing the "paused" state of macros.

Instead I would recommend to set up something similar to this, which is directly checking how often the macro was executed:
RunOnceExample.PNG

This counter will automatically reset when restarting OBS so it is a good fit for this use case.

If you want to make sure the conditions for the "Run once example" macro are not checked anymore after executing it a single time - e.g. when adding a lot of additional conditions or conditions which are expensive to check like the "video" condition - you can add the additional pause action to the end of the macro:
RunOnceExamplePause.PNG

To automatically unpause it on OBS startup add another macro similar to the following:
RunOnceExampleUnPause.PNG

Let me know if you have any questions!
 

FoxKeegan

New Member
Oh, wow! Thank you! That's awesome, and I'll certainly switch over to that! I'd been using an "IF Time>=1s" and turning them all on at start, but that sounds way better
 

PNO

New Member
Hello,

Can someone provide clarity on the Run function for macro's?

I'd like to kick off a powershell script and pass 1 parameter

Specifically: Should I point the Run "browse" input to the full path of the powershell exe?
Or should the browse call the .ps1 file directly?
Should I call at cmd or .bat file from the browse?

None seem to work for me. What am I missing?

Thank you for your assistance.
 
Top