logo

Live Production Software Forums


Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

2 Pages<12
Options
Go to last post Go to first unread
streaming---pro  
#21 Posted : Saturday, May 23, 2020 7:12:03 PM(UTC)
streaming---pro

Rank: Newbie

Groups: Registered
Joined: 5/15/2020(UTC)
Posts: 5
Germany

Thanks so much!!!!

Now it is working. I used this code:

Code:
dim x as integer=255

for i as integer = 0 to 255
             API.Function("SetAlpha",Input:=2,Value:=x)
             x=x-1
sleep(4)
next


Just for anyone that needs a script that fades in/out an input.
doggy  
#22 Posted : Saturday, May 23, 2020 9:52:49 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 2,118
Belgium
Location: Belgium

Thanks: 116 times
Was thanked: 384 time(s) in 317 post(s)
Try ;-)

Code:
for i as integer = 255 to 0 step -1

     console.writeline(i.tostring)

next



doggy  
#23 Posted : Monday, July 6, 2020 6:02:30 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 2,118
Belgium
Location: Belgium

Thanks: 116 times
Was thanked: 384 time(s) in 317 post(s)
Code:
' TheInput is the name of the input within quotes, its number without quotes or a variable holding that name or number

' Mix related

' place TheInput in the Mix2 Preview
API.Function("PreviewInput",Input:= TheInput,Mix:=1)

' place TheInput in the Mix2 Output
API.Function("ActiveInput",Input:= TheInput,Mix:=1)

' Do a transition in Mix2
API.Function("Fly",Input:=0,Mix:=1)

' General

' Put an input in the preview
API.Function("PrevieInput",Input:=TheInput)
' Put an input in the Output
API.Function("ActiveInput",Input:=TheInput)

' Transition the preview to output
API.Function("Slide",Input:=0) 
clafarge  
#24 Posted : Wednesday, July 15, 2020 2:10:44 AM(UTC)
clafarge

Rank: Advanced Member

Groups: Registered
Joined: 5/27/2017(UTC)
Posts: 64
Man
United States
Location: Greater St Louis Area

Thanks: 36 times
Was thanked: 12 time(s) in 9 post(s)
I had an issue where I needed to convert for the API XML Volume attribute of an input to the Mixer Fader Volume for that input.

The two Volume values are not the same thing, so some work was required to get between them:

Code:
dim x as new system.xml.xmldocument ' Create the XML document to parse
x.loadxml(API.XML()) ' Load the API into the XML document. For a visual, see http://127.0.0.1:8088/api

' Get the current Volume attribute value from the input (input 1 in this case)
dim xmlVolume As Double = x.SelectSingleNode("//input[@number='1']/@volume").Value

xmlVolume = xmlVolume / 100' I think this is actually Amplitude, not Volume. Amplitude is expected to be a normalized (0-1) value in the formula, which is not how the XML treats it
dim faderVolume As Integer = cint((xmlVolume ^ 0.25) * 100) ' Formula: Volume = (Amplitude ^ 0.25) * 100


The formula came from: https://www.vmix.com/knowledgebase/article.aspx/144/vmix-api-audio-levels

I hope this helps!

Chad
thanks 3 users thanked clafarge for this useful post.
avsoundguy on 7/16/2020(UTC), doggy on 7/16/2020(UTC), stigaard on 7/24/2020(UTC)
doggy  
#25 Posted : Friday, July 24, 2020 5:09:23 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 2,118
Belgium
Location: Belgium

Thanks: 116 times
Was thanked: 384 time(s) in 317 post(s)
Its sometimes a bit confusing /tricky to find the proper xpath for getting specific data from an XML file be it for within a script or in the XML datasource manager

A few helpful links that can generate an xpath for you.

Mind you one might have to tweak the results a bit depending if one uses it for within a script or a datasource Manager

http://xmltoolbox.appspot.com/xpath_generator.html (will give a result based on a selection)

https://www.easycodeforall.com/XPathUtility.jsp (will give a whole list of potential xpaths, has a few more goodies as well)
thanks 3 users thanked doggy for this useful post.
stigaard on 7/24/2020(UTC), BETech on 7/24/2020(UTC), dmwkr on 7/24/2020(UTC)
Jayz555  
#26 Posted : Thursday, July 30, 2020 12:58:25 AM(UTC)
Jayz555

Rank: Newbie

Groups: Registered
Joined: 7/30/2020(UTC)
Posts: 2
Canada

Hey All. Long time listener, first time caller.

Before I go too far down the rabbit hole, I just wanted to check if this was even possible.

Can a script change the audio assignment to an output?

DWAM  
#27 Posted : Thursday, July 30, 2020 3:03:44 AM(UTC)
DWAM

Rank: Advanced Member

Groups: Registered
Joined: 3/20/2014(UTC)
Posts: 2,421
Man
France
Location: Bordeaux, France

