Page 1 of 1

Waves RGB Matrix Script

Posted: Fri Jul 03, 2015 5:33 pm
by nedmech
Hi all, and thanks to the team who have made this such a great program.

I wanted to have a line of splash lights fire off in a configurable wave pattern during a live performance and was getting frustrated by the limitations of using sequences and chasers to manage this. Someone pointed me in the direction of the RGB Matrix, and it opened up a huge realm of possibilities. None of the preconfigured scripts quite matched what I wanted, so I dove in and made my own.

Waves is a configurable RGB Matrix Script that is similar to the Strips/StripsFromCenter scripts, with the addition of being able to define the width of the tail following the wave, and whether the tail fades or is solid.

So far, I has four direction presets:
  • to the Right
  • to the Left
  • from both sides IN to the center
  • and from the center OUT to the sides
It can also be set to Vertical or Horizontal orientation. And of course it picks up the Start/End colors.

I'm only using this in a linear array, but it works just as well with a full 2D matrix. I'm thinking about adding some diagonal modes if anyone is interested. Hopefully someone will find this useful.

Re: Waves RGB Matrix Script

Posted: Sat Jul 04, 2015 9:53 am
by mcallegari
Thank you very much Nathan !
I'll test it as soon as I can

Re: Waves RGB Matrix Script

Posted: Tue Jul 07, 2015 11:44 am
by mcallegari
Just tested it. It's excellent ! Thank you :)

I've added it to QLC+.

I just noticed the switch/case block doesn't have a break for each case. Is that wanted or a mistake ?

Re: Waves RGB Matrix Script

Posted: Wed Jul 08, 2015 5:55 am
by nedmech
Thanks for looking at it and considering adding it to the library!

Yes, the lack of breaks is intentional. It took me a bit to remember why since I've slept since I last looked at the code. :oops:

The first case of each pair (1 = Left, 3 = Out) modifies the relative stepPos variable for the direction difference. Then it falls thru into the second case (0 = Right, 2 = In) to determine if that pixel gets filled for the relative stepPos. It was my tricky way of trying to keep the lines of code down and reduce repeated code. :geek:

Re: Waves RGB Matrix Script

Posted: Wed Jul 08, 2015 6:02 am
by janosvitok
In this case C/C++ people usually add "// no break" comment to mark that the missing break is intentional (in the place where break would be).

Re: Waves RGB Matrix Script

Posted: Wed Jul 08, 2015 6:02 am
by nedmech
janosvitok wrote:In this case C/C++ people usually add "// no break" comment to mark that the missing break is intentional (in the place where break would be).
Ah, my apologies. I wasn't aware of that convention. I'll make sure to do that from now on. Thanks for teaching me something!

Re: Waves RGB Matrix Script

Posted: Wed Jul 08, 2015 1:32 pm
by mcallegari
Well, I asked if that was wanted because it is an allowed coding (at least in C/C++) but you need to be sure of what you're doing.
In most cases it produces unwanted behaviours.

Placing a break in every case makes sure you confine the code in a single case, otherwise the compiler will continue to evaluate the other cases if it doesn't find a break statement.

Anyway I left the code as you've written it (I've just replaced tabs with spaces) and the script seems to be working fine.
If you want, you can send a Pull Request on GitHub with any update/fix. (or for new scripts ;) )

Thanks

Re: Waves RGB Matrix Script

Posted: Sun Jul 12, 2015 2:47 am
by tornel
Nathan,
The wave script is great!!!!
However it is acting a little strange when setted with Direction "IN" and the Fade Tail "On".
Edit: added more info
It happens both in Windows (8.1) and Ubuntu (14.10), QLC+ 4.9.1 GIT (just compiled from sources)

Re: Waves RGB Matrix Script

Posted: Mon Jul 13, 2015 6:50 am
by nedmech
Luis,
Thanks for the feedback! I thought I tested all the direction/fade combinations, but I guess I missed that one. I rearranged the code for code for that part and it should be fixed now. I've put in a Pull Request on GitHub with the changes. I've also attached the file here if you want to try it out before it gets into the next release.

Re: Waves RGB Matrix Script

Posted: Mon Jul 13, 2015 1:20 pm
by tornel
Thnak
I'll test it tonight or tomorrow nd let you know. Thanks!