Sound and Music Lab
Below are some javascipt codes that I have written for use by music and physics students and teachers. I am currently (May 2014) writing these programs, so they will be continually upgraded for the next few months (till August 2014). Feel free to use them, and if you like copy the source code and modify them to your needs. Let me know of any improvements you make so I can improve the ones listed here.
sinplot is a program that adds sin waves. You can add sin waves of frequencies nf0 for values of n from 1 to 6. For each frequency you can vary the amplitude of the sin wave. The program is designed to show how one can construct any periodic function by adding appropriate sin waves (i.e. Fourier analysis).
fourier1 is a program that does a fourier analysis of a period sound wave. You can upload a *.wav file from your computer, that is saved in either 8 bit, 16 bit (ideal), or 32 bit format. The program assumes a collection rate of 22050 samples/sec in determing the frequency. Move the cursors to the start and end of the analysis interval and set the number of cycles in the interval. Hit the fourier analysis button and the results will be listed and graphed.
musicnotes is a program that allows you to hear different pure tones in both the equal tempered scale and the harmonic scale.
sum2sin is a program that lets you add two sin waves and hear the result. It is useful to demonstrate interference effects, especially beats.
intervals is a program that helps with interval training.
guitar2 is a program that can be used to analyze the sound from a guitar. It is currently being developed.
wavread is a program that can be used to read the first bytes of a *.wav file to see what format the sound has.
recfourier is a program that can be used to record sound with the computer's microphone, display the sound, and perform a discrete Fourier analysis. It is currently being developed.
Physics Department| College of Science