RGBAW color macros - possible?

Discuss macro programming, and post any new macros here!
matestubb
Posts: 8
Joined: Tue Sep 10, 2013 7:46 pm

RGBAW color macros - possible?

Post by matestubb »

Hi, I'm newly registered here. I've been able to save my own RBG macros by editing existing scripts, but am wondering if I could set up macros for my RGBAW lights.

I'm not a python master, but have slung some code from time to time.
Dave Brown [admin]
Posts: 2123
Joined: Sat Sep 15, 2012 4:53 pm
Has thanked: 5 times
Been thanked: 17 times

Re: RGBAW color macros - possible?

Post by Dave Brown [admin] »

Sure you can. The existing colour macros don't do anything complex - they just look for the colour channels based on name (e.g. "R" or "Red") and then perform some simple math on those channels. The same approach could just as easily process Amber/White channels. Take a look at the macros under the "Adjust Colour" folder...
Dave Brown - db audioware
Author of Show Buddy Setlist | Show Buddy Active | ArtNetMon
matestubb
Posts: 8
Joined: Tue Sep 10, 2013 7:46 pm

Re: RGBAW color macros - possible?

Post by matestubb »

OK, I ended up extending RGB.py with a new function, RgbawColour(r,g,b,a,w). Works a treat - now I can define my macros like normal.
beatrixkidd0
Posts: 1
Joined: Sun Oct 27, 2013 7:45 pm

Re: RGBAW color macros - possible?

Post by beatrixkidd0 »

hey matestubb, can you explain how you did this? i have an 8 channel RGBA led that I'm trying to add macro settings to.
matestubb
Posts: 8
Joined: Tue Sep 10, 2013 7:46 pm

Re: RGBAW color macros - possible?

Post by matestubb »

Sure, I'll grab the code when I get home tonight.
matestubb
Posts: 8
Joined: Tue Sep 10, 2013 7:46 pm

Re: RGBAW color macros - possible?

Post by matestubb »

Well I posted my code, but the forum eats all the spaces, and python doesn't like you to monkey with its spaces. I had to remove the post.

Sheesh!
Dave Brown [admin]
Posts: 2123
Joined: Sat Sep 15, 2012 4:53 pm
Has thanked: 5 times
Been thanked: 17 times

Re: RGBAW color macros - possible?

Post by Dave Brown [admin] »

matestubb wrote:...but the forum eats all the spaces, and python doesn't like you to monkey with its spaces. I had to remove the post....
Use the 'code' button (at the top of the editor) to post code, spaces and all.
Dave Brown - db audioware
Author of Show Buddy Setlist | Show Buddy Active | ArtNetMon
matestubb
Posts: 8
Joined: Tue Sep 10, 2013 7:46 pm

Re: RGBAW color macros - possible?

Post by matestubb »

Cool! Well, in that case - I added the following code at the bottom of macros/system/RGB.py:

Code: Select all

def RgbawColour(r,g,b,a,w):
    sel = GetAllSelCh(False)
    if len(sel)==0:
        Message("Select some RGBAW channels first!")

    for ch in sel:
        nm = GetChName(ch).lower()
        if nm=="r" or nm=="red":
            SetChVal(ch, r)
        elif nm=="g" or nm=="green":
            SetChVal(ch, g)
        elif nm=="b" or nm=="blue":
            SetChVal(ch, b)
        elif nm=="a" or nm=="amber":
            SetChVal(ch, a)
        elif nm=="w" or nm=="white":
            SetChVal(ch, w)
Since you want RGBA instead of RGBAW, you could paste this instead:

Code: Select all

def RgbaColour(r,g,b,a):
    sel = GetAllSelCh(False)
    if len(sel)==0:
        Message("Select some RGBA channels first!")

    for ch in sel:
        nm = GetChName(ch).lower()
        if nm=="r" or nm=="red":
            SetChVal(ch, r)
        elif nm=="g" or nm=="green":
            SetChVal(ch, g)
        elif nm=="b" or nm=="blue":
            SetChVal(ch, b)
        elif nm=="a" or nm=="amber":
            SetChVal(ch, a)
Or you could paste both, doesn't matter. Now copy a color macro file in the macros/colours/ subdirectories and rename it for your custom color. Then edit the contents of that file so that it looks like this:

Code: Select all

#===============================================================
# DMXIS Macro (c) 2010 db audioware limited
#===============================================================

RgbaColour(223,32,0,100)
replacing these r,g,b,a numbers with your own. Then save and restart DMXIS, and you should be able to see your new color. Make a new file for each custom color you want to add and edit as before.

Here's the caveat:
rgb.py is a system file, and when you upgrade to a new DMXIS version, your mods will be overwritten. It's also possible that the contents of that file will change with various updates - this python script may not work forever. You should back up your RGB.py file before modifying it so that you can replace it if things go wrong.

I've defined 20 or 30 of my custom colors using these macros and it works great.
RyanMcRobb
Posts: 36
Joined: Sat May 30, 2020 2:40 am
Has thanked: 3 times

Re: RGBAW color macros - possible?

Post by RyanMcRobb »

Just a heads up - when creating the code for selecting the RGBAW fixtures, it will also select the RGB fixtures and presumably any RGBA fixtures.
RyanMcRobb
Posts: 36
Joined: Sat May 30, 2020 2:40 am
Has thanked: 3 times

Re: RGBAW color macros - possible?

Post by RyanMcRobb »

I went and programmed all the RGBAW colours from Ben Stowe's RGBAW Mixing Chart:
https://www.nlfxpro.com/ben-stowes-rgba ... ing-chart/

You'll need to edit the RGB.py macro so the RGBAW colours are defined, as shown in earlier parts of the thread.

Note: When "Select All RGBAW Channels" is clicked, DMXIS selects RGB(and presumably RGBA) channels as well as the RGBAW channels. Picking these colour macros will affect these channels as well. Not sure what the fix is for this, but I still think it is worthwhile having the RGBAW colours in your macro list. :)
Attachments
RGBAW Colours.zip
(10.08 KiB) Downloaded 320 times
Post Reply