Ryan C. Clausing
Email Me
Email Me
Home
Philosophy
Senior Capstone Project
Other School Projects
Personal Projects
Resume
 
May 5, 2002

Well, this is the end! Everything is done! My presentation went well and I'm really happy with the finished product. This project was an excellent learning experience for me and I have definately increased my overall skills as a Computer Scientist because of it.

April 27, 2002

The past few weeks have been spent mainly working on the adjust bass and treble portion of the requirements. After numerous meetings with Dr. Pankratz, it was decided that the requirement should be dropped. So now I am finished with the program and the presentation is on Monday at 6:30 PM!!! I'm almost done with preparing the presentation, I just have to walk through it and make sure that everything will go smoothly. I will have to take my computer with me to do the presentation because my program isn't compatible with Windows 95/98 (something to do with the threads I think), so I need to run Windows 2000 and the school's computer doesn't have that installed. I tried it on Friday and it won't be hard to switch the audio/video connections to run to my computer.

March 23, 2002

Today I tried to put images on my icons so I can know which button I'm pressing but I have had no success as of yet. I'll probably have to go ask Dr. McVey how to do this because I have attempted this many times in the past and have had no luck with anything. One accomplishment that I did make though is that I got the boosting of a range of frequencies to work (on pure sine waves). It was a coding problem yesterday, but now it is fixed and it actually works - so that was a bit of a nice reward for all that brain work we put behind it. So now there is still the problem of applying this to natural sound. I tried this for some of the songs I have been working with and it works for frequencies in the bass range but not for those in the treble range. This is probably because the treble frequencies are those smaller waves that make the bass frequency waves all jagged. I will be talking to Dr. Pankratz again on Monday morning, so we'll try to figure this out some more then.

March 22, 2002

I met with Dr. Pankratz twice today. The first time, we thought we had figured out the whole frequency range thing. We figured that by determining when the sine wave crosses the 0 line and the number of samples between each crossing, we can figure out what frequency is playing. This all seemed correct, but then I started thinking about the waves that do not cross the 0 line. If you look at a wave file up close (only a little bit of data), there are times when it does cross the 0 line, but there is also a lot that goes on when it is above or below the 0 line, without actually crossing the line. This is because there are multiple frequencies within one wave. The speaker gets pushed out and then can vibrate while pushed out to make higher frequency sounds, without coming back to the initial state. I tried doing this anyways because it should work for pure sine waves (not natural ones), but I couldn't get it to work... but i'm sure this is because of a code problem. One thing that I worked on that had nothing to do with frequencies was turning on and off the right or left channels. This wasn't a huge accomplishment but it was a nice break from the headache that trying to mess with frequencies gave me.

March 21, 2002

Today I modified my program to display a sort of status bar. It's different than a regular window status bar, but it's purpose is going to be to let the user know what exactly it is doing. It also displays the progress of playback while the wave file is playing. Now the user will know when it is working on copying/pasting or any other function. I want to eventually display a progress percentage as well, but that is not that important to me at this time. I tried to research wave files and sounds and how it all works, specifically how to adjust amplitudes of frequencies, but came up with nothing. This part of the whole thing is getting me extremely frustrated. There doesn't seem to be very much information about this, and any code that I find has little or no documentation so I can't figure out what's going on or even if it is what I'm looking for. I tried a method of boosting a frequency range by doing it one frequency at a time but I killed my program after it worked for 10 minutes on only about 2 seconds of sound. There must be an easier way because there are programs for playing wave and mp3 files that do this sort of thing on the fly - it can't be THAT hard. That was all the progress for today...

March 20, 2002

I met with Dr. Pankratz today and we discussed how to work with the sine waves of certain frequencies. We're trying to figure out how to boost a certain frequency or frequency range in a wave file. It was very complicated and we didn't really figure it out. We did figure out that to adjust the amplitude we could adjust the amplitude of all frequencies fairly easily. So using this idea, I implimented a fade in/fade out into my program. This works by fading the selection in or out across the selection made by the user. I was also able to overlay a certain frequency over another. This was as close I came to boosting a certain frequency.

March 19, 2002

