Question

4.16 LAB: Musical note frequencies On a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequenc

0 1
Add a comment Improve this question Transcribed image text
Answer #1

r 2 * (1/12) Python 3.6.1 (default, Dec 2015, 13:05:11) GCC 4.8.21 on linux Enter start frequency: 440 440.00 466.16 493.88 5


r = 2 ** (1/12)

start = float(input('Enter start frequency: '))

for i in range(5):
        print('%0.2f' % (start * (r ** i)), end= ' ')
print()

=============

Please upvote, as i have given the exact answer as asked in question. Still in case of any issues in code, let me know in comments. Thanks!

Add a comment
Know the answer?
Add Answer to:
4.16 LAB: Musical note frequencies On a piano, a key has a frequency, say f0. Each...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Code in Coral please 2.17 LAB: Musical note frequencies On a piano, a key has a...

    Code in Coral please 2.17 LAB: Musical note frequencies On a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequency of f0 * rn, where n is the distance (number of keys) from that key, and r is 2(1/12). Given an initial key frequency, output that frequency and the next 4 higher key frequencies. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: print('{:.2f}...

  • Musical note frequencies

    3.11 LAB: Musical note frequenciesOn a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequency of f0 * rn, where n is the distance (number of keys) from that key, and r is 2(1/12). Given an initial key frequency, output that frequency and the next 4 higher key frequencies.Output each floating-point value with two digits after the decimal point, which can be achieved as follows:System.out.printf("%.2f", yourValue);Ex: If the input is:440.0(which is the A...

  • Write an M-file to produce a desired note, expressed in piano key number, for a given...

    Write an M-file to produce a desired note, expressed in piano key number, for a given duration. Your M-file should be in the form of a function called key2note.m. Your function should have the following form: function xx = key2note(X, keynum, dur, fsamp) % KEY2NOTE Produce a sinusoidal waveform corresponding to a % given piano key number % % usage: xx = key2note (X, keynum, dur) % % xx = the output sinusoidal waveform % X = complex amplitude for...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT