Rank: Advanced Member
Groups: Registered
Joined: 3/20/2014(UTC) Posts: 2,721 Location: Bordeaux, France Thanks: 243 times Was thanked: 794 time(s) in 589 post(s)
|
Using SetPanX and SetPanY for PiP from a joystick
|
2 users thanked DWAM for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 11/20/2020(UTC) Posts: 74 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
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,188 Location: Belgium Thanks: 288 times Was thanked: 947 time(s) in 782 post(s)
|
Originally Posted by: Chris Daum 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"
|
1 user thanked doggy for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 3/20/2014(UTC) Posts: 2,721 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)
|
1 user thanked DWAM for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 11/20/2020(UTC) Posts: 74 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")
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 3/20/2014(UTC) Posts: 2,721 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...
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 11/20/2020(UTC) Posts: 74 Thanks: 13 times Was thanked: 9 time(s) in 9 post(s)
|
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,188 Location: Belgium Thanks: 288 times Was thanked: 947 time(s) in 782 post(s)
|
Originally Posted by: Chris Daum 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
|
|
|
|
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
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 3/20/2014(UTC) Posts: 2,721 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 ?
|
|
|
|
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
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,188 Location: Belgium Thanks: 288 times Was thanked: 947 time(s) in 782 post(s)
|
Originally Posted by: snapoid 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
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,188 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
|
8 users thanked doggy for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,188 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()
|
1 user thanked doggy for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,188 Location: Belgium Thanks: 288 times Was thanked: 947 time(s) in 782 post(s)
|
Launch external applicationCode:'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)
|
1 user thanked doggy for this useful post.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 5/18/2020(UTC) Posts: 6 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
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,188 Location: Belgium Thanks: 288 times Was thanked: 947 time(s) in 782 post(s)
|
Spelling !! markOutCode: 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 ;-)
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 5/18/2020(UTC) Posts: 6 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
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,188 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)
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,188 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
|
|
|
|
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.
Important Information:
The vMix Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close