<?xml version="1.0" encoding="ISO-8859-1"?>
<device image="mh.gif" initsequence="set 10 128;set 11 128;set 12 128;set 13 128">
 <information>
  <name>Martin Mac 500 (Mode 4)</name>
 </information>
 <channels>
  <function channel="0" minvalue="0" maxvalue="255" name="Multifunktion" fade="no" action="GetShutter"/>
  <function channel="1" minvalue="0" maxvalue="255" name="Helligkeit" fade="yes" type="dimmer"/>
  <function channel="2" minvalue="0" maxvalue="255" name="Farbe 1" fade="no" action="GetColor1" type="color"/>
  <function channel="3" minvalue="0" maxvalue="255" name="Farbe 2" fade="no" action="GetColor2"/>
  <function channel="4" minvalue="0" maxvalue="255" name="Drehbares Gobo" fade="no" action="GetRGobo" type="gobo"/>
  <function channel="5" minvalue="0" maxvalue="255" name="Goborotation" fade="no" action="GetRGobo"/>
  <function channel="6" minvalue="0" maxvalue="255" name="Festes Gobo" fade="no" action="GetFGobo"/>
  <function channel="7" minvalue="0" maxvalue="255" name="Fokus" fade="no"/>
  <function channel="8" minvalue="0" maxvalue="255" name="Iris" fade="yes" action="GetIris"/>
  <function channel="9" minvalue="0" maxvalue="255" name="Prisma" fade="no" action="GetPrism"/>
  <function channel="10" minvalue="0" maxvalue="255" name="Pan" fade="yes" type="pan"/>
  <function channel="11" minvalue="0" maxvalue="255" name="Pan (Fein)" fade="yes" type="panfine"/>
  <function channel="12" minvalue="0" maxvalue="255" name="Tilt" fade="yes" type="tilt"/>
  <function channel="13" minvalue="0" maxvalue="255" name="Tilt (Fein)" fade="yes" type="tiltfine"/>
  <function channel="14" minvalue="0" maxvalue="255" name="Bewegungsgeschwindigkeit" fade="no"/>
  <function channel="15" minvalue="0" maxvalue="255" name="Effektgeschwindigkeit" fade="no"/>
 </channels>
 <form width="440" height="399">
 
  <!--  Gerätbeschreibungen und Icon -->
  <deviceimage top="0" left="0" width="33" height="33"/>
  <devicename top="0" left="40" width="129" height="17"/>
  <deviceadress top="16" left="40" width="129" height="17"/>
  
  <!--  Koordinatensystem -->
  <position top="40" left="8" height="177" width="177"/>
  
  <!-- Shutter und Helligkeit-->
  <label top="224" left="8" caption="Shutter"/>
  <dropdown top="240" left="16" width="169" name="shutter_mode" action="SetShutter">
   <item caption="Shutter geschlossen" value="0"/>
   <item caption="Shutter offen" value="20"/>
   <item caption="Strobe" value="-1"/>
   <item caption="Pulsierend öffnen" value="-2"/>
   <item caption="Pulsierend schliessen" value="-3"/>
   <item caption="Zufälliges Strobe langsam" value="128"/>
   <item caption="Zufälliges Strobe mittel" value="148"/>
   <item caption="Zufälliges Strobe schnell" value="168"/>
   <item caption="Zuf. puls. öffnen langsam" value="195"/>
   <item caption="Zuf. puls. öffnen schnell" value="192"/>
   <item caption="Zuf. puls. schliessen langsam" value="201"/>
   <item caption="Zuf. puls. schliessen schnell" value="198"/>
  </dropdown>

  <label top="265" left="16" caption="Geschw"/>
  <slider top="265" left="60" height="25" width="125" startvalue="0" endvalue="19" tickfreq="5" 
      smallchange="1" largechange="5" name="shutter_speed" action="SetShutter"/>
  
  <label top="295" left="8" caption="Helligkeit"/>
  <slider top="311" left="16" height="25" width="169" startvalue="0" endvalue="255" tickfreq="51" smallchange="10" largechange="50" channel="1"/>
  
  <!-- Befehle -->
  
  <label top="340" left="8" caption="Gerätebefehl:"/> 
  
  <dropdown top="360" left="16" width="137" name="shutter_special" action="SetShutter">
   <item caption="keiner" value="0"/>
   <item caption="Reset" value="210"/>
   <item caption="Lampe zünden" value="230"/>
   <item caption="Lampe abschalten" value="255"/>
  </dropdown>
  
  <!-- Farbräder -->
  <label top="0" left="200" caption="Farbrad 1"/>
  <dropdown top="16" left="208" width="137" name="color_color1" action="SetColor1">
   <item caption="Weiss" value="0"/>
   <item caption="Blau 111" value="16"/>
   <item caption="Rot 301" value="32"/>
   <item caption="Magenta 507" value="48"/>
   <item caption="Grün 202" value="64"/>
   <item caption="Gelb 604" value="80"/>
   <item caption="Purple 502" value="96"/>
   <item caption="Blau 101" value="112"/>
   <item caption="Pink 312" value="128"/>
   <item caption="Hellblau 401" value="144"/>
   <item caption="Drehung UZ" value="-1"/>
   <item caption="Drehung GUZ" value="-2"/>
  </dropdown>
  <label top="0" left="360" caption="Geschw"/>
  <slider top="16" left="355" height="25" width="70" startvalue="0" endvalue="28" tickfreq="7" 
      smallchange="1" largechange="5" name="color_speed1" action="SetColor1"/>

  <label top="40" left="200" caption="Farbrad 2"/>
  <dropdown top="56" left="208" width="137" name="color_color2" action="SetColor2">
   <item caption="Weiss" value="0"/>
   <item caption="CTC +" value="16"/>
   <item caption="CTC ++" value="32"/>
   <item caption="Blau 104" value="48"/>
   <item caption="UV 108" value="64"/>
   <item caption="Grün 206" value="80"/>
   <item caption="Rot 308" value="96"/>
   <item caption="Gelb 603" value="112"/>
   <item caption="CTC --" value="128"/>
   <item caption="CTC -" value="144"/>
   <item caption="Drehung UZ" value="-1"/>
   <item caption="Drehung GUZ" value="-2"/>
  </dropdown>
  <label top="40" left="360" caption="Geschw"/>
  <slider top="56" left="355" height="25" width="70" startvalue="0" endvalue="28" tickfreq="7" 
      smallchange="1" largechange="5" name="color_speed2" action="SetColor2"/>
  
  <!-- Goboräder -->
  
  <label top="85" left="200" caption="Drehbares Gobo"/>
  <dropdown top="101" left="208" width="137" name="gobos_rgobo" action="SetRGobo">
   <item caption="leer"   value="0"/>
   <item caption="Dreieck" value="1"/>
   <item caption="Strich" value="2"/>
   <item caption="Atom" value="3"/>
   <item caption="Glas" value="4"/>
   <item caption="Weltkugel" value="5"/>
  </dropdown>
  
  <label top="85" left="355" caption="Index/Geschw"/>
  <slider top="101" left="355" height="25" width="70" startvalue="0" endvalue="124" tickfreq="31" 
       smallchange="1" largechange="5" name="gobos_speedindex" action="SetRGobo"/>
       
  <label top="129" left="208" caption="Rotation:"/>
  <dropdown top="126" left="255" width="90" name="gobos_mode" action="SetRGobo">
   <item caption="keine" value="0"/>
   <item caption="im UZ" value="-1"/>
   <item caption="gegen UZ" value="-2"/>
   <item caption="Winkel" value="-3"/>
  </dropdown>
  
  <label top="150" left="200" caption="Festes Gobo"/>
  <dropdown top="166" left="208" width="137" name="gobos_fgobo" action="SetFGobo">
   <item caption="leer"   value="0"/>
   <item caption="Ring" value="1"/>
   <item caption="Punkte" value="2"/>
   <item caption="Splitter" value="3"/>
   <item caption="Vierecke" value="4"/>
   <item caption="Wachs" value="5"/>
   <item caption="Platine" value="6"/>
   <item caption="Pommes" value="7"/>
   <item caption="Netz" value="8"/>
   <item caption="Sonne" value="9"/>
  </dropdown>
  
  
  <!-- Prisma -->
  
  <label top="199" left="200" caption="Prisma"/>
  <dropdown top="215" left="208" width="137" name="prism_mode" action="SetPrism">
   <item caption="Prisma aus" value="0"/>
   <item caption="Rotieren UZ" value="-1"/>
   <item caption="Rotieren GUZ" value="-2"/>
   <item caption="Prisma stopp" value="80"/>
  </dropdown>
  <label top="199" left="360" caption="Geschw"/>
  <slider top="215" left="355" height="25" width="70" startvalue="0" endvalue="59" tickfreq="12" 
      smallchange="1" largechange="5" name="prism_speed" action="SetPrism"/>
      
  <!-- Focus und Iris -->
  
  <label top="249" left="200" caption="Focus"/>
  <slider top="265" left="208" height="25" width="137" startvalue="0" endvalue="255"
     tickfreq="51" smallchange="1" largechange="20" channel="7"/>
  
  <label top="295" left="200" caption="Iris"/>
  <dropdown top="311" left="208" width="169" name="iris_mode" action="SetIris">
   <item caption="einstellbar" value="0"/>
   <item caption="Pulsierend öffnend" value="-1"/>
   <item caption="Pulsierend schließend" value="-2"/>
   <item caption="Puls. öffnend zufällig schnell" value="244"/>
   <item caption="Puls. öffnend zufällig langsam" value="248"/>
   <item caption="Puls. schließend zufällig schnell" value="252"/>
   <item caption="Puls. schließend zufällig langsam" value="254"/>
  </dropdown>
      
  <slider top="335" left="208" height="25" width="169" startvalue="0" endvalue="208" tickfreq="52"
    smallchange="16" largechange="32" name="iris_fader" action="SetIris"/>
    
  <!--  Speed  -->
  
  <label top="379" left="200" caption="Dunkel bei Bewegung"/>
  <onoff name="Dunkel bei Bewegung" channel="14" offvalue="0" onvalue="255" 
     top="375" left="320" width="30" height="21"/>
      
  <!--
  <slider top="176" left="304" height="25" width="81" startvalue="0" endvalue="59" tickfreq="20" smallchange="10" largechange="20" name="prism_speed" action="SetPrism"/>
-->
  <!-- Speed 
  <label top="241" left="208" caption="Geschw.:"/>
-->
  <!-- Kontrollbefehle 
  <command top="272" left="192" width="41" caption="Reset" clicksequence="save 0;set 0 210;hold 5500;restore 0"/>
  <command top="272" left="88" width="105" caption="Lampe abschalten" clicksequence="save 0;set 0 255;hold 5500;restore 0"/>
  <command top="272" left="0" width="89" caption="Lampe zünden" clicksequence="save 0;set 0 230;hold 5500;restore 0"/>
  <label top="274" left="240" caption="Fokus:"/>
  <slider top="272" left="272" height="25" width="113" startvalue="0" endvalue="255" tickfreq="51" smallchange="50" largechange="100" channel="5"/>
-->

<!--  <line x1="56" y1="232" x2="184" y2="232"/>
  <line x1="232" y1="8" x2="384" y2="8"/>
  <line x1="232" y1="48" x2="384" y2="48"/>
  <line x1="240" y1="168" x2="384" y2="168"/>
  <line x1="240" y1="208" x2="384" y2="208"/>
  <line x1="192" y1="0" x2="192" y2="265"/>
  <line x1="0" y1="265" x2="384" y2="265"/>-->
 </form>
 
 
 <code>
 
  <procedure name='INITCONTROLS'>
   !call|GetShutter$
   !call|GetColor1$
   !call|GetColor2$
   !call|GetRGobo$
   !call|GetPrism$
   !call|GetFGobo$
   !call|GetIris$
  </procedure>


  <!-- Shutter -->
  
  <procedure name='GetShutter'>
