-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathshowFFT.shtml
More file actions
64 lines (51 loc) · 3.35 KB
/
showFFT.shtml
File metadata and controls
64 lines (51 loc) · 3.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!--#include virtual="header.html" -->
<br>
<div align="center">
<h1> Audio Controlled Light Show </h1>
<div class="row-fluid">
<div class="span8 offset2">
<div class="thumbnail">
<iframe src="https://www.facebook.com/video/embed?video_id=593040450022" width="640" height="360" frameborder="0"></iframe>
<div class="caption">
<p>Main Contributors (in no particular order):</p>
<p>Blake Rego, Rurik Primiani, Brian Tovar</p>
</div>
</div>
</div>
</div>
</div>
<br>
<h2> Background </h2>
<p>
The light fixtures you see are Color Kinetics light arrays. There are currently 24 set up in the room. Each one has 45 LEDs- 15 red, green and blue. The intensities of each of these can be controlled on 0 to 255 scale, enabling the user a range of 24-bit color. By using different combinations of these, all intermediate colors are possible.
</p>
<p>
We can send color to the lights via a circuit board that contains an ethernet device and a 150W power supply. We connected this to a wireless router. To send information to the device, there is a specific UDP packet structure. We developed code around this in python.
</p>
<p>
We inherited the lights themselves and the power supply / network board. Everything else we designed (software) or fabricated (wires) ourselves.
</p>
<h2>What's going on in the video</h2>
<p>
We're opening up a .wav file, reading it, and performing an FFT on the data. There are as many frequency bands in the FFT as there are lights (so each light is assigned a frequency band). The power of each band determines a color. When power = 0, the lights are off. Between power=0 and power=MAX_POWER/2, green ranges from 0 to 255. Between power=MAX_POWER/2 to MAX_POWER, green goes from 255 to 0 while red goes from 0 to 255.
</p>
<p>
We also have tried a very elementary beat detection technique. We took the average power from each of the frequency bands and compared them to a threshold value that we specify. If the average is equal to or greater than the threshold, we set the blue to 255. If not, the blues are off. We are still working out the kinks.
</p>
<h2>Future Work</h3>
<!--
- Reading /dev/audio instead of a .wav file: The advantage here would be that we could use any audio player to choose songs/ sounds. The limit to .wav files is very restricting. However, this will cause other problems. Reading a .wav file has the advantage of 'knowing' the data ahead of time so there is minimal lag between the audio and the lights. Reading from /dev/audio would require all calculations to occur after the sound has been played. This may introduce performance problems. Depending on the lag, we may need to switch to C instead of python.
-->
<ul>
<li>
We are in the process of porting this code to work on a microcontroller. The hardware we have in mind is the Maple. We are designing a DMX shield, which should be available soon!
</li>
<li>Reading other devices: We have a keyboard that we are itching to create a light interface for.</li>
<li>
Interactive light keyboard: We want to develop a way for a visitor to come into our home and use the keyboard / mouse to control the lights in real time. They will be able to save their shows and play them back using a dynamically generated python script.
</li>
</ul>
<h2> Contact Us </h2>
<a href="contact.shtml" class="btn btn-primary"> Say hello</a>
<br>
<!--#include virtual="footer.html"-->