Previous topicNext topic

tips & tricks : how to sync video or trigger from time line

Questions, comments, feedback, etc.
Post Reply
hazardman
Posts: 74
Joined: Sat Nov 08, 2014 1:33 am

tips & tricks : how to sync video or trigger from time line

Post by hazardman »

just thought i'd share a work-around on how i was able to ensure that my video would always be in sync with the track position time line after having posted such a feature request-lol viewtopic.php?f=4&t=1636...
VidSyncTest.jpg
VidSyncTest.jpg (259.71 KiB) Viewed 6743 times
what i came up with was to generate a test tone wav file (using wavelab but i'm sure other software such as audacity can do this) with the following parameters...
  1. square tone, 60hz
  2. length = project length
  3. linear fade in from -20db to 0db applied across the entire length
the square tone was from some trial and error as i first experimented with a sine wave but because it oscillated, it generated some unwanted values in magic...then i tried the square which gave pure steps in the waveform...i also chose 60hz frequency as i wanted to be able to sync up to 1/60 of a second...if you need a finer resolution, just increase the hz ;)

once i had this "tone" generated, i added the wave file to magic and created a source "ToneGenerator" for it, and muted the track...

then, i created a global parameter sourcing the "ToneGenerator" audio file, and added a scale modifier of "600" (as this was for a 10 minute long song) to convert the volume level into seconds-cool!..now i have a variable that has the same value as the song position line....so -20db = 0 seconds and 0 db = 600 seconds...

from that point, i was able to link the video start time to this global...the trick now was to ensure that the video started anytime i manually scrubbed the transport "head"...

to do that, i linked the GoTo Start to a no-source ramp modifier...when the ramp reached 1, it activated the start button...as a ramp value of 1 = 1 seconds, changing the ramp value will be like specifying a frame rate so thus controlling how precise the re-triggering needed to be...i found that 5, thus 1/5 of a second, was generally fast enough and again, this can be increased to suit your needs...

now, you can also use the global parameter to trigger events at a specific time and/or time ranges etc...

as in the screen shot example, i used an input selector to apply a HueSaturation modifier during a specific time period (413-510 seconds) via an InputSelector switch...

the switch was then linked to the global parameter and an expression was applied, if((x>413 and x<510),1,0) , so that the HueSaturation would be the selected input for that time range...

alternatively, i could have simply linked the HueSaturation's bypass to achieve the same results but just wanted to demonstrate the "switch" method to open up other types of "processing" possibilities (such and scene module switching etc.)...

anyway, i know eric has something in the works that will allow us to directly tap into the current song position time, but until that is incorporated in a future release, this, for me, is an effective alternative ;)

hope this "trick" may be helpful...

cheers!
reGeneraTed
Posts: 57
Joined: Fri Aug 25, 2017 12:26 am

Re: tips & tricks : how to sync video or trigger from time l

Post by reGeneraTed »

Hey Hazardman!

First off, excellent work here. It seems like you have engineered this together quite nicely :) . I have been wondering recently if it was possible to reference the time line via-expressions. I will definitely try to give this a go.

In the past, I have recently used this global expression to sync my videos:

Add a global variable with this setup:
------
Name: videoOnAndOFF
Source: 0
Feature: Volume
Expression: if (x <= 0.01, 0, 1)
------
OldNick
Posts: 59
Joined: Thu Feb 16, 2017 12:32 pm

Re: tips & tricks : how to sync video or trigger from time l

Post by OldNick »

Old post I know!


But I was overjoyed to see it. From no knowledge at all about Globals, I worked my way through and leaned quite a bit. I also came _so close_ to getting it right.

One thing left. If I play the video, I can stop and start it wherever and return to start. All good. But my problem is that every Ramp reset interval, the video has to jump a little. This seems to be a sync problem between the Ramp time and the video FPS. I can repeat this by altering the Ramp frequency for the Videofile module, which alters the the rapidity of the jumps. So with a Ramp rate of 1, I get a jump every 1 second, ....2 = 0.5 sec and 10 is 1/10th second. The video jumps back a frame or two then starts OK until the next Ramp interval.

Do you have any idea where I should look? Is it because the SyncTone is the wrong length for the tune/Video?

If you need, I can send a short video and screen shots

I would really appreciate any help on this.

Nick
OldNick
Posts: 59
Joined: Thu Feb 16, 2017 12:32 pm

Re: tips & tricks : how to sync video or trigger from time l

Post by OldNick »

Actually it occurred to me that the flicker does not really matter: when I render the video I just set the Ramp to Zero. :roll:
Post Reply