Advanced Scene Switcher

Advanced Scene Switcher 1.28.1

jomoko

New Member
Hi, I would like your help. I have several scenes on the obs studio software. I want all the scenes to follow each other automatically. I've added the advanced scene switcher plugin. I have written several macros but the scenes are not linked. Obs studio 30.1.2 Advanced scene switcher 1.25.4 Thanks in advance
 

Attachments

  • 2024-04-15 22-09-15.txt
    20.5 KB · Views: 13

AaronD

Active Member
Hi, I would like your help. I have several scenes on the obs studio software. I want all the scenes to follow each other automatically. I've added the advanced scene switcher plugin. I have written several macros but the scenes are not linked. Obs studio 30.1.2 Advanced scene switcher 1.25.4 Thanks in advance
I have a post on the previous page, that might get you going:
Is that what you're looking to do?
 

Gunthrek

New Member
Is there a way to set up a macro to run when I exit a scene? I have a countdown scene to start my church broadcast which turns on streaming. Once I go out of that scene and choose any other scene, I'd like it to start recording and turn on the main audio. I have multiple scenes that I could go into from the countdown scene and I don't want to have to set up a macro to start to record for each scene that I MIGHT select as my first scene out of the countdown scene.
Maybe rather than making it a scene specific macro, have a macro timer that counts down with your primary countdown and then use the start record macro. That way it's independent and also just starts recording once the timer is done. Have the timer start when you go to the countdown scene, and be sure it resets itself along with the countdown scene if you click away and go back to it.
 

Warmuptill

Active Member
Is there a way to set up a macro to run when I exit a scene? I have a countdown scene to start my church broadcast which turns on streaming. Once I go out of that scene and choose any other scene, I'd like it to start recording and turn on the main audio. I have multiple scenes that I could go into from the countdown scene and I don't want to have to set up a macro to start to record for each scene that I MIGHT select as my first scene out of the countdown scene.
While other already have provided possible solutions I thought I would mention another approach just in case it is of use:
You can also use the "Transition" condition type to detect when you are switching away from a scene:

1713373823132.png


Hi, I would like your help. I have several scenes on the obs studio software. I want all the scenes to follow each other automatically. I've added the advanced scene switcher plugin. I have written several macros but the scenes are not linked. Obs studio 30.1.2 Advanced scene switcher 1.25.4 Thanks in advance
This wiki page might also be of use to you:
 

dunnand0

New Member
I feel like this request might be a bit of a reach. I am using Advance Scene Switcher to turn on and off a media source with the setting value match of a text item. The text item is a number. Is there any way that if there was a number in the text location that another variable could be added to do the math for how much the number has changed by?

Using this for a basketball game, if the number changes by 1 for a free throw, then one media source with a +1 would be triggered, but if the number changes by 2 a different media source with +2 would play.
 

Warmuptill

Active Member
I feel like this request might be a bit of a reach. I am using Advance Scene Switcher to turn on and off a media source with the setting value match of a text item. The text item is a number. Is there any way that if there was a number in the text location that another variable could be added to do the math for how much the number has changed by?

Using this for a basketball game, if the number changes by 1 for a free throw, then one media source with a +1 would be triggered, but if the number changes by 2 a different media source with +2 would play.
You might want to set up a macro like this to assign the current and previous text values to variables and calculate the point difference accordingly:

1713382809770.png


You could then set up macros similar to the following to handle the difference score values:

1713382984102.png


