LPC
  • Home
  • About Us
  • Projects
    • BlockyTalky
    • EPIC
    • Luminous Science
    • Weird Code Club
      • ARcadia
    • Creative++
  • Publications
  • Blog
  • Contact
  • Resources
  • Home
  • About Us
  • Projects
    • BlockyTalky
    • EPIC
    • Luminous Science
    • Weird Code Club
      • ARcadia
    • Creative++
  • Publications
  • Blog
  • Contact
  • Resources
Search

Programming & controlling a light show with physical computing tools

8/23/2018

 
Annie Kelly
Me playing bass and controlling a light show in real-time using cardboard foot pedals to trigger different lighting effects that I programmed ahead of time.
​

What? Why?

      Let me start off by telling you what I'm all about. I have a B.S. in Computer Science and also like to play bass guitar and make music in my spare time. Both of these interests are what led me to where I am today— wanting to create better computing technologies for artists and musicians to mess around with. Often times (not always of course) when you go to a venue the sound and the lighting are both being run by white dudes. You may have even heard the phrase "lighting guy" or "sound guy." There is no reason why these technologies and spaces need to be monopolized solely by tech-y white guy, but it has now become ingrained in our culture. In addition, there's no reason that these technologies can't be adapted to be more usable as DIY tools for the performers' themselves. I want to convince more people that they are capable of doing these kinds of things.
​      By adapting and remixing some popular DIY maker technologies, I have built the first iteration of what I hope to be an accessible toolkit for programming light shows and controlling them with custom built tangible interfaces. The micro:bit is commonly discussed as a computer science educational tool for children and adolescents. It is less commonly discussed as a useful tool for adult artists and musicians, and even for seasoned programmers like myself. I love using it. The Raspberry Pi on the other hand has typically been touted as a low-cost computer alternative for everyday use, or a playground for hackers to create all sorts of cool projects. Developing software for the Pi is not a beginner-friendly activity— however in this project I will describe how the Pi can be easily equipped with software to make it a powerful tool for allowing people to interface professional level hardware and more beginner-friendly microcontrollers. In particular, I will focus on stage lighting production tools and hardware.

Some important jargon

​      I'm going to give you a brief overview on working with stage lighting. Most of the time, whether it's a fog machine, an RGB light, lasers, etc, these devices can be controlled by a standard called DMX512. There are a couple of ways to control DMX devices: you could use a console like what you would typically see in a venue (think a big interface with lots of sliders and buttons), but you can also use a DMX USB interface and computer software like I have been doing in this project — I'll just refer to both of these generally as controllers. The number of OUTs on a controller determines how many universes it can control. One universe can contain up to 512 channels, hence the name DMX512. Each device has a certain number of channels, and different channels correspond to different parameters of the device. For example, channel 4 on a light might be the master dimming setting. This information will come back later when I talk about the block-based programming API I made for this.

System setup

Picture
Overview of all the pieces in this system.
      In the above diagram you can see that there are a few different components working together to make this all work. The micro:bit writes over serial to the Raspberry Pi, the Pi parses the serial data and wraps it into properly formatted DMX512 commands which are then sent to the Enttec OpenDMX USB interface, which in turn updates the two lighting fixtures. The software I wrote for the Pi relies on the Open Lighting Architecture Python API.
      The entire setup above cost about $200 (Raspberry Pi $40, micro:bit $12, DMX USB interface $70, Stage lights x2 $80). That's obviously not a trivial amount of money, however that is extremely low compared to the cost of some brand name, closed-source hardware, and also removes the cost of paying a lighting engineer to run the rig. For reference, Chauvet's, which is a popular brand for DJ equipment, consoles will set you back a few hundred bucks not including the amount you have to spend on lights as well. 
      With this setup, the user (unless they want to dive deeper into the software on the Pi) only has to program the micro:bit in order to control the lighting. The micro:bit programming editor provides many high-level abstractions for controlling the lights, just as a standard console that you would find in a venue. In the next section I will show an example of how I made three cardboard foot switches that trigger different sequences that I programmed on the micro:bit. ​

