ECE291 Fall 97' Final Project: Random Noise

| Team Members |
Pat Spizzo - Grapchics & Main Loop
Dave Stratman - Graphics
Nick Dietz - Sound and Fourier Transform
| Introduction |
In this project, we will be combining applications in graphics
and accessing the D/A converter of the sound card. One section of
the program will continuously update data in memory based on Fast
Fourier Transform of data from the sound card. The second section
of the program uses the data in memory to alter the graphics on
the screen. The graphics will be programmed in 640 X 480 X 256
mode.
| Problem Description |
This project proved both challenging and rewarding for all members of Random Noise. Some of the harder features to implement and which took the most time were the raw hardware interfacing through assembly. Polling the sound chad in realtime, analyzing the frequency domain, and creating a high resolution video effects in realtime took fast code and a lot of trial and error.
The fact that our entire project was written in assembly made this project not only possible but very successfull. In the end we where able to create excatly the opposite of our project title, Random Noise.
This part of the "Random Noise" final project will be programmed by Nick Dietz. The code in this section has one objective. The code is a success if it provides a real-time stream of data to the video graphics section of "Random Noise." The data will be provided in four video variables (plus a volume level variable). These variables will be continuously changing based on the input level of the soundcard. The CD, mic, or any other input sound source can be used.
In order to achieve this objective data will be read in via DMA from the soundcard, it will be transformed into the frequency domain via a Fast Fourier Transform, and output to memory as four video control variables. The code necessary to do this can be broken down into three main sections. First, the detection, initialization, and preparation routines for the SoundBlaster. Second, the ISR to handle the data coming from the soundcard, call a function to process this data, and put the data into the video control variables. Third, the FFT which will be called by the ISR and will process the data into a useable form.
For sanity reasons, only the SoundBlaster 16-bit and true compatibles will be supported, and we will assume you are using a nice fast computer. (Currently this program does not work w/ 8-bit soundcards such as those in the ECE291 lab). All functions will be c callable. This will enable mixed c and assembly programming. The FFT code is from a book and in c, and will be tested in c first and then converted when deemed working properly.
Part One: Detection, Initialization, and Preparation of the SoundBlaster.
Part Two: ISR
Part Three: FFT
The second part of Random Noise, programmed by Pat Spizzo and
David Stratman, creates visual effects which move to the music.
There are five different word-sized inputs to the graphics
section from the FFT section, which will be available via global
memory. Four of the variables will be different frequencies
(bass, mid-bass, mid-treble, treble). The other variable will be
the total volume level.
Volume is used to show certain pixels as volume increases and
leave others black. This give the effect of intensifying
brightness when volume in increased..
Mid-Treble changes the background PCX image (rn[0-9].dat).
Mid-Bass will affect the palette entries by rotating the pallete
colors.
Bass creats a random spread like explosion which is seen on the
screen.
In order to successfully access the high-resolution video memory, we we had to write a procedure to convert a linear memory address (stored in a double-word) into an address that is available at a certain memory bank on the video card. Before starting the project we were not sure how to go about using hi-res video becuase one screen utilizes more than one 64K segment. Using references on the web we determined BIOS calls which controlled the switching of video banks on the video card. This enabled us to create procedures in assembly which would take advantage of the entire screen area.
Originally we had hoped to create a spinning 3-D cube in the foreground to music but we ran in to trouble without using protected mode to access more memory. Having foreground effects in 640 x 480 @ 256 is difficult under 1MB of memory becuase to save the entire background take 5 64KB segments. We decided to become a bit more creative with our coding and bring in PCX images then change the palletes to create the effect of motion and rotation to music. This effect turned out quite nice and we were very pleased. Two functions in our graphics section affected the pallette, MovePallete, and ChangePallete2.
MovePallete was used to fade in the image as volume increased. Originally with no sound all the image values are black. As the volume increases more and more pieces of the picture are seen. This creates a great pulsing effect which goes to the music. ChangePallete2 actually alters, or rotates, the pallete entries based on mid-treble. This creates the effect of motion or rotation in images with nice gradations and patters such as fractals.
Finally an explosion is seen which corresponsds to bass beats. This is done at random locations on the screen using the Spread function and its helper functions.
While Loading the PCX file the entire pallete is saved into a variable, PalleteBuffer, which is used to rotate the pallete entries through ChangePallete2.
All the transfer of data between sound and graphics is handled through global variables which are updated through the sound ISR and read in realtime by the graphics routines.
| Screen Shots |
|
Concept inspired by Cthugha