Forum: VirtualDJ Plugins

Questions about plugins development, talks with other developers etc
Topic: precisions about difference between repeat_start and repeat_start_instant needed
NicotuxHome userMember since 2014
repeat_start and repeat_start_instant differences other than just starting before or after first loop:

what i experiment :

Pad 1:
pad 2 & play

Pad 2:
repeat_start 'rept' 30ms 1 & nothing
Pad 2 will never return in this case and play will never execute

with pad 2:
nothing
there is no problem, play is executed

with pad 2:
repeat_start 'rept' 30ms 1 & repeat_stop 'rept' &...
Pad 2 does not return - even the loop is executed once and following actions are too

with pad 2:
repeat_start 'rept' 30ms 1 & nothing
Pad 2 does not return

with pad 2:
repeat_start_instant 'rept' 30ms -1 & repeat_stop 'rept' & ...
returns hearly - i.e.: returns to pad1 before Pad 2 ends as if pad 2 were a thread, following actions being executed as well once

with pad 2:
repeat_start_instant 'rept' 30ms -1 & nothing & ...
returns - as if pad 2 were a thread - even pad 2 is an infinite loop, following actions being executed as well all the time forever

it looks like repeat_start + repeat_stop is breaking the whole process chain at the end of the current one
and looks like repeat_start_instant is detaching the current loop from the process chain

Can someone explain or correct me ?

Inviato Wed 03 Jul 19 @ 2:32 am
I don't get your coding examples.
Anyway, the real difference between the 2 commands is not when they count the loop, but when they start executing.

repeat_start 'this' 5 500ms & something

The "something" action will execute 5 times with 500ms intervals. The first execution will happen AFTER 500 ms

repeat_start_instant 'this' 5 500ms & something

The "something" action will execute 5 times with 500ms intervals (same as above). The first execution will happen RIGHT NOW

So, it's not about counting the loops, but when the first execution will occur.

Try this:

repeat_start 'this' 4 2000ms & play ? pause : play

repeat_start_instant 'that' 4 2000ms & play ? pause : play

Finally:
using "pad X" action to chain complex actions together is not a good idea.
The action itself was meant to be used on controller mappings to trigger the actions of the pad, not as a way to combine multiple actions to one.
For complex tasks it's always better to bind the actual actions together.
So, to me your examples seem more like a failure of using the correct actions in a single sentence, rather than a problem with repeat_start actions.

Inviato Mon 08 Jul 19 @ 11:47 am
NicotuxHome userMember since 2014
I precised "other than just starting before or after first loop" of course this one is "opefully" well known

"Quote"
using "pad X" action to chain complex actions together is not a good idea.
"/Quote"

Using unused pads as a subroutine for some actions is something common... maybe a bad usage but common use now

"Quote"
For complex tasks it's always better to bind the actual actions together.
So, to me your examples seem more like a failure of using the correct actions in a single sentence, rather than a problem with repeat_start actions.
"/Quote"

The problem with binding actions together is many actions are NOT always usable in combination with other ones or queries.

Many heavily complex scripts actually can't work in one script pad line when they work fine splitted in 2 or more pads.
This is a side effect with the way parameters are passed to verbs and default parameters or possible multiple interpretations of parameters by some verbs.
Some verbs act differently depending on number of parameters they receive or even their type and results from previous action may interfer.
The use of a second pad in this situation often fixes misunderstanding of parameter list as no parameter is init at second pad start.
Not all the time because some verbs don't work in scripts when not alone.

Another one good reason is : to use "pad x" many times in a script is better than duplicate a very long script part as many times.
If using "pad x" were a bad idea it wouldn't exist at all in scripting but only in mapping because it does nothing else but chain actions - complex or not - together

I don't consider the difference as being a problem with repeat_start actions at all. It can be a feature to launch parallel tasks in really heavily complex script which can be usefull.

The question is can it be taken in consideration an being used or is it only a strange effect due to implementation that may change in future

Inviato Sun 14 Jul 19 @ 2:30 am