logo

Live Production Software Forums


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

Notification

Icon
Error

26 Pages«<23456>»
Options
Go to last post Go to first unread
DWAM  
#61 Posted : Tuesday, November 24, 2020 2:47:25 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)
Using SetPanX and SetPanY for PiP from a joystick

thanks 2 users thanked DWAM for this useful post.
Chris Daum on 11/25/2020(UTC), NiBTour on 12/31/2021(UTC)
Chris Daum  
#62 Posted : Tuesday, November 24, 2020 3:06:32 AM(UTC)
Chris Daum

Rank: Advanced Member

Groups: Registered
Joined: 11/20/2020(UTC)
Posts: 74
Man
Germany

Thanks: 13 times
Was thanked: 9 time(s) in 9 post(s)
Hi DWAM,

no, was fooling around with Panasonic, Ross and Analog Way Mixers :-)
Corona lead me to cope with those online and streaming tools...
which is fine but a new world to discover

thanks so far!

API.function("setpanX",Input:=2, Value:="+0.05")
just defined the final position of my image on X axis
but not to repeated steps by 0.05

doggy  
#63 Posted : Tuesday, November 24, 2020 3:22:20 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 288 times
Was thanked: 947 time(s) in 782 post(s)
Originally Posted by: Chris Daum Go to Quoted Post
Hi DWAM,

no, was fooling around with Panasonic, Ross and Analog Way Mixers :-)
Corona lead me to cope with those online and streaming tools...
which is fine but a new world to discover

thanks so far!

API.function("setpanX",Input:=2, Value:="+0.05")
just defined the final position of my image on X axis
but not to repeated steps by 0.05



Value:="+=0.05"
thanks 1 user thanked doggy for this useful post.
Chris Daum on 11/25/2020(UTC)
DWAM  
#64 Posted : Tuesday, November 24, 2020 4:23:53 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:
API.function("setpanX",Input:=2, Value:="+0.05")
just defined the final position of my image on X axis but not to repeated steps by 0.05

Just as Doggy said, it's all about the syntax !
Added my demo video for PoC and clues (about repetitive process)
thanks 1 user thanked DWAM for this useful post.
Chris Daum on 11/25/2020(UTC)
Chris Daum  
#65 Posted : Wednesday, November 25, 2020 11:36:36 PM(UTC)
Chris Daum

Rank: Advanced Member

Groups: Registered
Joined: 11/20/2020(UTC)
Posts: 74
Man
Germany

Thanks: 13 times
Was thanked: 9 time(s) in 9 post(s)
Thanks DWAM & doggy,

that helped again!

No I proceeded to the next step and combined my x-axis control with a
midi knob (KORG control Studio).

That works quite fine but the steps in the movement are a bit to coarse for
my taste.

a 0,005 step is cool.

Now my next thougt...
The midi knob sends "speed" information 0-127.
Is there a way to connect certain "speed" values with a position change?
e.g.
"speed" 68-127 step +0.005
"speed" 67-0 step -0.005

like:
"get value" MIDICC 1:13 (that´s the knob used)
for value =68-127, API.function("SetPanx", input:=xy, value:="+=0.005")
for value =67-0; API.function("SetPanx", input:=xy, value:="-=0.005")
DWAM  
#66 Posted : Wednesday, November 25, 2020 11:52:13 PM(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)
I don't think Midi Control Change can handle value ranges like 0-63 or 64-128 (to be confirmed) when using the "shortcuts" interface in vMix.

However setting this knob to activate a "script" designed to allow speed control (with a "for" loop) would be my first idea to work on. This would even allow to set dynamic (linear or logarithmic) speeds according to the knob value...
Chris Daum  
#67 Posted : Thursday, November 26, 2020 12:05:35 AM(UTC)
Chris Daum

Rank: Advanced Member

Groups: Registered
Joined: 11/20/2020(UTC)
Posts: 74
Man
Germany

Thanks: 13 times
Was thanked: 9 time(s) in 9 post(s)
UserPostedImage
doggy  
#68 Posted : Thursday, November 26, 2020 12:15:48 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 288 times
Was thanked: 947 time(s) in 782 post(s)
Originally Posted by: Chris Daum Go to Quoted Post
UserPostedImage


Script will not be able to read the MIDI codes

BTW preferably your question would have been better put in a separate post . Post was started as a way to show basic scripting examples to learn from not discuss various problems and wishes which obscure the useful posts.
Many people would look to the separate post to as many don't use scripts hence are not looking here to give advice on the scripting subject

