Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a java program in whch the first value is a duration and the second and third values are frequencies While not at the end

Write a java program in whch the first value is a duration and the second and third values are frequenciesimage text in transcribed

While not at the end of file for StdIn declare an array of length 2 read the duration for i in the range 0 to 1 read the frequency into the ith frequencies array entry end play the chord end Note that we are now using nested loops. To play a chord, you will need a different method and that's included here: public static void playChord (double duration, double frequencies) f final in slicecount int (StdAudio. SAMPLE RATE duration) final double slices J new double sli ce Count +1 for (int i 0; i slice Count i++) double chord 0.0 for (double frequency frequencies) chord Math sin 2 Math PI i frequency StdAudio. SAMPLE RATE) slices [i] chord frequencies. length; Std Audio. play slices

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

1 2 3 Data Base Techniques

Authors: Dick Andersen

1st Edition

0880223464, 978-0880223461

More Books

Students also viewed these Databases questions