logo

Live Production Software Forums


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

Notification

Icon
Error

26 Pages<1234>»
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: Advanced Member

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

Thanks: 1 times
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: 5,237
Belgium
Location: Belgium

Thanks: 293 times
Was thanked: 958 time(s) in 793 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: 5,237
Belgium
Location: Belgium

Thanks: 293 times
Was thanked: 958 time(s) in 793 post(s)
MIX inputs <> regular input control


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("PreviewInput",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: 93
Man
United States
Location: Greater St Louis Area

Thanks: 67 times
Was thanked: 20 time(s) in 13 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: 5,237
Belgium
Location: Belgium

Thanks: 293 times
Was thanked: 958 time(s) in 793 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 5 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), vijay6672 on 8/24/2020(UTC), studiodelta on 9/7/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,721
Man
France
Location: Bordeaux, France

Thanks: 243 times
Was thanked: 794 time(s) in 589 post(s)
Quote:
Can a script change the audio assignment to an output?

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

Rank: Newbie

Groups: Registered
Joined: 7/15/2020(UTC)
Posts: 7
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: 5,237
Belgium
Location: Belgium

Thanks: 293 times
Was thanked: 958 time(s) in 793 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: 7
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: 5,237
Belgium
Location: Belgium

Thanks: 293 times
Was thanked: 958 time(s) in 793 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)


thanks 1 user thanked doggy for this useful post.
dmwkr on 8/11/2020(UTC)
Joeboe  
#32 Posted : Tuesday, August 11, 2020 10:31:02 PM(UTC)
Joeboe

Rank: Advanced Member

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

Thanks: 77 times
Was thanked: 32 time(s) in 31 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: 5,237
Belgium
Location: Belgium

Thanks: 293 times
Was thanked: 958 time(s) in 793 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 !
Joeboe  
#34 Posted : Wednesday, August 12, 2020 12:09:30 AM(UTC)
Joeboe

Rank: Advanced Member

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

Thanks: 77 times
Was thanked: 32 time(s) in 31 post(s)
I saw that after I posted...was pointed to it on the facebook post....but now I can not get the scores to work.....

I am getting issues adding the code....I tried adding the scrip to vMix but keep getting an error ( Error Line 4: BC30451: Name 'TEAM' is not declared...I tried changing things but nothing is happening...the error is still there, and sometimes it changer to different errors

The word 'TEAM' is part of the name for the area where I want the Total to be....I labeled it as TEAM SCORE, but I get an error
doggy  
#35 Posted : Wednesday, August 12, 2020 5:48:39 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,237
Belgium
Location: Belgium

Thanks: 293 times
Was thanked: 958 time(s) in 793 post(s)
Originally Posted by: Joeboe Go to Quoted Post
I saw that after I posted...was pointed to it on the facebook post....but now I can not get the scores to work.....

I am getting issues adding the code....I tried adding the scrip to vMix but keep getting an error ( Error Line 4: BC30451: Name 'TEAM' is not declared...I tried changing things but nothing is happening...the error is still there, and sometimes it changer to different errors

The word 'TEAM' is part of the name for the area where I want the Total to be....I labeled it as TEAM SCORE, but I get an error


is what happens when you don't follow instructions even after been given working title template and script.

Case closed

for those interested

https://www.dropbox.com/...4c1/Crickettest.zip?dl=0


Added:

thanks 2 users thanked doggy for this useful post.
mrsofar on 7/13/2022(UTC), RingsideReport on 7/15/2022(UTC)
doggy  
#36 Posted : Sunday, August 23, 2020 8:37:13 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,237
Belgium
Location: Belgium

Thanks: 293 times
Was thanked: 958 time(s) in 793 post(s)
Writing a timestamps to file for a recording (triggered by shortcut)

Credit to Elgarf ( https://forums.vmix.com/...-Marker-Hotkey#post81271 )

Code:
'Text file for time marks
dim FILENAME = "D:\out.txt"

'Get recording duration
dim xml = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)
dim Duration = integer.parse((x.SelectSingleNode("//recording/@duration").Value))

dim Second = math.floor(Duration mod 60)
dim Minute = math.floor((Duration / 60) mod 60)
dim Hour = math.floor((Duration / (60 * 60)) mod 60)

'Write recording duration to file
System.IO.File.AppendAllText(filename, string.format("{0:00}:{1:00}:{2:00}"&Environment.NewLine, Hour, Minute, Second))
thanks 1 user thanked doggy for this useful post.
Bardiccollege on 7/17/2021(UTC)
mtone  
#37 Posted : Monday, August 24, 2020 12:45:48 AM(UTC)
mtone

Rank: Advanced Member

Groups: Registered
Joined: 8/9/2020(UTC)
Posts: 156

Thanks: 3 times
Was thanked: 20 time(s) in 19 post(s)
is it possible via API to change virtual PTZ speed ? in shortcuts it shows options for direction, zoom and start/stop but nothing to control speed.. im wondering if there is some other way of accessing speed control via scripts though ?
doggy  
#38 Posted : Monday, August 24, 2020 1:12:20 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,237
Belgium
Location: Belgium

Thanks: 293 times
Was thanked: 958 time(s) in 793 post(s)
Originally Posted by: mtone Go to Quoted Post
is it possible via API to change virtual PTZ speed ? in shortcuts it shows options for direction, zoom and start/stop but nothing to control speed.. im wondering if there is some other way of accessing speed control via scripts though ?


ptzspeed.JPG (53kb) downloaded 9 time(s).

mtone  
#39 Posted : Monday, August 24, 2020 2:11:43 AM(UTC)
mtone

Rank: Advanced Member

Groups: Registered
Joined: 8/9/2020(UTC)
Posts: 156

Thanks: 3 times
Was thanked: 20 time(s) in 19 post(s)
i did see that setting but is there a way for this to be controlled via a script that dynamically changes the speed of the virtual PTZ ? for example... i want to move the joystick right and instead of it moving at 100% speed right away i want it to ramp up the speed from 0-100% over a short period of time (around 1 second).. then when i let go of the joystick id like it to ease back down slowly to a stop.. same with zoom in and out, id like to ease in and out of the desired speeds instead of being at maximum immediately when you move the controller.

is this possible with scripting somehow ? Im a novice in that department, but if this example is possible id like to try and work it out..
doggy  
#40 Posted : Monday, August 24, 2020 2:24:08 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,237
Belgium
Location: Belgium

Thanks: 293 times
Was thanked: 958 time(s) in 793 post(s)
Originally Posted by: mtone Go to Quoted Post
i did see that setting but is there a way for this to be controlled via a script that dynamically changes the speed of the virtual PTZ ? for example... i want to move the joystick right and instead of it moving at 100% speed right away i want it to ramp up the speed from 0-100% over a short period of time (around 1 second).. then when i let go of the joystick id like it to ease back down slowly to a stop.. same with zoom in and out, id like to ease in and out of the desired speeds instead of being at maximum immediately when you move the controller.

is this possible with scripting somehow ? Im a novice in that department, but if this example is possible id like to try and work it out..


Let us know how it works out
Do some research on how that works with hardware
Users browsing this topic
26 Pages<1234>»
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.