!if|({channel_0} &lt; 50) or ({channel_0} &gt; 120)|
 !set_control|shutter_mode|{channel_0}$
 !set_control|shutter_speed|0$
 !set_control|shutter_special|0$
|
 !if|({channel_0} &gt; 49) and ({channel_0} &lt; 73)|
  !set_control|shutter_mode|-1$
  !set_control|shutter_speed|(69-{channel_0})$
  !set_control|shutter_special|0$
 $
 !if|({channel_0} &gt; 79) and ({channel_0} &lt; 100)|
  !set_control|shutter_mode|-2$
  !set_control|shutter_speed|(99-{channel_0})$
  !set_control|shutter_special|0$
 $
 !if|({channel_0} &gt; 99) and ({channel_0} &lt; 120)|
  !set_control|shutter_mode|-3$
  !set_control|shutter_speed|(119-{channel_0})$
  !set_control|shutter_special|0$
 $
 !if|({channel_0} &gt; 207)|
  !set_control|shutter_mode|-3$
  !set_control|shutter_speed|(119-{channel_0})$
  !set_control|shutter_special|{channel_0}$

$
  </procedure>
  
  
  <procedure name='SetShutter'>
 !if|{shutter_special}|gt|0|
  !set_channel|0|{shutter_special}$
 $
 !if|{shutter_mode}|gt|-1|
  !set_channel|0|{shutter_mode}$
 |
 !if|{shutter_mode}|eq|-1|
  !set_channel|0|(69-{shutter_speed})$
 $
 !if|{shutter_mode}|eq|-2|
  !set_channel|0|(99-{shutter_speed})$
 $
 !if|{shutter_mode}|eq|-3|
  !set_channel|0|(119-{shutter_speed})$
 $
