forked from blakerego/personalWebsite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshowFFT.shtml
64 lines (53 loc) · 3.75 KB
/
showFFT.shtml
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">
<h2> Audio Controlled Light Show </h2>
<object width="576" height="324" ><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.facebook.com/v/593040450022" /><embed src="http://www.facebook.com/v/593040450022" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="576" height="324"></embed></object>
<br><h4>
Main Contributors (in no particular order): <br>Blake Rego, Rurik Primiani, Brian Tovar
</h4>
<h3> Background </h3>
</div>
<div align="justify">
<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>
</div>
<h3 align="center">What's going on in the video</h3>
<div align="justify">
<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>
</div>
<h3 align="center">Future Work</h3>
<div align="justify">
<p>
- 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!
<!--
- 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.
-->
</p>
<p>
- Reading other devices: We have a keyboard that we are itching to create a light interface for.
</p>
<p>
- 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.
</p>
</div>
<h3 align="center"> Contact Us </h3>
<div align="justify">
<p>
If you have any questions, comments, criticisms or suggestions, contact me at [email protected]. If you're in the Boston/ Cambridge area and want to see the lights up close, also let me know and we'll try to work something out.
</p>
</div>
<br>
<!--#include virtual="footer.html"-->