Saving Presets

Discuss macro programming, and post any new macros here!
joebataz
Posts: 93
Joined: Tue Nov 12, 2013 4:55 am

Saving Presets

Post by joebataz »

I need to change all the dimmer values in my show so I wrote the following:

Code: Select all

val = 0
for ch in range(65,186):
    nm = GetChName(ch)
    if nm=="Dim":
        SelectCh(ch, 1)
        val = GetChVal(ch)
        if val > 133:
        	SetChVal(ch,133)
    else:
        SelectCh(ch, 0)
This worked fine but I needed to iterate over 36 Banks with up to 32 presets under each one. So I wanted to test it first on a single throwaway bank that I put at the top, so I added the following:

Code: Select all

val = 0
LoadBank(0)
for p in range(GetNumPresets()):
	LoadPreset(p)
	for ch in range(65,186):
	    nm = GetChName(ch)
	    if nm=="Dim":
	        SelectCh(ch, 1)
	        val = GetChVal(ch)
	        if val > 133:
	        	SetChVal(ch,133)
	    else:
	        SelectCh(ch, 0)
		SaveCurrentPreset()
Message(GetBankName(0))
I added the Message at the end to let me know when the python had run. Never gets there! Have played around for a while and just can't get it to save any presets. I can't even get to the message! In the DMXIS programming guide the call to save a preset is specified as:
SaveCurrentPreset
But in the code examples it is written as
SaveCurrentPreset()
Since I haven't done any real Python coding in a while I'm banging into syntax errors so is there a way to setup aPython system with the DMXIS libraries so I can have a real IDE to work in? Any suggestions as to where my code to save presets is going wrong?

Thanks in advance,

joeb
joebataz
Posts: 93
Joined: Tue Nov 12, 2013 4:55 am

Re: Saving Presets

Post by joebataz »

Whoops...
All the dimmers are in the channel range of 65 to 186. The 133 value comes from the dimmer channels also have strobing and an open function from 134 to 255 so to get smooth fading between presets I need to keep the channel values between 0 and 133.

joeb
Post Reply