davekrnavek.com
8Mar/100

arduino -> max/MSP

so i wanted to hook up my arduino to maxMSP so i could use data grabbed from the microcontroller to do fun stuff with audio.  maxMSP has some dead-simple serial objects which just read data off a serial port, but i wanted to go a bit further and have my arduino send OpenSoundControl packets.  unfortunately, the arduino needs an ethernet shield to send network packets, but since they're usually connected to a computer, i decided to write a c++ program to grab data off the serial port and format it into OSC packets.  gave me a chance to play around some more with visual studio...

so here's a screenshot of the program -- it's got a dropdown box showing your serial ports, along with some IP address/port text boxes and a preface string.  so far, i'm just grabbing a single byte sent on the port, but i'll probably modify it a bit to allow more precision than 0-255.

and here's a basic arduino program that just sends a random byte every second, for testing purposes.

i made a pretty simple maxMSP patch that grabbed the OSC packet and just changed the frequency of a sine wave, but there's so many possibilities here.  multiple people can send data with unique preface strings, and i could do whatever i want with the audio.  fun, fun! :)

--dave

Filed under: arduino, projects No Comments
7Mar/101

boxes underway

well, it was a beautiful weekend, so laura figured it was time to start sanding away at the boxes.  we've got seven all screwed together, with enough wood for two more boxes.  problem is the other plywood is really warped.  they've been sitting in a moist pillowcase under some weight for a week plus, but it's not really working.  so we figure might as well get cracking on the rest.

so she went at it and got all seven sanded down with some medium then fine sandpaper.  we'll be staining them sometime soon and see what we're left with.

anyways, here's the carpenter at work:

--dave

16Feb/100

bookshelves…

so we've been working on this project (well not actively "working" but at least thinking about it) for a few weeks now.  we wanted a new lamp for the dining room, and while we found some cool ones in shops, the best ones are pretty expensive.  so we figured this would be a good project for us to play around with.

we decided to build some wooden cubes that could be stacked around in different configurations.  some of the cubes will end up being covered in fabric and we'll stick a light in there.  so we'll have a lamp and a bookshelf.  drew up my idea in google sketchup:

so we got some plywood from home depot a few weeks ago, and had them cut some 15" squares.  not the most accurate cuts, but i guess it's the best we can do until we get a garage and some power tools.

here's one box after gluing and clamping him down:

and bruno wishing he could be out there chewing and destroying all our hard work...

we ended up just gluing and screwing together three boxes yesterday...

so we'll get the rest together, do some more sanding and staining, and we should be getting closer to at least something interesting... :)

12Feb/101

arduino + nxt sensors

so i figured a decent project would be hooking up some of my lego mindstorms NXT sensors to my arduino microcontroller.  the local dorkbot group is spinning off an arduino group, which has definitely renewed my interest in the platform.

the nxt sensors all use an i2c two-wire interface to communicate with the main microprocessing brick.  there's a wire.h library for the arduino that simplifies most of the i2c communication with devices such as eeproms and other modules.  so, it's definitely possible to get the two communicating -- just a matter of figuring out the proper sequence of calls to make.  i've seen some pages online getting the arduino to talk to the main NXT brick, so this should be hopefully somewhat similar.

first step is hacking a NXT cable (i asked for some spare ones a couple of christmases ago).  the wires are stranded, so i soldered them to some solid-core hookup wire and insulated them.  so i'm able to plug it in to the arduino, at least...

so you can see the arduino sitting on my breadboard, along with another project -- a group of RGB LEDs with a 5941 PWM controller.  the connected part is one of the NXT motors, which also has a built-in rotation sensor.  so one idea is to use three of these to fade the red, green, and blue levels of the LEDs, for a little color mixing.  the NXT also comes with an ultrasonic sensor, a touch sensor (button), a color sensor, and i also picked up a third party 3-axis accelerometer.  so there's lots of interesting possibilities here...

Filed under: NXT, arduino, projects 1 Comment
10Feb/090

DAVE2