You will of course have to tweak this / add handling which enables the macros handling the score difference at the appropriate times.
If you want to import the examples you can use this code:
Code:
AAAUzXic7VhZb9s4EP4rBNGHHrFXcuweeesmbisgad04zcvCKGiJkonIpEBSrrOG/vvOUIdlJ3HcFnsVfkgiDefKN/PN0F7ROQu1MvTkjxWVbM7pCf3AZJRyYkKlOYlEHHPNZchJjx7RjOUGdGKWGo5vmqUpTxuBkqczJhPQsDqHd3MjsuGSh5/k2DJtGz1jVfY2tEJJE8QflT1Tcu010SrPmrdIhTdjbq2QCWS5oponwliuG4UZM5e5/D23Vsk6LshGmOkdKaRhc3POpq2kZyKZpfBjg/hUyUi4tK7AotHQtf8rvoR/gkK8GosNuYsJJ7m8e/allMFpuBGkzKhSWscnDMDHtLsbFu8woV0mLuMuLY7KwpYgNzrjLBUWwBsp495d2TMsf+9lrziqn73jYlI5GIK70snDtv7LQWProWVdow/K3vBb0+oXQKAUgvWkAaotsipJUj7aFq8hcHFDlaYsMzxqfAt4pAumBZumiHKqEhFCPtBBuWZoeaGgmQV2zopaMedfwaexmglpnZ7hGMQ12YKlWP7mwevCub3N8LHAtEVpsuDaOCj8AsR19I8lj8aOQGcNgehao1epBBICiIg4eToF0vGUO7QpkkRfl+EpvMl8ft1KpsEDyuUA50uociwSzJpLB0KLphbcr1maVUB6BdZtbyx9z/8l0OzthNP7GTihU1n4aJuakEv+dSGMmAog1S3kU8aImsGJGuMmfcTY4XVcVGeB5fN7zj2MsLxqPZd/QRviXvBIMDJWuQb8ijrVirS8YTrmPsHOqBbCe27vbIPDLvh1d4Hf95p53n/96rt2Qb//5j+yC0zZ5v/KJqhit2lZcQkrRZ6+PwtePMPCtObOAOPWvY0T/4enUB2/ogoaO0QsdgmgwE2oRVZGrRLC35DQnvOrtRq25tbW0B5pvhAqN+SqDP2jE/vJCh0Uj81tw5M5lzbAqdeBXWXy6dhqgKCaOF5bJP7k62E/YtjOiEf3eQ39BbPhLKgmaCxkdInS7y0FGkLEGmmrCEpcjCxlUKSNs0pIvgk7278FSuw3ws6ZnQ2XmeambEv6lPjkBemR5+SYPCO/kT7OJsNPc5i/85FW82w9koXMclvL6FtwkUjiCIA51kU8KT0EThmznqk0ag1jceeAdjpQHq4JdmKn49pnIbSSWLXrzdb5Mh5eji4/vQvOh/ThfbgmFrIJtlwGbrbXYdkMrnNpe38GMirrWXHbbzM7EroO5rlehJ455zKBujxgkbEoAiXYehrn5n5Xq938+Una7OTLYJMv3oEuB7r8z+nyT33i8g+7Zid5qnVNOuTJauMKUBxY9Dez6J4PcpM1Cza+56uWi2GLSr28I/OY5alteND6HLh9m9vf8h5iPmbc3EQ/5zx3iU9at2zqd3uDbr/T6yT+mzgc9OJXtPgLk6Mf5g==

Hope that helps! :)



Hello, unfortunately it does not work as expected, if you start obs without the midi device connected, it does not show the system message alerting you, but the macro does detect it because it flashes green. If I start obs with the device connected, the macro also detects it even though I set it to IF NO and there it does show the system message alerting me... the strange thing is that it works the other way around than expected. Another test I did is that if I disconnect the midi device with obs running, advss does not realize that it was disconnected. in the same way as if it is disconnected when I start obs and I connect it after starting... advss does not detect the midi device. I hope to be of help, thank you
I finally got around to looking a bit further into this issue.
You were testing this on a Windows machine, were you not?
If so, I think this might unfortunately be unsolvable at the moment.

The Windows Multimedia API seems to return unexpected values in regard to the amount of connected devices and this only seems to get "solved" when the process using this API is restarted.

At least the number of connected MIDI devices was incorrectly reported using this minimal example:
Code:
#include <iostream>
#include <windows.h>
#include <mmeapi.h>
#include <thread>

#pragma comment(lib, "Winmm.lib")

int main()
{
    while (true) {
        std::size_t nDevices = midiOutGetNumDevs();
        std::cout << "devices:" << nDevices << "\n";
        std::this_thread::sleep_for(std::chrono::seconds(1));
    }
}
New devices were usually detected, but removed devices were always incorrectly reported as being connected still.
Could also be that I am simply using the API incorrectly, but if so I could not figure out where the issue lies.

Maybe I will give the current implementation a try on other platforms as well (when I find the time to) just to verify if this really is a Windows only issue or not.
 

Bairespm

Member
Hi, maybe you can help me with something
It's probably very simple and I'm not realizing how to achieve it.


In a scene A I have 4 videos, and I need the following to happen

video 1 - play
when it finishes playing

video 2 - play
when it finishes playing

video 3 - play
when it finishes playing

video 4 - play
when it finishes playing

Change scene to "X scene"


I clarify: "Sequence" does not work, it only runs the first macro but does not continue with the following ones automatically for it to do so I must change it manually

I clarify something else,
VLC playlist does not work either, because in some videos that have audio at the beginning, it plays them cut off, it is not fluid. between video and video

I have achieved it by making 4 scenes with 1 video each, and then a macro that controls the playback when it ends to change the scene.
Even so, I am looking to simplify it into a scene and a macro, which is why I am asking for help here.
thanks for your time.
 
Last edited:

dunnand0

