Table of contents
- Preface
- General background information
-
Discussion and sample code
-
The program named Sinc01
- A sinc function
- Beginning of the program named Sinc01
- Beginning of the class named Runner
- The method named run
- Beginning of the method named getYval
- The end of the getYval method
- Using an AudioGraph
- Contents of the output file named Sinc01.txt
- The file named Sinc01Solver.bat
- The file named Sinc01Player.bat
- The class named MusicComposer10
-
The class named AudioGraph01
- A general purpose AudioGraph generator program
- The input text file
- Conversion to audio
- Beginning of the class named AudioGraph01
- Read the input text file
- The remainder of the constructor for the class named AudioGraph01
- Beginning of the method named getMelody
- Determine the frequency and data ranges
- Determine the frequency to represent a y-value of zero
- Compute audio sample values and deposit them in the output array
-
The program named Sinc01
- Run the program
- Miscellaneous
- Complete program listings
- Figures
Preface
This module is part of a collection titled Accessible Objected-Oriented Programming Concepts for Blind Students using Java . It develops a general purpose AudioGraph program that reads an input text file containing numeric values for y as a function of x and produces an output melody that represents a graph of that data. The material is presented in a format that is accessible to blind students.
Some sample AudioGraph melodies produced by the program are listed below. The function that was evaluated to produce the audio file is shown with the (^)character indicating exponentiation.
(You should be able to play these audio files with any standard media player that canhandle the AU file type. In case you are on the OpenStax site and you are unable to download the audio files, click the Legacy Site link at the top of this page to switch over to the same module on the Legacysite. You should be able to download the audio files from ther e.)
- Cubic01 : y = x^3 - 50
- Cubic02 : y = x^3 + 5*x^2 - 29*x -105 with three real roots
- DampedSinusoid01 : y = e^(-x/3.5)*cos(2*pi*f*x)
- ExponentialDamper01 : y = e^(-x/3.5)
- Parabola01 : y = x^2 - 50
- Quadratic01 : y = x^2 - 2*x - 15 with two real roots
- Sinc01 : y = sin(2*pi*f*x)/x
- Sinusoid01 : y = sin(2*pi*f*x)
- StraightLine01 : y = 2*x bipolar result
- StraightLine02 : y = 2*x + 500 all positive results
I will comment further on some of these audio files later in this module.
Click here to download a zip file containing the source code, the text files, and the Windows batch files needed to create,compile, and play your own version of these AudioGraph melodies. The zip file also contains the audio files of type AU listed above.