TheraFlu

Purpose: Just for fun. Create an application modeled after the Theramin.

We only use one camera for this. Up and Down is volume. Left and Right is Pitch. A sample sound File:flu.au .

We actually make saw tooth waves instead of sine waves. Here is a picture of one of part of a sound file. Notice That the volume is changed by the height of each peak. You cannot see it in this picture but the pitch is changed by how close the waves are together.

How it works

The TheraFlu application is an example of a mutlithreaded application in which the video and audio processes are happening concurrently. Using the sproc thredding command, the function DoVid handles obtaining the camera data, sending it through the image filter MudFilter and freeing the data. DoVid modifies the global variable pos which is used by the rest of the program to generate a saw tooth wave with the correct amplitude and fequency so that it can send to the audio hardware.

vec3 pos;
int threshold;
int quit=0;
extern vec3 MudFilter (int, int, char *, int, int);
void DoVid(void) {
Video v;
char *dataPtr;
while (quit==0) {
dataPtr = v.GetVideoData();
pos = MudFilter (v.xsize, v.ysize, dataPtr, threshold, 0);
v.FreeVideoData(dataPtr);
}
}