snapoid  
#69 Posted : Saturday, December 12, 2020 12:45:28 AM(UTC)
snapoid

Rank: Member

Groups: Registered
Joined: 9/13/2016(UTC)
Posts: 19
Location: Russia

Was thanked: 1 time(s) in 1 post(s)
In some cases i use many video-inputs with "NO Restart after transition" - only start (and some pause) - on training this videos may stay on another time, but before starting main session i needed to manually restart this video to start position. Can i get in script list of video-inputs and set it to start position ? This script i can assist to key-button and press it before translation-workprocess
DWAM  
#70 Posted : Saturday, December 12, 2020 12:53:48 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)
Wouldn't it be much simpler to simply use the Restart after transition option ?
Or simply add a trigger to force restart on transition ?
snapoid  
#71 Posted : Saturday, December 12, 2020 1:34:29 AM(UTC)
snapoid

Rank: Member

Groups: Registered
Joined: 9/13/2016(UTC)
Posts: 19
Location: Russia

Was thanked: 1 time(s) in 1 post(s)
No, i use 1 input-video in many another - multiview, virtual set and other. And i need to switch between this. If i set checkbox "restart after transition" - my video restarted every time on switch
doggy  
#72 Posted : Saturday, December 12, 2020 3:30:10 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 288 times
Was thanked: 947 time(s) in 782 post(s)
Originally Posted by: snapoid Go to Quoted Post
Can i get in script list of video-inputs and set it to start position ?


one can go through the API XML and pick out all the video inputs , one can even pick them out using the xml data source with the proper xpath
Or just have shortcut duplicated under the same key each doing the restart for each individual video
doggy  
#73 Posted : Monday, December 28, 2020 6:11:46 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 288 times
Was thanked: 947 time(s) in 782 post(s)
You want to transition to another input when a Photo Input (slideshow) has finished displaying all your images.
This can be done with a OnCompletion trigger
But this trigger does not work when the photos input is part of a multiview
Script to the rescue !


Code:
'Copy all this into a new script, name the script and save
'replace 13 with the input number of our Photos
'replace 14 with the input number you want to switch to
'trigger in your multiview to run the script (ontransitionin - scriptstart - name of script)


dim PhotoCompleted as string = ""
sleep(1000) 'a bit of delay to make sure the transition has finished, can be set in the trigger also 

do while true
  dim xml as string = API.XML()
  dim x as new system.xml.xmldocument
  x.loadxml(xml)

  PhotoCompleted = (x.SelectSingleNode("//input[13]/@state").InnerText)
  
  if PhotoCompleted = "Completed"
     API.Function("Fade",Input:="14",Duration:="500" ) , or any other function one wants to perform after all photos have been displayed
     exit do
  end if

  sleep(100)
loop


Edit: added the duration option to the transition
thanks 8 users thanked doggy for this useful post.
DWAM on 12/28/2020(UTC), stigaard on 12/28/2020(UTC), mburel1980 on 12/28/2020(UTC), dmwkr on 12/29/2020(UTC), clafarge on 1/5/2021(UTC), raugert on 2/4/2021(UTC), studiodelta on 4/13/2021(UTC), nikosman88 on 4/30/2022(UTC)
doggy  
#74 Posted : Wednesday, February 3, 2021 10:34:43 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 288 times
Was thanked: 947 time(s) in 782 post(s)
Play sound bites that are not audio inputs

Code:
'a windows sound (Hand is is one of the windows sounds)
My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)

'or
'a audio file
Dim sp As New System.Media.SoundPlayer("D:\somesound.wav")
		sp.Play()
		sp.Dispose()

thanks 1 user thanked doggy for this useful post.
clafarge on 2/4/2021(UTC)
doggy  
#75 Posted : Wednesday, February 3, 2021 10:51:14 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 288 times
Was thanked: 947 time(s) in 782 post(s)
Launch external application

Code:
'Launch an application and resume the script  when  app is closed 
Dim P As New Process
    P = Process.Start("notepad.exe")
    P.WaitForExit()


'Launch an application (example notepad with specified existing file)
Dim ExtApp As New ProcessStartInfo
ExtApp.FileName = "notepad.exe"
ExtApp.Arguments = "d:/demo.txt"
ExtApp.UseShellExecute = True
ExtApp.WindowStyle = ProcessWindowStyle.Normal
Dim proc As Process = Process.Start(ExtApp)


thanks 1 user thanked doggy for this useful post.
clafarge on 2/4/2021(UTC)
jgthweatt  
#76 Posted : Saturday, February 6, 2021 4:20:41 AM(UTC)
jgthweatt