I made my program clean up after itself today. I had been using linked lists and not deleting the nodes when I was done with them - I had just been setting the top pointer to NULL. Well this was leaving a lot of memory allocated to my program, which then had to be dumped when I closed the program, which took a long time. Now my program goes through and deletes each of the nodes in my linked lists when I am done using them, so when it closes, it closes nicely. I also worked on disabling menus today. This was very nice once I figured it out. I had been just trying to disable the menu and that's it, but you must disable it in the ON_UPDATE_COMMAND_UI handler in order for it to stick. Otherwise, if there is a message handler for the menuitem you disable, MFC will enable it right away. This solved the problem and now my program will enable and disable menu items depending on the state of the program. I also made the window size dependent upon the screen size of the user. This is so that it is pretty much the same size when it opens up, no matter what machine/monitor it's running on. I tried working on implimenting having multiple files open at once. I added a 'Windows' menu so the user can select the file to work on, and I got it to put the name of the file in that menu if there is one open, but I have not gotten any further than that.

March 18, 2002

Today I worked on making selection with the keyboard (by holding the shift key down and using the arrows to sellect a certain region). I implimented a swap channels functions to swap the left and right channels of a 2 channel wave file. I also started using malloc() to allocate my buffers instead of a char databuffer[1000]. This allows me to only ask for it when I need it and not have it allocated to my program at any other time. I also shortened up my wave data structure (where I keep the data to draw the wave file) by 2 bytes. I now store the data into a WORD instead of an int (because a WORD is 2 bytes and an int is 4 bytes). I also FINALLY got the 16 bit files to appear correctly. It turns out that I didn't try the obvious method (the same method I use for the 8 bit wave files) because I had sources that said otherwise. So finally I was just trying anything that popped into my head and this worked. All I had to do was subtract 32767 from the value - that's it. Today I also implimented some keyboard shortcuts so the user wouldn't have to do as much clicking around if he/she didn't want to. I have keyboard shortcuts for the basic things such as cut/copy/paste and select all. This was all the work I got done today.

March 17, 2002

The only thing I worked on today was a "reverse" function. This will reverse the sound in the selection (which sounds pretty neat with some stuff). This was more of a relax day because I have been working way too many hours on this each day for the past 6 or 7 days.

March 16, 2002

I first worked on displaying the current position in the file (in terms of time). I then added a goto start and goto end button so that the user wouldn't have to worry about moving the "insert" line to the very end or very beginning of the file. I worked with a zoom in/out function, but this kind of threw a lot of stuff off, so I took it out. I would like to impliment this feature, just not now. I made another attempt at mix paste and it sort of works but not how it is supposed to. I need to find out how to modify the sound of the file. I know how to mess with the bytes, but not really how to mess with the actual sound. I also worked on a copy to new and paste to new. This will let the user work with the seleciton or clipboard as a new file with or without modifying the original file. I also fixed the wave header that I use when making a new file - I had previously not been setting the length of wave data parameter correctly, so it didn't change when the file changed. Now it does. I also worked a little on disabling menu options but found out that if I have a handler specified in the message map, windows will enable it, so I have to prevent windows from doing so - I just haven't figured out quite how.

March 15, 2002