Making a light show

Picture
Three cardboard and aluminum foil foot switches.
      The above image shows the three foot switches I made for this light show (for a tutorial on how to make a pressure activated foot switch for the micro:bit go here.). Each switch can each be activated by stepping on them. The left most switch triggers a pink/yellow chase pattern (connected to pin P0 on the micro:bit), the middle switch triggers the orange scene (connected to pin P1), the right switch triggers the blackout (connected to pin P2). By default the scene is green when I am not stepping on any of the switches. When I say scene I mean a static light setting, for example in a given scene one light might be pink, and the other might be yellow. Different patterns can then be made by combining scenes. A chase pattern is a sequential switching between scenes, and in this example my chase is just the two lights switching back and forth between being pink and yellow (you can see everything I am talking about in the video at the start of this post).
Picture
Using a custom MakeCode package I built, the lighting API is simplified into 3 blocks: set fixture, update channel, and send DMX.
      Now that you know how the switches are connected to the micro:bit, let's look at the above code to see what's going on. When the program starts it first specifies that there are two lights in this setup and that each light has 8 channels. It then sets both lights' channel 3 to 255, which sets the lights master dim to full brightness. If you look inside the forever loop you will notice a series of if statements that check whether or not I am pressing down on any of the foot switches. If I am pressing down on switch 1 (pin P0) the program calls the chase function, if I press down on switch 2 (pin P1) the program calls the orange function, if I press down on switch 3 (pin P2) the program calls the blackout function, and if I am not pressing any of the switches the green function is called. Each of these functions is defined to the right. Let's look inside the green function. You can see a series of "update channel" calls being made.
      light1 update channel 4 to 0
      light1 update channel 5 to 100
      light1 update channel 6 to 0
      light2 update channel 4 to 0
      light2 update channel 5 to 100
      light2 update channel 6 to 0
      send dmx

As I mentioned earlier, each of my lights has 8 channels. However in this example I am only using channels 3-6 on each light. This is because channel 3 corresponds to the master dimming setting, channel 4 is the red setting, channel 5 is the green setting, and channel 6 is the blue setting. These lights use what is called RGB to create a color and each one can be a value between 0-255. For example, if red is 255 and green and blue are both 0 — the light will be red. If we then change blue to be 255, the light will become purple because we are mixing red light with blue light (think back to art class about how color mixing works). So, with that knowledge we can now look at the code example I posted above for the green function and see that it is in fact setting both lights to be green and then calling "send dmx" to officially update the lights.
      Now you can look at the other functions and try to see if you can figure out what is going on. Remember, you can always watch the video again for help.

Picture
This is what the pedal setup looks from my POV when the lights are on.

Other thoughts, next steps

      As a bassist who doesn't typically use pedals when I play, it is easier for me to use my feet to control lighting as opposed to a guitarist who might have to be switching distortion on and off at the same time that she would want to change the lights. There are other ways we can imagine controlling the lights in real-time. There is the potential to use audio analysis to detect transitions in the songs, entirely pre-programmed light shows that are fully automated, or have a friend in the audience running the lights for her. The nice thing about using a microcontroller is that there are tons of possibilities that are left to the imagination.
      Some of the next steps for this project will be further simplifying the API and providing a better way for users to keep track of which channels on each of their lights corresponds to what setting. In addition, I hope to further automate the software on the Pi so it is as simple as just powering everything on instead of having to ssh into the Pi and start the software manually.
      I am still learning a lot about DMX512 and practical lighting applications, so I'm sure things will change as I continue my research. Keep your eye out for some Raspberry Pi images available for download in the future. Thanks for reading!

Comments are closed.

    RSS Feed

  • Home
  • About Us
  • Projects
    • BlockyTalky
    • EPIC
    • Luminous Science
    • Weird Code Club
      • ARcadia
    • Creative++
  • Publications
  • Blog
  • Contact
  • Resources