Music

My friend Kamal needed some practice welding before he started on his sweet bike frame, so he asked around if anyone needed stuff welded. Rather than weld some modern art together, we came up with something entertaining, yet still trashy. I give you: the industrial-grade steel Kazoo:

This beauty will survive even a frustrated listener ripping it from a 9-year-old's mouth and kicking it out a window.

This beauty will survive even a frustrated listener snatching it out of a 9-year-old’s mouth and kicking it out a window.

First, we cut appropriate holes in some steel pipe. Then, we welded the pieces together.

Kamal welds some bike-frame-sized scraps of pipe together.

Kamal welds some bike-frame-sized scraps of pipe together.

Since he wanted to get a solid seal around the weld where the two pieces met to form a T but it was some of his first work, Kamal ended up with some excess weld, so he ground it off.

Kamal smooths off the weld of the kazoo.

Kamal smooths off the weld of the kazoo.

After we deburred the pipe, I used a small piece of PVC pipe to stretch and hold some plastic from a grocery bag, plugging the little end of the kazoo. Here’s how it sounds.

That said, it’s even easier to make a kazoo with some PVC tubing. All you need is a T joint, about a foot of PVC, a PVC cutter, and a plastic grocery bag. I made a couple of these in high school and found 1/2″ ID makes the best sound.

This is all you need for the world's most annoying instrument.

This is all you need for the world’s most annoying instrument.

Then, you cut the PVC to appropriate length and cut out a square of grocery bag, plugging it into the middle hole of the T joint. These are also fun to decorate.

Play around with the tightness of the grocery bag, but try not to rip it.

Play around with the tightness of the grocery bag, but try not to rip it.

This one's a little less industrial but it still quite loud.

This one’s a little less industrial but it still quite loud.

 

This isn’t a project that I came up with, but it’s the final lab project for MIT’s introduction to circuits class (6.002), and I thought it was a neat project that brought all the phenomena we studied over the semester as well as encouraging modular circuit design, so I wanted to share it with you. The project was to build a music playing system, as shown in the following block diagram. A memory unit was given to us, but we built a clock, a DAC, an active low pass filter, and a small amplifier.

This block diagram of the music player was taken from the 6.002 OCW website.

This block diagram of the music player was taken from the 6.002 OCW website.

The clock was simply a square wave generator made with a Schmitt trigger. The DAC required a set of resistors with certain relative values, so I made a python script to select a set of resistors. The script looked at the set of all standard resistor values in the lab to which I had access as well as the combinations of those values in series and parallel, and it sorted those by total error. From the results, I selected a set that had mostly single resistors rather than combinations, for ease of assembly. You can see the pile in the middle of the breadboard.

I built this part first. It contains the timer, counter, memory, and DAC.

I built this part first. It contains the timer, counter, memory, and DAC.

I tested each module after I built it.

The signal from the memory had high frequency noise due to being discretized.

The signal from the memory had high frequency noise due to being discretized.

The low pass filter smoothed the noise out.

The low pass filter smoothed the noise out.

Here, the amplifier scales a sine wave.

Here, the amplifier scales a sine wave.

I added a low pass filter and amplifier at the bottom of the breadboard..

I added a low pass filter and amplifier at the bottom of the breadboard.

For the past 7 weeks, I’ve been in China and Taiwan teaching Engineering and American Culture classes for summer camp -style programs at different universities through the program MIT-CETI. It’s been a blast; I’ve met lots of cool people in my travels, and I’m going to miss China and Taiwan a lot.

The first city I visited was Kunming, Yunnan. One of my favorite things about Kunming was the colorful lighting that illuminated the city at night. I’m not just talking about bars and shops. Even office buildings and residential buildings were covered in LED lights, and not just simple lights, but gaudy color-changing, flashing, pattern-changing ones. I thought it made Kunming very pretty, and I wish we had this in Boston. I guess we’ll just have to settle for the Pru.

Anyway, it was so pretty that I made a video. Sorry for the shitty quality; I don’t know how to edit videos, and it was all taken on a cell camera. Still, enjoy!

Last IAP, I ran into a problem. I have lots of kinds of audio signal sources: my laptop, my desktop, and mp3 players are the major ones, and each produces a separate mix of sounds. However, my preferred destination for all these sources is my pumpin’ Klipsh desktop speakers. I wanted a way to mix all these sources through software without having to acquire or build a lot of new hardware.

My solution was to use the sound card of my desktop, which has ports for line out, mic in, and line in. My speakers are connected to the line out port, and I have a 10′ trs cable running from the line in to my desk, which I generally have plugged into my laptop. I could hypothetically use the mic in to mix another device.

To control the relative mix of these signals, I programmed the mixer below in python 3. The first fader controls the master mix; the second fader controls the audio signal from only programs on my desktop computer; and the third fader controls the signal on the line in.

To make the faders, I used the tkinter module and created a Fader class, which inherits fromĀ tkinter’s Scale widget. The constructor for this class creates a Scale with the minimalist design shown, and it also gives Fader objects control over a Mixer object, which is described below. The Fader class also adds a changeVolume method, which is called when the user moves the fader on screen. The changeVolume method sets the volume of the Mixer object attribute based on the height of the fader.

screenshot-cropped-edit

The Mixer object comes from the alsaaudio module, which can be found here. From the site, “This package contains wrappers for accessing the ALSA API from Python.” A Mixer object represents a way to manipulate controls for different ALSA lines where each line carries a different signal. The names that ALSA gives to the lines that I’m controlling are “Master” for the master mix, “PCM” for the mix coming out of software on my pc, and “Line” for the mix coming into the line in port.

The changeVolume method also does some math before adjusting the mixer. The position of the fader on screen maps linearly to a height value read by the Fader object. However, the perceived intensity level of sound is logarithmic with respect to its amplitude. To compensate for this, the changeVolume method curves the input from the fader before it applies it to the mixer. As a result, moving the fader at low volumes causes the mixer volume to change slightly, and moving the fader at high volumes causes the mixer volume to change dramatically, so the intensity out of the speakers sounds linearly increasing from bottom to top of the fader.

This mixer is pretty minimalist, but in the future it would be cool to have something more like the native mixer in Windows 7, which not only shows the fader but also bars visualizing the volume of the signal for each input.

Now, I’m working with some temperature sensors to regulate things in my room and display information about temperature on my screen, too. I’ll keep you updated!