New Member
You might want to set up a macro like this to assign the current and previous text values to variables and calculate the point difference accordingly:


You could then set up macros similar to the following to handle the difference score values:



You will of course have to tweak this / add handling which enables the macros handling the score difference at the appropriate times.
If you want to import the examples you can use this code:
Code:
AAAUzXic7VhZb9s4EP4rBNGHHrFXcuweeesmbisgad04zcvCKGiJkonIpEBSrrOG/vvOUIdlJ3HcFnsVfkgiDefKN/PN0F7ROQu1MvTkjxWVbM7pCf3AZJRyYkKlOYlEHHPNZchJjx7RjOUGdGKWGo5vmqUpTxuBkqczJhPQsDqHd3MjsuGSh5/k2DJtGz1jVfY2tEJJE8QflT1Tcu010SrPmrdIhTdjbq2QCWS5oponwliuG4UZM5e5/D23Vsk6LshGmOkdKaRhc3POpq2kZyKZpfBjg/hUyUi4t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Dbr/T6yT+mzgc9OJXtPgLk6Mf5g==

Hope that helps! :)


My jaw dropped when on my first attempt to follow your directions everything worked. Very grateful! Thank you!
 

fencer

New Member
You can create a sequence of running macros that will run one after another, you just need to specify the time. You tie the last macro to the first.
1713451526211.png

This works for me.
 
Last edited:
Can someone explain what "macro properties" are, and where they can be set? For example, if I add a `Filter` setting change action to a macro, the dropdown with `Set to fixed value` has an option for `Set to macro property`:

1713466624760.png


I'd love to be able to call `Macro A` from `Macro B` and set a couple of values in that call- sort of like using macros as a programming function with input parameters. Is that what this option is? And if so, where do I define what properties a macro has, and how do I set them?
 

AaronD

Active Member
I'd love to be able to call `Macro A` from `Macro B` and set a couple of values in that call- sort of like using macros as a programming function with input parameters.
So far, I've never had to do that, but I do have a bunch of macros that I use as subroutines, functions, methods, whatever your favorite programming language calls them, all with no parameters, arguments, etc. They have empty conditions, so they only run when another macro hits a Macro action that specifies that macro to run. The Macro action runs the specified macro right then, regardless of its conditions, and waits for it to finish, pretty much exactly like a traditional function call...except there aren't any arguments.

But you can get the same functionality as arguments anyway, by using the same method that some low-end microcontrollers use, that don't actually have a stack, and so the C compiler has to emulate one...sorta...to make the basic C language work. Just have some dedicated variables that are used as arguments and return value(s). Set them before the Macro action, use them in the other "called" macro, and read them after the Macro action if you want to have a return value.

Because that's a static structure and not actually a stack, you'll have to limit how deep your call structure can be, just like the C compilers have to that are made for those chips (absolutely no recursion!), and keep track of which functions/macros are going to use which variables and not have them run over each other, but it does work.
 

Destroy666

Member
Can someone explain what "macro properties" are, and where they can be set? For example, if I add a `Filter` setting change action to a macro, the dropdown with `Set to fixed value` has an option for `Set to macro property`:

View attachment 103367

I'd love to be able to call `Macro A` from `Macro B` and set a couple of values in that call- sort of like using macros as a programming function with input parameters. Is that what this option is? And if so, where do I define what properties a macro has, and how do I set them?

Macro properties are data set by conditions and actions that provide extra info that could be used in variables and wherever variables can be utilized, so in most controls. Examples:
- a lot of data for all the Twitch conditions, like usernames, user IDs, provided texts, etc.
- standard input/output, exit code, etc. for Run action and condition
- window handle etc. for window condition and action
Only maybe <30% of actions/conditions support macro props for now.

They are set on the fly so you can do e.g. Twitch subscriber condition into "and" condition that checks if subscriber username property matches a regex.
 
But you can get the same functionality as arguments anyway, by using the same method that some low-end microcontrollers use, that don't actually have a stack, and so the C compiler has to emulate one...sorta...to make the basic C language work. Just have some dedicated variables that are used as arguments and return value(s). Set them before the Macro action, use them in the other "called" macro, and read them after the Macro action if you want to have a return value.

Thanks Aaron. That is how I am currently doing things, but was hoping to streamline it a bit. My current workflow:

I have a filter that I need to change two values on (a blur radius, and a blur transition duration). I need to time out several of these changes. So I made a macro (Lets call it `Update and Perform Filter Macro`) that updates the two filter values from a `Blur Radius` and a `Blur Transition Time` variable, then triggers the filter. Each of my steps in my main macro then look like:
  1. Set `Blur Radius` Variable to some value
  2. Set `Blur Transition Time` Variable to some value
  3. Call `Update and Perform Filter Macro`
  4. Wait for some time