Today I improved the temporary file issue. Now I make sure that the temporary files I use are saved in the same directory that the open file is. I was thinking of saving them in the windows temp directory, but figured this method was better. I switched over to the MCI functions rather than the waveOut____ functions. This is because it is much easier to do what I want to do, and since I will be converting mp3 files to wav before playing with them, the MCI functions will work for this as well. I then figured out a fast forward and rewind function, as well as starting playback from a specified position (wherever the user clicks on the wave display). After this, I made it so that if the user had selected a certain portion of the file, the program would only play that selection when the user hits play. I attempted to do a Mix paste function (overlay the sound) but this didn't work out so since it's not a priority, I let that one slide. I did make the selection display smoother - now it is much easier to look at (doesn't flash while selecting - from redrawing it all the time while selecting).

March 14, 2002

I worked on so many things today so I'll just list them - Select All, Crop (delete everything but the selection), Volume selection in a menu (0 thru 8), Loop, Insert Silence, Record, Select to start, select to end, display of a line where the user clicks in the file. There is a dashed line where the user clicks on the file and this is where any inserting of data will take place. I do the record feature with the MCI functions. When the user is done recording, it asks where the recorded file should be saved, so the user can specify the name and location of the recorded file.

March 13, 2002

Today I implimented "save" and "save as" functions. These were fairly easy to do. I then worked on a "clear" function which would not modify the length of the file, but it would lay silence in place of the sound (in the selection specified by the user). I decided to make an "undo" feature also. This is just a copy of the file before it is changed - fairly easy. I wanted a "revert" feature in the program, so I made it so that it would work with a copy of the original file and make modifications to this file until the file is saved. Then when the user wants to save the changes, it copies the modified file over the original file, but continues working on the modified file. If the user wants to revert to the last saved file, it just copies the original file over the modified one.

March 12, 2002

The first thing I worked on today was changing the display to use the whole display area when there is just one channel to the file. Previously I displayed mono files in the space for the right channel, and the left channel was left blank. This just makes mono files look better when displayed. I also made a line draw on the display of the wave file to show progress of playback (the position in the file). I started working on my cut/copy/paste functions. To do this, I create new threads for each of these because otherwise the program freezes until it's done doing the task. I think I will need to pup up a status dialog box to tell what the program is doing, but this isn't all that important right now. I got these functions to work for the most part, but they are a bit rough at this time.

March 11, 2002

Well spring break is here and since I'm not going anywhere, I've decided to be a nerd and work on my project. Today I fixed the displaying of the wave data. I make it resize with the window much better than it did before - now it works perfectly. I also fixed the selection option - now what the user selects on the display is what he selects on the file (didn't quite work before). I have decided that I'm not going to have an undo feature like I wanted before - I don't think I will have the time for it. I also did some more thinking about dealing with MP3 files. I'm thinking that I'm going to convert the mp3 to wav when it's opened, then work with it as a wave, and then if the user wants to save the file, it will then be converted back into mp3. This will allow me to use the same functions for both mp3 and wav files. Another thing I did today was to show a different screen when there is no file open, just so it'll be obvious to the user. I also shortened my code quite a bit. I used to have it where there were different loading/displaying functions for 8 bit and 16 bit files, as well as two different kinds of data structures (linked lists) to store the display data of the file. Now I have one data structure and one function for loading the data and one for displaying the data. These were some long functions so this took quite a lot out.

March 6, 2002

One of the bad things about changing how I play the file is that it didn't display the file in the window anymore. I had to fix this but it wasn't extremely difficult to do. I figured out how to adjust the volume for the waveout on the sound card so now by using the up and down arrows, you can increase and decrease the volume. I also implimented the pause and resume features. I still have yet to figure out how I'm going to fast-forward or rewind. This is difficult because in order to do either of these things, it has to be right when the user wants it, but the sound card already has 1 second of data, so there is a delay if I just seek somewhere in the file. I tried some things with reseting the wave device (which stops playback and sends the message back that it's done playing the data in the buffer) but there was a problem with it trying to reset the divice twice because of how the playback is currently working. I'll probably have to set a flag that tells it not to reset the sound card a second time. Not sure yet though. Today I also got a little line on the screen to show where in the wave file the current playback is. It's not accurate right now but I did get the line to progress down the file. That's all for today.

March 5, 2002

I got the wave file to play which was exciting. After toying with it some more I was able to gain some control over the file (like making it stop). It's not flawless - I was able to freeze up the program quite easily so I need to figure out how to avoid that (probably by disabling buttons). That's for later though - right now I'm just happy that it's working.

March 4, 2002

Today I got ahold of the book I was looking for from Dr. McVey and I made an attempt at understanding the waveOut functions. It is very low level and very confusing. I got it to read the information about the file (the header) but I could not get it to do anything else that I would like it to do.

February 20, 2002

I met with Dr. McVey this morning to talk about the CALLBACK functions in MFC. I didn't quite understand how it all worked and what the purpose of the CALLBACK function is. When the waveOutOpen is called, you can pass it a callback function that will receive messages from the device indicating if the playback of the buffer is done. It also handles the messages WOM_OPEN (sent when the device is opened using the waveOutOpen function) and WOM_CLOSE (sent when the device is closed using the waveOutClose function). I'm going to try to use these functions instead of the mciSendCommand function for playback of files. This will hopefully allow me to use the same playback method for both wave and mp3 files. I don't know much about playing the mp3 files right now, but I'm thinking that I'm going to have to decompress the audio data in the mp3 (convert it to wave data), send it to the buffer, and then use that data instead of the original mp3 data.

February 16, 2002

I went to Barnes and Noble tonight and I found a good book that will help me with my project (hopefully). I was flipping through the pages and found information on how to use the waveOut_____ and waveIn_____ functions, which is what I think I will want to use in my program instead of the MCI calls. This is because I don't think there is a good way to use the MCI calls for playing MP3 files, so I'd have to use a different method of playing files that are in MP3 format. I think it would also be easier to do copy and paste options if I used the waveOut____ and waveIn____ functions. I'm probably going to order the book soon so that I can get moving with my project.

February 12, 2002

I haven't really had much chance to work on the program lately but I did manage to get a little bit in today. I started by attempting to display 16 bit wave files correctly, but I ended up getting frustrated with that and decided to play around with selecting part of the file (as in select, copy, paste). I got it to work but it is not flawless. I need to work on it a bit more to make it better, but its a start for now.

January 31, 2002

I met with Dr. Pankratz today and we tried to figure out my 16 bit wavefile display problem. We got a few ideas about why it may not be displaying properly (flipped bytes or incorrect number of bytes being read at once). Later in the day I played around more with the mciSendCommand function and I was able to fast forward, rewind, pause, and resume playback of the wave file. Just for fun I tried to do this with an mp3 file but it didn't play the file.

January 30, 2002

Today I worked on the program some more and found a new way to play wave files. The playback controls all depend on a function called mciSendCommand. I got it to open the wave file, play it and stop it. I STILL don't have the 16 bit sound files showing up correctly in my window.

January 28, 2002

I talked to Dr. Pankratz today. We discussed the program further and tried to come up with ways for me to play wave files. MP3 file support is on hold until I am done with the wave files. I found some functions that start with waveOut___ or waveIn___. They are fairly low-level functions. I did some research on these and I think I will have to do all the buffer control with these functions. I tried doing this and I haven't gotten anything to work yet. I looked around at other options but haven't found any so far. I still can't get my 16 bit wave files to show up correctly in my window.

January 27, 2002

Today I worked on displaying the wave files again. I made a file that was mono and one that is stereo (both in 16 bit sound). I had to make two separate structs – one for 8 bit and the other for 16 bit files. I save the wave data by making a linked list of the 8 bit or 16 bit structs. When displaying the file data, I got it to work for the 8 bit mono, but not for the 16 bit mono nor the 16 bit stereo. Going to work on that later.

January 26, 2002

Worked on the program some more today and made some progress. I created a struct for the header of the file and am now able to read the information about the wave file. I then tried to display the wave curve in the window. At first, I loaded the entire wave file into memory but I decided that that method wasn’t really efficient. So then I calculated out how many bytes to skip but while still keeping the display of the wave data looking full. I still can’t get it to look like it should within the display of my program.

January 25, 2002

Talked to Dr. Pankratz today and decided that I’d work on reading the header and displaying the wave sound curve.

January 22, 2002

Tried working with the program some more (playing wave files) but got frustrated so I worked on the layout of my program. It’s looking better but functionality still isn’t there.

January 19, 2002

I played around with trying to open files within my program. I got it to pop up the default Windows “Open” dialog box. I also made it only able to show files with *.wav and *.mp3 extensions. I made it output the filename and pathname of the selected file onto the window. I was just testing to make sure I could get the file name and path. There is also a default Windows “Save As…” dialog box for when I get to that point.

January 17, 2002

I stripped down one of my programs from Event Programming so that I can use it as the shell of my new program. I will be writing the code in C++ and it will be a Win32 application. I made my menus (what I think I need so far) but they don’t do anything yet.

January 16, 2002

I received my project today (Sound Editor). I did some checking around on the internet as well as in the Visual C++ help files to check on mp3 and wav formats and their headers. Found some good sites (I think) but I can’t use the information quite yet because I don’t have a program for it.