Rank: Newbie

Groups: Registered
Joined: 5/18/2020(UTC)
Posts: 6
United States
Location: Maryland

I've been trying to update a Playback Video timer script I found on this forum.
Many thanks to the whomever posted first.

I would like to update script to reflect proper countdown in a markout point has been applied.

My problem is I can't figure out how to test if markout node exists in the XML file.
I've gone to several paths with xpath without success.

Here's the pertinent code

'Dump XML from API

dim xml as string = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)

'test if markout node referenced below exists

????

' use mark_out point instead of duration for timer

mark_out = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@markout").Value)

Any assistance is appreciated.
I'm doing fairy well with scripting in general but the XML manipulation is still confusing to me.

Jim
doggy  
#77 Posted : Saturday, February 6, 2021 4:33:24 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 288 times
Was thanked: 947 time(s) in 782 post(s)
Spelling !!

markOut


Code:
 try
    'code 
 Catch ex as Exception 
   'error trapping
   'empty to ignore error
  end try



PS. you got the code from page one of this topic ;-)
jgthweatt  
#78 Posted : Saturday, February 6, 2021 6:32:43 AM(UTC)
jgthweatt

Rank: Newbie

Groups: Registered
Joined: 5/18/2020(UTC)
Posts: 6
United States
Location: Maryland


Thanks for the quick response

Here's the updated code.

I'm not sure the best way to post update so others might find it easily, so please advise.



' PB-timeremaining-Active-New

' Checking time left of active running video and display this as a title.
' and do some stuff at certain time remaining

dim position as string = ""
dim duration as string = ""
dim activeinput as string = ""
dim clipname as string = ""
dim mark_out as string = ""

dim Timeleft as double = 0
dim triggertime as integer = 10 '10 seconds before end
dim triggerduration as integer = 2000 'fade duration, could be different than trigger

do while true

dim xml as string = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)

activeinput = (x.SelectSingleNode("//active").InnerText)
clipname = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@title").Value)
duration = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@duration").Value)
position = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@position").Value)


dim markout_exists as string = "yes"

try
mark_out = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@markOut").Value)
Catch ex as Exception
markout_exists = "no"
end try

if markout_exists = "yes" then
duration = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@markOut").Value)
else
duration = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@duration").Value)
end if

Timeleft= Double.Parse(duration)-Double.Parse(position)

API.Function("SetText",Input:="Grn/Red Rooms Label 1",SelectedIndex:="9" ,Value:=clipname)

Timeleft = Timeleft / 100

dim Timingleft as integer = CInt(Timeleft)
Timingleft = Timingleft / 10

dim Minutes as integer = Timingleft \ 60
dim Seconds as integer = Timingleft Mod 60

dim ThisTime as string
ThisTime = Minutes.ToString("00") + ":" + Seconds.ToString("00")

if Timingleft < 60
'put a response in a title and change color accordingly
API.Function("SetText",Input:="Grn/Red Rooms Label 1",SelectedIndex:="8" ,Value:=Timingleft) ' Value:=":", Value:=Seconds)

if Timingleft < 30
API.Function("SetTextColour",Input:="Grn/Red Rooms Label 1",SelectedIndex:="8",Value:="red")
else
API.Function("SetTextColour",Input:="Grn/Red Rooms Label 1",SelectedIndex:="8", Value:="orange")
end if
else
API.Function("SetText",Input:="Grn/Red Rooms Label 1",SelectedIndex:="8" ,Value:=ThisTime)
API.Function("SetTextColour",Input:="Grn/Red Rooms Label 1", SelectedIndex:="8" ,Value:="white")
end if


sleep(50)
loop
doggy  
#79 Posted : Saturday, February 6, 2021 6:41:52 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 288 times
Was thanked: 947 time(s) in 782 post(s)
Please put code in language quote so it's readable (Next to regular quote button)
doggy  
#80 Posted : Monday, February 8, 2021 4:39:13 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 288 times
Was thanked: 947 time(s) in 782 post(s)
V24 Dynamic Values a most basic example

Code:
API.Function("SetDynamicInput1",Value:="SomeTitle.gtzip") or API.Function("SetDynamicInput1",Value:="37")
API.Function("SetDynamicValue1",Value:="Guest Name")

API.Function("SetText",Input:="Dynamic1",SelectedName:="Description.Text",Value:="Dynamic1")


These dynamic values can be set or changed in a script or with a shortcut and once set can be used with any function or shortcut where these values could apply
Users browsing this topic
Guest (2)
26 Pages«<23456>»
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.