Page 1 of 1

Random Chase Order?

Posted: Thu Mar 20, 2014 2:32 pm
by Joe
Hi all,

Another feature request... Would it be possible to have "Random" added to the chaser as a direction? For scanners I generally make a bunch of positions then try and randomly scatter them in really long chases to keep the movement fresh, and having QLC+ randomly play back the positions would save much much time.

Thanks!

Random Chase Order?

Posted: Thu Mar 20, 2014 3:52 pm
by Jano Svitok
Can you propose some definition for "random order"?

Let's say we have a deck (chaser) of 10 cards (steps), and you have to show a random card every one minute. How would you go about that? Would you (1) pick some card, show it and stick it back to deck? Or (2) shuffle the deck and then show the cards one by one, and when it's done, shuffle it again? Or some other way?

Note that (1) seems more random, but one card can appear several times in a row (this case can be handled as a special case), while in (2) the frequency of each card is more or less equal. What's more preferable? What properties should the random order have?

If you propose a way, I'll implement it (unless I'm really busy with other things).

--

I was thinking also of making random EFX path, but it requires similar thought... so that
e.g. the movement respects speed, is not too random, etc. I'm afraid "pick any position every x milliseconds" won't work (and neither will the motors/joints :) )

Random Chase Order?

Posted: Thu Mar 20, 2014 4:06 pm
by Massimo Callegari
Hi, about this, I guess the most expected behaviour is that on 10 steps, they have to be reproduced randomly (with their own timings) with no repetitions until you reach 10. Then the random order is shuffled and played back again.

This is what happens on RGB matrix random effects at least.

Random Chase Order?

Posted: Thu Mar 20, 2014 4:44 pm
by Paul Evans
Effectively you want it to cycle through the cue deck, but every time it gets to the end and restarts it, it will shuffle the deck into a random order first, then play through each of them in that order. This would ensure fairness

Random Chase Order?

Posted: Thu Mar 20, 2014 4:47 pm
by Robert Scheffler
I am in favor of a "shuffle" as well. How ever many steps are in the chaser, shuffle them.

A special case (if you want to get fancy) is when you hit the end of the 'deck' and then shuffle, there is still a chance you repeat the last one as the first in the next 'shuffle' (but never repeats more than twice).

This happens in our audio players, we have changed all "random" to "shuffle" as people expect a 'shuffle' even when they ask for 'random'.

Bob

Random Chase Order?

Posted: Thu Mar 20, 2014 8:32 pm
by Joe
The shuffle style thing sounds fine to me. Also Jano, a Random EFX path would be great too. Only question is would you have it draw a path (better for moving heads) or just have random points (better for snap movements on Scanners).

Random Chase Order?

Posted: Thu Apr 03, 2014 9:20 am
by Jano Svitok
Random chase order is in git :)

Random Chase Order?

Posted: Thu Apr 03, 2014 9:29 am
by Massimo Callegari
Ouch ! Right after I've done this so long awaited Chaser tutorial :(

Well done anyway :)

Re: Random Chase Order?

Posted: Thu Aug 10, 2023 1:43 pm
by Wazzledi
Hey,

just a quick question: Is it intended that a random order chase connected to a button in the virtual console always starts with the first function in the chase?
As I understood it right, the order gets shuffled before playing the chase.

I am currently searching in the code if i can find the place where this is implemented.

I assume the "computeNextStep" in the ChaserRunner class is the function that is called when starting and stepping a chaser, right?
Can someone give me a hint where the start of a chaser from a virtual console is implemented?
Otherwise, i have to search the code.

Best regards,
Dennis

Re: Random Chase Order?

Posted: Fri Aug 11, 2023 12:06 pm
by Wazzledi
I actually found the line in the code that causes this "issue".

In "chaserrunner.cpp" in the write method when we execute the ChaserSetStepIndex action, which is attached and called by "vcbutton.cpp" in the pressFunction method, the index of the chase always gets set to 0.

The randomStepIndex method gets never used for this action.
Therefore, i changed the code to this:

Code: Select all

if(m_chaser->runOrder() == Function::Random)
{
	m_lastRunStepIdx = randomStepIndex(m_pendingAction.m_stepIndex);
}
else
{
	m_lastRunStepIdx = m_pendingAction.m_stepIndex;
}
The if statement is not necessarily needed here because the randomStepIndex method already checks the necessary condition.

Now the chase always starts with another chase function instead of always using the first one.
If that is intended behavior, i can submit a pull request, otherwise, i just use it for myself.

Re: Random Chase Order?

Posted: Mon Aug 14, 2023 8:57 am
by mcallegari
Hi, please send a Pull Request and I'll check it when I have some time. Thanks