Thanks: 198 times
Was thanked: 689 time(s) in 530 post(s)
Quote:
Can a script change the audio assignment to an output?

Scripts can do anything there is an API command for
thanks 1 user thanked DWAM for this useful post.
doggy on 7/30/2020(UTC)
Pyrrhus  
#28 Posted : Sunday, August 2, 2020 2:52:01 AM(UTC)
Pyrrhus

Rank: Newbie

Groups: Registered
Joined: 7/15/2020(UTC)
Posts: 6
United States

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Is there a way to get the production clock event start time and the countdown from it?

I'm trying to write a script that will look at the length of a pre-show video and calculate the time to start the video so that the video ends at the event start time. The length changes every show so it isn't consistent. I have everything working but right now I have to manually edit the script and put in my start time which is not a big deal for me. However, I'm trying to make this as easy as possible for other operators and using the production clock would be ideal. If someone could supply what the code would be of getting the start time that would be great (countdown would be useful for other uses).

Thank you for the support, I've learned a lot just by reading this thread and hacking together multiple scripts to fit my needs.
doggy  
#29 Posted : Sunday, August 2, 2020 3:42:43 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 2,118
Belgium
Location: Belgium

Thanks: 116 times
Was thanked: 384 time(s) in 317 post(s)
Originally Posted by: Pyrrhus Go to Quoted Post
Is there a way to get the production clock event start time and the countdown from it?




What about using a title's "countdown to time"
thanks 1 user thanked doggy for this useful post.
Pyrrhus on 8/2/2020(UTC)
Pyrrhus  
#30 Posted : Sunday, August 2, 2020 4:57:43 PM(UTC)
Pyrrhus

Rank: Newbie

Groups: Registered
Joined: 7/15/2020(UTC)
Posts: 6
United States

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
***SEE EDIT BELOW***

Originally Posted by: doggy Go to Quoted Post
Originally Posted by: Pyrrhus Go to Quoted Post
Is there a way to get the production clock event start time and the countdown from it?




What about using a title's "countdown to time"


I feel dumb, Of course just setup a title with the time I want. I also didn't know there was a countdown to time.

I think i'm missing something in the syntax though. So If I create a title with the input called TimetoStart with "08:00:00" as the text would I put this to store the value?

Code:
dim content as string = Input.Find("TimetoStart").Text("TextBlockName.Text")


When I do console.writeline(content) nothing is displayed in the console.

Btw doggy, thanks for all the stuff you've posted. I've been copying and modifying a lot of your stuff for my own needs.

****EDIT****


I figured it out, I see that in the title editor it gives you the name of the field. In my case it's called Title so this would be my code. Hopefully if someone else gets stuck they can see this.

Code:
dim content as string = Input.Find("TextHD.xaml").Text("Title")
thanks 1 user thanked Pyrrhus for this useful post.
doggy on 8/2/2020(UTC)
doggy  
#31 Posted : Tuesday, August 11, 2020 9:55:54 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 2,118
Belgium
Location: Belgium

Thanks: 116 times
Was thanked: 384 time(s) in 317 post(s)
Totaling values from multiple GT Titles textboxes

Code:
Dim one as integer = Convert.toInt32(Input.Find("Tally.gtzip").Text("One.Text"))
Dim Two as integer = Convert.toInt32(Input.Find("Tally.gtzip").Text("Two.Text"))

API.Function("SetText",Input:="Tally.gtzip",SelectedName:="Total.Text",Value:=(One + Two).tostring)


Joeboe  
#32 Posted : Tuesday, August 11, 2020 10:31:02 PM(UTC)
Joeboe

Rank: Advanced Member

Groups: Registered
Joined: 4/16/2017(UTC)
Posts: 343
Location: jamaica

Thanks: 46 times
Was thanked: 18 time(s) in 18 post(s)
I am glad to find this post...as a real dummy to scripting, I am looking for help......

I have a scoreboard with different players, and I have the scores of each player advancing correctly....What I want is a script to total these scores in real time to show the total for that team as the players scores advances....I just don't have a clue of what to do.....(e.g. Player A:=20, Player B:=10 Total Score: =30, and advances as the score for each player changes...)

thanks in advance.....
doggy  
#33 Posted : Tuesday, August 11, 2020 10:39:42 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 2,118
Belgium
Location: Belgium

Thanks: 116 times
Was thanked: 384 time(s) in 317 post(s)
Originally Posted by: Joeboe Go to Quoted Post
I am glad to find this post...as a real dummy to scripting, I am looking for help......

I have a scoreboard with different players, and I have the scores of each player advancing correctly....What I want is a script to total these scores in real time to show the total for that team as the players scores advances....I just don't have a clue of what to do.....(e.g. Player A:=20, Player B:=10 Total Score: =30, and advances as the score for each player changes...)

thanks in advance.....


You're glad but you didn't read any of it ! Maybe check the post just before yours !
Users browsing this topic
2 Pages<12
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.