Ask Question, Ask an Expert


Ask Java Expert

Home >> Java

1. Design an abstract data type in Java which represents a musical pitch ( The ADT must store the note or pitch as an integer value. In this case, the ADT must be developed as an abstract class rather than an interface. 
A pitch or a note can be completely specified as:

a) A number of cycles per second (or hertz, abbreviated “Hz”),


b) The number of half steps above a commonly agreed-upon pitch, like A (in modern times, considered to be 440Hz). It is generally referred as a concert pitch since it is the reference pitch that the members of orchestra (and most other professional musicians) tune to before they perform.


c) The common music note (C, D, E, F, G, A, B) with suffix indicating the octave number [-1, 9] and an additional suffix prefix ‘#’ for sharp notes and ‘b’ for flat notes (a ‘b’ will lower a note by a half-step). For ex, C4# or C#4 or D4b or Db4 is the C-sharp note of the 4th octave, and A6 is the A of the 6th octave.


d) The MIDI absolute note number ranging from [0, 127]

e) Higher pitches have higher frequencies. Two pitches are an octave (12 semitones) apart if one has a frequency two times the other. A half-step or semitone increase in pitch is 12√2 = 1.06 times higher.

f) Your pitch constructors must admit a frequency (a double) as in 1a), or a number of half-steps (an int) above or below the concert pitch as in 1b) or a music note (a String) as in 1c). Imperfect frequencies should be tuned to the nearest half pitch.

g) Once constructed, a pitch must be capable to provide its frequency in either cycles per second or half-steps or MIDI absolute numbers.

h) It must be probable to compare the notes using the Comparable interface, to find out if the two notes form an octave and to raise or lower the note by the number of semi-tones.

Java, Programming

  • Category:- Java
  • Reference No.:- M91584

Have any Question? 

Related Questions in Java

Write a java application that allows a user to enter

Write a Java application that allows a user to enter numbers into an array and then process them. Enter the number of elements and the value of each element; Your application will process the data entered and will displa ...

Assignment introduction to programming using java1 write a

Assignment: Introduction to Programming Using Java 1. Write a program that uses one of the Map classes to implement a contact list. Contact information should include first name, last name, a phone number and an email ad ...

Question awhy is it important to avoid the use of reserved

Question A Why is it important to avoid the use of reserved words as you define variables, functions, methods, or identifiers? Do you have any get-arounds to the use of these reserved words that you like to use? (max 80 ...

Discussion please respond to the following promptbull

Discussion, please respond to the following prompt: • Compare and contrast abstract classes and interfaces. In what situations would you use an abstract class? in what situations would you use an interface? Imagine your ...

Write a java program non-gui preferred to demonstrate the

Write a Java program (non-GUI preferred) to demonstrate the use of Iterator. The program should allow a user to do the following: Allow the reading of a collection of animal objects from an external file. Output on scree ...

1 answer the following questions for each method or method

1) Answer the following questions for each method or method signature below. You may assume that these functions do not access or modify any memory not allocated within the function itself (i.e., global or class-level da ...

Java programthis assignment will count as both homework and

Java Program This assignment will count as both homework and lab. Develop a program that will allow the user to display the starting line and the bench for a basketball team. The user will also have the option of swappin ...

Java application - distancecalculatorcreate a java

Java Application - DistanceCalculator Create a Java application named to solve the following problem. An application is needed to allow a user to enter two cities and display the distances between ...

Read the article titled teaching software componentization

Read the article titled, "Teaching software componentization: A bar chart Java bean". Write a two to four page paper in which you: 1. Summarize the main points of the article. 2. Describe one way in which one could apply ...

Assignmentyou have to doone of the following1modify your

Assignment You have to doONE of the following: 1. Modify your Registration project(s) to use a Hash Table to maintain the student information instead of the sorted array or BST. Your hash function should be based on the ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

WalMart Identification of theory and critical discussion

Drawing on the prescribed text and/or relevant academic literature, produce a paper which discusses the nature of group

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro