Spotlight on. Python
  Python for realtime control
       of stage lighting
 Nic Cave-Lynch – Tymar Lighting
Spotlight on. Python

    The problem

    Current architecture

    Version 2 architecture

    DMX Engine

    RDDD (Rubber Duck Driven Development)

    Observations
The problem

    Lighting bands, typically in small-ish venues

    DMX: 40 updates/second, 200-500 channels

    Moving lights (HTP/LTP)

    Music usually new to me
'Busking' in 4 dimensions
Enhance the music
Enhance the show
Current architecture

Input wing:    serial   asynchat      DMX engine       asynchat   USB     DMX
  faders                 gathers      HTP/LTP ->        sends
                                                                        generator
  buttons               wing input   channel value       DMX



              USB         (fcntl)
                                     moving light      Mimic
 trackball               capture
                                      manager        (wxPython)
                        trackball
Version 2 architecture

              USB/                                                                USB/
Input wing:   serial/
                                      ZeroMQ                ZeroMQ     DMX        serial/
   faders      MIDI     Input wing              DMX                                Wifi       DMX
                                                                     generator
   buttons               controller   struct   engine       struct                          generator
                                                                     controller
 trackballs

                         ZeroMQ                  ZeroMQ
                         protocol                protocol
                          buffers                buffers




                             Config UI / mimic
DMX Engine
   Engine()
     –   Holders for Valgens, Scenelets, Fixtures
     –   dispatches zmq messages from wing/UI

   Valgens know which Scenelets they drive

   Scenelet sends multiple of Valgen value to Fixture channels

   Fixture has channel for each aspect of the light
     –   output function eg calculate pan/tilt values from (x,y,z)

   Speed important:
     –   reduce lookups
     –   integer dict keys
     –   Valgen->Scenelet->Fixture single function call
     –   struct module
RDDD

    Architecture took ages

    Rubber Duck Driven Development

    "make something that doesn't work"
Observations

    Unit tests inhibit experimentation

    Deciding to Open Source can be an inhibitor

    Spoilt for choice in libraries/frameworks/etc.
     
         Analysis paralysis


    Surprising results in some performance areas
     
         struct module
     
         string/integer dict keys


    I hate OpenOffice.org Impress 3.2: it's barely useable
For more live Python action

              200 metres from dinner venue:

               ●   Left out of Tulsi

               ●   20 metres to Guznee St

               ●   Right up Ghuznee St

               ●   One block up

               ●   Straight over traffic lights

               ●   Bodega is on the left

Spotlight on Python

  • 1.
    Spotlight on. Python Python for realtime control of stage lighting Nic Cave-Lynch – Tymar Lighting
  • 2.
    Spotlight on. Python  The problem  Current architecture  Version 2 architecture  DMX Engine  RDDD (Rubber Duck Driven Development)  Observations
  • 3.
    The problem  Lighting bands, typically in small-ish venues  DMX: 40 updates/second, 200-500 channels  Moving lights (HTP/LTP)  Music usually new to me
  • 4.
    'Busking' in 4dimensions
  • 5.
  • 6.
  • 7.
    Current architecture Input wing: serial asynchat DMX engine asynchat USB DMX faders gathers HTP/LTP -> sends generator buttons wing input channel value DMX USB (fcntl) moving light Mimic trackball capture manager (wxPython) trackball
  • 8.
    Version 2 architecture USB/ USB/ Input wing: serial/ ZeroMQ ZeroMQ DMX serial/ faders MIDI Input wing DMX Wifi DMX generator buttons controller struct engine struct generator controller trackballs ZeroMQ ZeroMQ protocol protocol buffers buffers Config UI / mimic
  • 9.
    DMX Engine  Engine() – Holders for Valgens, Scenelets, Fixtures – dispatches zmq messages from wing/UI  Valgens know which Scenelets they drive  Scenelet sends multiple of Valgen value to Fixture channels  Fixture has channel for each aspect of the light – output function eg calculate pan/tilt values from (x,y,z)  Speed important: – reduce lookups – integer dict keys – Valgen->Scenelet->Fixture single function call – struct module
  • 10.
    RDDD  Architecture took ages  Rubber Duck Driven Development  "make something that doesn't work"
  • 11.
    Observations  Unit tests inhibit experimentation  Deciding to Open Source can be an inhibitor  Spoilt for choice in libraries/frameworks/etc.  Analysis paralysis  Surprising results in some performance areas  struct module  string/integer dict keys  I hate OpenOffice.org Impress 3.2: it's barely useable
  • 12.
    For more livePython action 200 metres from dinner venue: ● Left out of Tulsi ● 20 metres to Guznee St ● Right up Ghuznee St ● One block up ● Straight over traffic lights ● Bodega is on the left