快速登录:  

Forum: General Discussion

话题: Is there a more elegant way to script this?
Long story short, I want my Automix 'time remaining' to show the actual time remaining (based on cut in/out points, rather than full track length).

I wrote a script that successfully calculates the cut length of the track that I'll be using, and stored the millisecond value of that in the 'comments' field of each track.

I'm now trying to write a script that will look down my Automix queue, grab the 'comments' field of each track as integers, and add them together - so I can later convert this to minutes and seconds.

The below script works... but it's not elegant, and I'd have to keep repeating it up to around 100 if I want to make sure I'm counting everything in the Automix queue.

I've played with cycling a counting variable and pulling that in as the second parameter for get_automix_song, but VDJ doesn't like it and seems to insist on an actual typed integer as the second parameter.

Am I missing something really obvious?


get_automix_song 'comment' 1 & param_cast 'int' & set_var $runningTotal & get_automix_song 'comment' 2 & param_cast 'int' & set_var $toAdd & param_add `get_var $runningTotal` `get_var $toAdd` & set_var $runningTotal & get_automix_song 'comment' 3 & param_cast 'int' & set_var $toAdd & param_add `get_var $runningTotal` `get_var $toAdd` & set_var $runningTotal & get_automix_song 'comment' 4 & param_cast 'int' & set_var $toAdd & param_add `get_var $runningTotal` `get_var $toAdd` & set_var $runningTotal & get_automix_song 'comment' 5 & param_cast 'int' & set_var $toAdd & param_add `get_var $runningTotal` `get_var $toAdd` & set_var $runningTotal
 

发表时间 Fri 05 Jan 24 @ 4:32 pm
AdionPRO InfinityCTOMember since 2006
When automix is active the time remaining already takes mix time and mix points into account
 

发表时间 Fri 05 Jan 24 @ 4:49 pm
Was just about to post exactly the same thing.
 

发表时间 Fri 05 Jan 24 @ 4:50 pm
locoDogPRO InfinityModeratorMember since 2013
There is a way with virtualFX to get for loop() like behaviour and drop vars that will parse to values anywhere, but it's a lot more complicated to initially set up.
 

发表时间 Fri 05 Jan 24 @ 5:09 pm
locoDogPRO InfinityModeratorMember since 2013
@adion, there would be a minor error in cases of track on deck being a different sample rate to sound engine, very minor that corrects itself but it would be noticeable if the time returned needed to be accurate to the second.
 

发表时间 Fri 05 Jan 24 @ 5:30 pm
AdionPRO InfinityCTOMember since 2006
Indeed, issues with different sample rates will be fixed in next update
 

发表时间 Mon 08 Jan 24 @ 7:24 am
When automix is active the time remaining already takes mix time and mix points into account

That would make sense, but unfortunately it's not actually doing that.
 

发表时间 Tue 09 Jan 24 @ 9:39 am
Also, I'm looking for a way to (ideally) do this without having to have Automix active. 95% of the time I don't want to be using Automix.
 

发表时间 Tue 09 Jan 24 @ 10:06 am
AdionPRO InfinityCTOMember since 2006
But when automix is off neither the mix points or mix length will match your mixing anyway, so simply the total time as already shown would be just as good a guess no?
 

发表时间 Tue 09 Jan 24 @ 12:06 pm