<< Chapter < Page
  Accessible objected-oriented     Page 2 / 17
Chapter >> Page >

General background information

An previous module titled Jbs2050-Runtime Polymorphism with Java Sound summarized the kinds of things that you have learned in the earlier modules inthe series. As indicated in that module, the program that I will discuss in this module will be significantly different from the code in the earlier modules. Forexample, the code in those modules produced hard-coded sound such as StereoPingpong and FMSweep .

The code in this module will allow you to control the sound based on the contents of a text file that you create. This allows a great deal offlexibility as indicated by the melodies in the above list .

A player piano simulator

In the late 19th and early 20th century, various companies manufactured pianos that played music automatically. The music was recorded on rolls of perforatedpaper. A pneumatic or electro-mechanical mechanism inside the piano read the holes in the paper and used that information to press the keys on the pianokeyboard in such a way as to cause the piano to play the pre-recorded music. To a sightedobserver, it looked as if an invisible person was playing the piano because the piano keys moved up and down with no hands on the keyboard.

These automated pianos were often referred to as player pianos . The program that I will explain in this module is a player piano simulator . You can "pre-record" a melody in text files (as opposed to rolls of perforated paper) and play those files using the simulator program. As you will learn later, amelody is defined in one (or optionally two) text files using standard musical notation where the notes have names like A, A#, B, C, C#, etc.

I am not a musician

I'm an engineer, not a musician. While I understand quite a bit about the physics of sound, I understand very little about how that sound is put togetherto create the pleasing sound that we call music. This module will describe a simulated musical instrument. Therefore, it will be necessary for meto explain the code using musical terminology. I'm sure that the explanation will contain many gaffs insofar as musical terminology is concerned. However, thepurpose is to teach programming and not to teach music. Please bear with me and overlook my musical terminology gaffs.

Required classes

This program requires access to the following five classes in the same folder :

  • AudioFormatParameters01
  • AudioPlayOrFile01
  • AudioSignalGenerator02
  • MusicComposer09
  • PlayerPiano01

You will find source code for all of these classes in Listing 24 through Listing 28 .

You are already familiar with the first three classes in the above list because they were used in earlier modules. Therefore, I won't discuss them in this module

The driver class for this program is the class named MusicComposer09 . The player piano simulator is defined in the class named PlayerPiano01 . I will explain those two classes in the next section.

Discussion and sample code

The class named MusicComposer09

This is the driver class for playing piano melodies. It requires the files in the above list to be in the same folder.

Questions & Answers

what is biology
Hajah Reply
the study of living organisms and their interactions with one another and their environments
AI-Robot
what is biology
Victoria Reply
HOW CAN MAN ORGAN FUNCTION
Alfred Reply
the diagram of the digestive system
Assiatu Reply
allimentary cannel
Ogenrwot
How does twins formed
William Reply
They formed in two ways first when one sperm and one egg are splited by mitosis or two sperm and two eggs join together
Oluwatobi
what is genetics
Josephine Reply
Genetics is the study of heredity
Misack
how does twins formed?
Misack
What is manual
Hassan Reply
discuss biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles
Joseph Reply
what is biology
Yousuf Reply
the study of living organisms and their interactions with one another and their environment.
Wine
discuss the biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles in an essay form
Joseph Reply
what is the blood cells
Shaker Reply
list any five characteristics of the blood cells
Shaker
lack electricity and its more savely than electronic microscope because its naturally by using of light
Abdullahi Reply
advantage of electronic microscope is easily and clearly while disadvantage is dangerous because its electronic. advantage of light microscope is savely and naturally by sun while disadvantage is not easily,means its not sharp and not clear
Abdullahi
cell theory state that every organisms composed of one or more cell,cell is the basic unit of life
Abdullahi
is like gone fail us
DENG
cells is the basic structure and functions of all living things
Ramadan
What is classification
ISCONT Reply
is organisms that are similar into groups called tara
Yamosa
in what situation (s) would be the use of a scanning electron microscope be ideal and why?
Kenna Reply
A scanning electron microscope (SEM) is ideal for situations requiring high-resolution imaging of surfaces. It is commonly used in materials science, biology, and geology to examine the topography and composition of samples at a nanoscale level. SEM is particularly useful for studying fine details,
Hilary
cell is the building block of life.
Condoleezza Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Accessible objected-oriented programming concepts for blind students using java. OpenStax CNX. Sep 01, 2014 Download for free at https://legacy.cnx.org/content/col11349/1.17
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Accessible objected-oriented programming concepts for blind students using java' conversation and receive update notifications?

Ask