However for a given set, I might repeat this 10-15 times with different blur radius, transition time, and wait time, so I get HUGE macros. What I was hoping to be able to do is just:
  1. Call `Update and Perform Filter Macro` passing it a blur radius, transition time.
  2. Wait for some time
But it sounds like that cant be done.

Macro properties are data set by conditions and actions that provide extra info that could be used in variables and wherever variables can be utilized, so in most controls. Examples:
- a lot of data for all the Twitch conditions, like usernames, user IDs, provided texts, etc.
- standard input/output, exit code, etc. for Run action and condition
- window handle etc. for window condition and action
Only maybe <30% of actions/conditions support macro props for now.

They are set on the fly so you can do e.g. Twitch subscriber condition into "and" condition that checks if subscriber username property matches a regex.

Good to know. It'd be fantastic (See above) if we could set some input parameters on our own macros, so that we could call them as a single call, setting several values in the macro.
 

AaronD

Active Member
However for a given set, I might repeat this 10-15 times with different blur radius, transition time, and wait time, so I get HUGE macros.
Yeah, that's pretty much how every "simple" thing ends up when it tries to also be capable. It becomes its own assembler code, at about that level of programming, and it takes a similar number of instructions to be able to do stuff as it does if you look at a compiler's output.

Some of the things we take for granted in a higher level language take a TON of instructions to do in assembler, and the "simple" stuff for "non programmers" usually ends up at that assembler level. So we get to see and explicitly design all of that TON of instructions and the entire structure that's normally "under the hood" and out of the way.

Good for seeing and learning how it actually works, but it certainly is tedious and verbose!
 

jomoko

New Member
I have a post on the previous page, that might get you going:
Is that what you're looking to do?
thank you for your reply
 

jomoko

New Member
Maybe rather than making it a scene specific macro, have a macro timer that counts down with your primary countdown and then use the start record macro. That way it's independent and also just starts recording once the timer is done. Have the timer start when you go to the countdown scene, and be sure it resets itself along with the countdown scene if you click away and go back to it.
thank you for your reply
While other already have provided possible solutions I thought I would mention another approach just in case it is of use:
You can also use the "Transition" condition type to detect when you are switching away from a scene:

View attachment 103347


This wiki page might also be of use to you:
thank you for your reply
 

jomoko

New Member
Maybe rather than making it a scene specific macro, have a macro timer that counts down with your primary countdown and then use the start record macro. That way it's independent and also just starts recording once the timer is done. Have the timer start when you go to the countdown scene, and be sure it resets itself along with the countdown scene if you click away and go back to it.
thank you for your reply
 

Rozenman

Member
Hi all,
I encountered a strange problem: I load a package of images into the Image Slide Show source parameters, then create an action to set the slideshow parameters and click the 'Get Current Settings' button (this set of pictures should appear on a certain date, at a certain lecture, and according to this scheme I have a whole month of different lectures was compiled). A text entry appears immediately, probably in JSON format. But if I want to edit the list of images in an old lecture, I take an entry from the old action, copy this entry to the clipboard and add the necessary lines in a text editor, after which I transfer it from the clipboard back to the action. At the same time, I am sure that there are no mistakes in the vocabulary. However, the action is not executed - the images are not loaded into the slideshow settings. What am I doing wrong?

In other words, how to correctly enter a text task into the macro action for installing images in a slideshow?

Please tell me. Thanks!
 

Warmuptill

Active Member
Hi all,
I encountered a strange problem: I load a package of images into the Image Slide Show source parameters, then create an action to set the slideshow parameters and click the 'Get Current Settings' button (this set of pictures should appear on a certain date, at a certain lecture, and according to this scheme I have a whole month of different lectures was compiled). A text entry appears immediately, probably in JSON format. But if I want to edit the list of images in an old lecture, I take an entry from the old action, copy this entry to the clipboard and add the necessary lines in a text editor, after which I transfer it from the clipboard back to the action. At the same time, I am sure that there are no mistakes in the vocabulary. However, the action is not executed - the images are not loaded into the slideshow settings. What am I doing wrong?

In other words, how to correctly enter a text task into the macro action for installing images in a slideshow?

Please tell me. Thanks!
Does the action do what it is supposed to with the "original" settings you acquired via the "Get Current Settings" button?
(Just trying to understand if it is an issue of the action not working at all or with the inputs provided)

If this does work as intended with the "original" settings can you please share the "modified" settings, which do not work, and the "original" settings as a reference?
Thank you!

And yes you are correct that OBS is storing source settings in JSON format. :)
 
Top