<< 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 mutation
Janga Reply
what is a cell
Sifune Reply
how is urine form
Sifune
what is antagonism?
mahase Reply
classification of plants, gymnosperm features.
Linsy Reply
what is the features of gymnosperm
Linsy
how many types of solid did we have
Samuel Reply
what is an ionic bond
Samuel
What is Atoms
Daprince Reply
what is fallopian tube
Merolyn
what is bladder
Merolyn
what's bulbourethral gland
Eduek Reply
urine is formed in the nephron of the renal medulla in the kidney. It starts from filtration, then selective reabsorption and finally secretion
onuoha Reply
State the evolution relation and relevance between endoplasmic reticulum and cytoskeleton as it relates to cell.
Jeremiah
what is heart
Konadu Reply
how is urine formed in human
Konadu
how is urine formed in human
Rahma
what is the diference between a cavity and a canal
Pelagie Reply
what is the causative agent of malaria
Diamond
malaria is caused by an insect called mosquito.
Naomi
Malaria is cause by female anopheles mosquito
Isaac
Malaria is caused by plasmodium Female anopheles mosquitoe is d carrier
Olalekan
a canal is more needed in a root but a cavity is a bad effect
Commander
what are pathogens
Don Reply
In biology, a pathogen (Greek: πάθος pathos "suffering", "passion" and -γενής -genēs "producer of") in the oldest and broadest sense, is anything that can produce disease. A pathogen may also be referred to as an infectious agent, or simply a germ. The term pathogen came into use in the 1880s.[1][2
Zainab
A virus
Commander
Definition of respiration
Muhsin Reply
respiration is the process in which we breath in oxygen and breath out carbon dioxide
Achor
how are lungs work
Commander
where does digestion begins
Achiri Reply
in the mouth
EZEKIEL
what are the functions of follicle stimulating harmones?
Rashima Reply
stimulates the follicle to release the mature ovum into the oviduct
Davonte
what are the functions of Endocrine and pituitary gland
Chinaza
endocrine secrete hormone and regulate body process
Achor
while pituitary gland is an example of endocrine system and it's found in the Brain
Achor
what's biology?
Egbodo Reply
Biology is the study of living organisms, divided into many specialized field that cover their morphology, physiology,anatomy, behaviour,origin and distribution.
Lisah
biology is the study of life.
Alfreda
Biology is the study of how living organisms live and survive in a specific environment
Sifune
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