DAVE2 (Digital Audio-Visual Environment pt.2) is a blanket term for the progressive research that I have done with single-camera computer vision applications for the Arctic Region Supercomputing Center (ARSC). The primary goal of these applications is to use the body as an input device, like a mouse or keyboard. This is done by subtracting a background image from new video frames and drawing a box around what's left -- people in the scene. Certain information about this box, such as its width, height, and location, are then used as input for various audio applications.

The information gathered from the cameras is basic numerical data, such as the width of a box, height, and location in the viewport. It is sent out to the network as OpenSoundControl packets, which can be used to control a multitude of applications, including graphical and audio applications. In this case, the information is sent to an audio application written with Max/MSP, a visual audio programming environment.

The primary iteration of DAVE2 consists of four different regions, with objects detected in these regions affecting the audio processing in different ways. You can drag your hand in the left-hand region to pick from a selection of sound samples. Dragging your hand in the top region changes the playback speed of the current sample, and dragging your hand in the right region affects the pitch. This allows users to interact with the environment and create different sounds by simply moving their hands around.

DAVE2.1 (part one) from Dave Krnavek on Vimeo.

DAVE2.1 (part two) from Dave Krnavek on Vimeo.

The most recent version of DAVE2 allows for multiple pages of these region boxes. A separate region, called a page slider, is used to swap between the different pages. In the current implementation, each page consists of different types of effects that can be assigned to the looping sound sample. This lets the user cycle between a multitude of different effects, such as volume, panning, pitch, playback speed, and a delay-feedback loop. It was developed with input from Dr. Morris Palter, percussionist and music professor at UAF.

DAVE2.2 from Dave Krnavek on Vimeo.

DAVE2 was developed using the OpenCV computer vision library. This library works with many platforms, which allows the application to be run on different operating systems, including Windows and Mac OS X. The bounding box information is sent using OpenSoundControl packets to the audio processing program, built with Max/MSP.

Future work in this area may include detecting multiple persons in the scene, enhanced graphics, and research into other uses for this kind of input device.

Filed under: projects No Comments
10Feb/090

3DHP and DAVE

3DHP (3-Dimensional Hand Positions) was the focus of my master's project from the computer science department at the University of Alaska Fairbanks. It consists of using two cameras to calculate the location of hand markers in 3D world coordinates. This project was funded by the Arctic Region Supercomputing Center (ARSC) for use in the Discovery lab (their virtual reality lab).

Stereo transformation

Humans use both of their eyes to perceive depth information in our world. Similarly, we can gather information about the location of specific objects if we have two slightly differing views of the object. This project searches for a single object that's visible in a pair of calibrated cameras (we know where the cameras are, along with how they're oriented and some other specifics). Once located, we can use some math transformations to determine it's location in the world. 3DHP uses the HALCON machine vision library to assist with the locating and transforming of these positions.

The calibration plate as seen through the (a) left and (b) right camera

Hand markers

To assist with the locating of the user's hands, special hand markers were created using ordinary light-emitting diodes (LEDs) and ping-pong balls. The ping-pong balls spread the colored light across their surface, which allows us to search for the desired color range. Since we want to use two hands, there are two markers -- red and green.

Output

When the system locates a specific hand marker, it sends a multicast packet out to a network address, specifying the location of the given marker. Multicast packets allow multiple computers to receive the data simultaneously, even outside the local network.

Location

The system is set up in the Discovery lab, which is ARSC's visualization and virtual reality laboratory. The cameras are set in the corners of the center display screen, which gives a view of the user standing on the floor screen. The user's hands are visible while standing on the center screen, which acts as a stage area.

DAVE

An application called DAVE (Digital Audio-Visual Environment) was created to be used with the 3DHP input device. DAVE consists of a group of sound samples that you can drag around the screen. Several parameters such as volume, playback speed, pitch, reverb, and delay/feedback can be manipulated for each sample, depending on their location on the screen. The different parameters are adjusted by simply dragging your hand up and down in the air.

Here's a quick video of DAVE being played in the lab:

DAVE was created using GLUT for the user interface and max/MSP for the audio processing. DAVE was created in the summer of 2005 with the help of Quinton Harris (a student employee at ARSC) and Sean Waite (ARSC summer intern).

Filed under: projects No Comments