$
  </procedure>

<!-- Fardräder -->

  <procedure name='GetColor1'>
!if|{channel_2} &lt; 185|
 !set_control|color_color1|{channel_2}$
 !set_control|color_speed1|0$
|
 !if|({channel_2} &gt; 184) and ({channel_2} &lt; 216)|
  !set_control|color_color1|-1$
  !set_control|color_speed1|(215-{channel_2})$
 $
 !if|({channel_2} &gt; 215) and ({channel_2} &lt; 246)|
  !set_control|color_color1|-2$
  !set_control|color_speed1|({channel_2}-217)$
 $
$
  </procedure>
  
  
  <procedure name='SetColor1'>
!if|{color_color1}|gt|-1|
 !set_channel|2|{color_color1}$
|
 !if|{color_color1}|eq|-1|
  !set_channel|2|(215-{color_speed1})$
 $
 !if|{color_color1}|eq|-2|
  !set_channel|2|(217+{color_speed1})$
 $
$
  </procedure>


  <procedure name='GetColor2'>
!if|{channel_3} &lt; 185|
 !set_control|color_color2|{channel_3}$
 !set_control|color_speed2|0$
|
 !if|({channel_3} &gt; 184) and ({channel_3} &lt; 216)|
  !set_control|color_color2|-1$
  !set_control|color_speed2|(215-{channel_3})$
 $
 !if|({channel_3} &gt; 215) and ({channel_3} &lt; 246)|
  !set_control|color_color2|-2$
  !set_control|color_speed2|({channel_3}-217)$
 $
$
  </procedure>
  
  
  <procedure name='SetColor2'>
!if|{color_color2}|gt|-1|
 !set_channel|3|{color_color2}$
|
 !if|{color_color2}|eq|-1|
  !set_channel|3|(215-{color_speed2})$
 $
 !if|{color_color2}|eq|-2|
  !set_channel|3|(217+{color_speed2})$
 $
$
  </procedure>

<!-- Rotating Gobo -->
  
  <procedure name='GetRGobo'>
!if|{channel_4} &lt; 56|
 !set_control|gobos_rgobo|0$
 !set_control|gobos_mode|0$
 !set_control|gobos_speedindex|0$
