# CS 1080 Principles of Computing -- Assignment 12

## Purpose

The purpose of this assignment is to experiment a little with digital sound synthesis. You will create your own sine waves using a spreadsheet (what else!), and listen to the corresponding tones and chords.

## Assignment

1. Copy the file NiftySineChord.xls from the course folder on Isabel to your home directory. We will be doing a lot with this file, and it will get huge. The 2nd column in this file has values to recreate a sine wave with frequency 261 Hz, which is roughly middle C (c4 on a piano). Compare this sound with the c4.wav sound you copied previously.

Follow the instructions in the file to create a column of values for a sine wave of 329 Hz (E) and then turn this data into a sound file. Compare this sound with e4.wav. Repeat this process to create a wave for G at 392 Hz.

Finally, create a sine wave which is the chord combining these three components. How??? If you were an average student, of average intelligence, and average ingenuity, you might have to think for a while, but being astute, you should figure this out in less than a minute (on average). Compare this sound with your chord from the last class. To be really sure, open the file mysig.wav (in the same directory as your spreadsheet) with Audacity and compare it to chord.wav. The pitch should sound almost identical, though the amplitude may be different.

Congratulations! You have just synthesized your own music from a bunch of numbers, very much like you created a digital image from a bunch of numbers. In general, there are better tools for manipulating sounds than a spreadsheet, but if it's a number, we can create it and manipulate any way we want.

2. The headache with this spreadsheet is that every time you want to change a note, you have to copy an entire column of formulas. Let's fix that. Make another copy of the original spreadsheet and fix it so that you only need to change the frequency at the top of a column in order to get a different note. (You will still have to highlight the entire column and press the green button to generate the wav file though.) Do this and create a new chord. If you need help, here is a page of note frequencies. If you are not musically inclined, just use C, E, and G with a different set of frequencies. As you create formulas, you will have to use absolute cell addresses. Ask for help when you get stuck on these.

## Submit

For this assignment, you must zip up your two spreadsheet files into a single, compressed zip file. The spreadsheets will be several megabytes and emailing them uncompressed will create problems for the instructor and the campus email system.