->Homepage
->Schedule
->Courses
-->CS182
-->Tentative Schedule
-->Objectives
-->Quiz 1
-->Lab 1
-->Lab 2
-->Lab 3
-->Lab 4
-->Lab 5
-->Lab 6
-->Lab 7
-->Project
-->CS183
-->CS285
->Course Policies
->Electronic Submission
->Documentation Standards
->Old Exams
->C++ Examples
->MSVC++ Info
->Software
->Support Forum
->Unix Info
->Nature Photos

[Home]
[Rich][Home][Rich]
[Author]
CS182 -- Lab 1: Sound Files

Winter 2003-2004

Overview

In this lab, you will create a C++ project in Microsoft Visual Studio .NET and enter a short program developed by the class.

Sound Wave Theory

Sound Waveforms

A musical note is represented by a sine wave at a specific frequency. The table below gives the frequencies of different notes.

Note Frequency (Hz)
A 220
A# 233
B 247
C 262
C# 277
D 294
D# 311
E 330
F 349
F# 370
G 392
G# 415

Doubling the frequency gives you the same note one octave higher while halving the frequency gives you the same note one octave lower.

Procedure

Create a C++ project in Microsoft Visual Studio .NET using this procedure.

As a class we will write a program that will produce a data file containing lines of numbers in the following format:

0.0000, 1
0.0001, 0.98
0.0002, 0.975

The first column represents time and the second column represents the voltage to be sent to the computer speakers. This file should end with .csv and will be passed (drag and drop) to a csv2wav program that will convert the file to .wav format. Once in this format, it can sent to the speakers using Windows Media Player or something similar. The csv2wav program is available for download here. I would suggest saving the program on the desktop.

Once the class-written program has generated a .csv file, drag and drop it on the csv2wav icon. When done, a .wav with the same name (except the extension) and location as the .csv should be created. You may double-click on the .wav file to listen to it.

Lab report (due 11:00pm, the day prior to week 2 lab)

Here is a template file to use as a starting point for this report.

Your lab report should be an independent document. That means that someone should be able to understand what you did and why without seeing anything other than your report. Your report should include:

  • Overview
  • Sample .wav that demonstrates successful implementation (be sure to change the MSOElogin part in the report template to your MSOE login name and name the sound file appropriately)
  • Your reaction (a couple of paragraphs on what you learned and what you thought about while working on this assignment)
  • Any suggestions you have for how the lab could be improved.
  • A summary of your activity log indicating how much time you spent on the assignment (following the template provided in the lab1.xml template document). Please use the following categories:
    • Project setup
    • Group design/coding
    • Debug (before you think it's working)
    • Test (after you think it's working)
    • Documentation
    • Other
  • The Documented source code for your program.

As with any report you submit, correct spelling and grammar are required. In addition, your report should be submitted electronically following the Electronic submission guidelines. (You may wish to consult the XML help video and/or sample report before submitting your report.) Be sure to keep copies of all your files, in case something gets lost. It may be wise to keep a diskette backup as well.

Acknowledgment

This laboratory was developed by Dr. Chris Taylor.

Last Updated: Thursday, 01-Jan-2015 13:33:11 CST