|
 !if|({channel_4} &gt; 155)|
  !set_control|gobos_rgobo|((256-{channel_4})/20)$
  !if|(({channel_5} &lt; 3) or ({channel_5} &gt; 252))|
   !set_control|gobos_mode|0$
   !set_control|gobos_speedindex|0$
  $
  !if|(({channel_5} &gt; 127) and ({channel_5} &lt; 253))| 
   !set_control|gobos_mode|-1$
   !set_control|gobos_speedindex|(252-{channel_5})$
  $
  !if|(({channel_5} &gt; 2) and ({channel_5} &lt; 128))| 
   !set_control|gobos_mode|-2$
   !set_control|gobos_speedindex|({channel_5}-3)$
  $
 $
  !if|(({channel_4} &gt; 55) and ({channel_4} &lt; 156))| 
   !set_control|gobos_mode|-3$
   !set_control|gobos_speedindex|({channel_5}/2)$
   !set_control|gobos_rgobo|(({channel_4}-36)/20)$ -->
  $
$
  </procedure>
  
  <procedure name='SetRGobo'>
!if|{gobos_rgobo}|eq|0|
 !set_channel|4|0$
 !set_channel|5|0$
 !set_control|gobos_mode|0$
| 
 !if|{gobos_mode}|eq|0|
  !set_channel|4|(256-({gobos_rgobo}*20))$
  !set_channel|5|0$
 $
 !if|{gobos_mode}|eq|-1|
  !set_channel|4|(256-({gobos_rgobo}*20))$
  !set_channel|5|(252-{gobos_speedindex})$
 $
 !if|{gobos_mode}|eq|-2|
  !set_channel|4|(256-({gobos_rgobo}*20))$
  !set_channel|5|({gobos_speedindex}+3)$
 $
 !if|{gobos_mode}|eq|-3|
  !set_channel|4|(({gobos_rgobo}*20)+36)$
  !set_channel|5|({gobos_speedindex}*2)$
 $
$
  </procedure>
  
 <!--   Fixed Gobo   -->
 
  <procedure name='GetFGobo'>
  !set_control|gobos_fgobo|({channel_6}/10)$
  </procedure>
  
  <procedure name='SetFGobo'>
  !set_channel|6|({gobos_fgobo}*10)$
  </procedure>
 
 
 <!--   Prisma   -->
 
  <procedure name='GetPrism'>
!if|(({channel_9} &lt; 20) or (({channel_9} &gt; 79) and ({channel_9} &lt; 90)) or ({channel_9} &gt; 215))|
 !set_control|prism_mode|0$
 !set_control|prism_speed|0$
|
 !if|({channel_9} &gt; 19) and ({channel_9} &lt; 80)|
  !set_control|prism_mode|-1$
  !set_control|prism_speed|(79-{channel_9})$
 $
 !if|({channel_9} &gt; 89) and ({channel_9} &lt; 150)|
  !set_control|prism_mode|-2$
  !set_control|prism_speed|({channel_9}-90)$
 $
$
  </procedure>
  <procedure name='SetPrism'>
!if|{prism_mode}|gt|-1|
 !set_channel|9|{prism_mode}$
|
 !if|{prism_mode}|eq|-1|
  !set_channel|9|(79-{prism_speed})$
 $
 !if|{prism_mode}|eq|-2|
  !set_channel|9|(90+{prism_speed})$
 $
$
  </procedure>
  
  <!-- Iris -->
  
  <procedure name='GetIris'>
!if|({channel_8} &lt; 216)|
 !set_control|iris_fader|{channel_8}$
 !set_control|iris_mode|0$
|
 !if|({channel_8} &gt; 215) and ({channel_8} &lt; 230)|
  !set_control|iris_mode|-1$
  !set_control|iris_fader|((229-{channel_8})*16)$
 $
 !if|({channel_8} &gt; 229) and ({channel_8} &lt; 244)|
  !set_control|iris_mode|-2$
  !set_control|iris_fader|((243-{channel_8})*16)$
 $
$
  </procedure>
  
  
  <procedure name='SetIris'>
!if|{iris_mode}|gt|0|
 !set_channel|8|{iris_mode}$
|
 !if|{iris_mode}|eq|0|
  !set_channel|8|{iris_fader}$
 $
 !if|{iris_mode}|eq|-1|
  !set_channel|8|(229-({iris_fader}/16))$
 $
 !if|{iris_mode}|eq|-2|
  !set_channel|8|(243-({iris_fader}/16))$
 $
$
  </procedure>
  
 </code>
</device>