Question: Problem statement Write a program that takes a frequency and, optionally, a reference frequency for As, and determines the corresponding pitch and octave the degree

 Problem statement Write a program that takes a frequency and, optionally,
a reference frequency for As, and determines the corresponding pitch and octave
the degree to which the frequency is out of tune, given the

Problem statement Write a program that takes a frequency and, optionally, a reference frequency for As, and determines the corresponding pitch and octave the degree to which the frequency is out of tune, given the reference frequency which species from a prioritized list can hear the frequency, if any Instructions Using the provided template file, frequency.py, implement the following functions. The template imports some functionality from standard libraries, notably the log2() function for calculating logarithms of base 2. It includes a function, parse_args(), which processes command-line arguments, and an if name == "main": statement which runs the entire program. You will not need to edit the template code other than to remove the comments on lines 9-14. You will write your functions after the import statemekts and before the parse_args() function. Analyze a frequency and provide information about its pitch, octave, intonation, and perceptibility. from argparse import ArgumentParser from math import log2 import sys # Replace this comment with your implementation of the following functions: get pitch() get_octave) check_intonation who_can_hear() main() def parse_args(arglist): un process command line arguments. Expect one mandatory argument (a frequency) and one optional argument, preceded by "-4" (the value to use as the frequency of A4). Args: arglist list of str): arguments from the command line. Returns: namespace: the parsed arguments, as a namespace HI parser ArgumentParser parser. add_argument (treg" typeufloat, help a frequency in H2) parser. add_argument (a typeut toat, default=440.0, help frequency to use for A4) args parser.parse_argsCarglist) return args I 1 name . args parse_args (sys.argv[1:1) main(args.freg, a4-args. a4) Problem statement Write a program that takes a frequency and, optionally, a reference frequency for As, and determines the corresponding pitch and octave the degree to which the frequency is out of tune, given the reference frequency which species from a prioritized list can hear the frequency, if any Instructions Using the provided template file, frequency.py, implement the following functions. The template imports some functionality from standard libraries, notably the log2() function for calculating logarithms of base 2. It includes a function, parse_args(), which processes command-line arguments, and an if name == "main": statement which runs the entire program. You will not need to edit the template code other than to remove the comments on lines 9-14. You will write your functions after the import statemekts and before the parse_args() function. Analyze a frequency and provide information about its pitch, octave, intonation, and perceptibility. from argparse import ArgumentParser from math import log2 import sys # Replace this comment with your implementation of the following functions: get pitch() get_octave) check_intonation who_can_hear() main() def parse_args(arglist): un process command line arguments. Expect one mandatory argument (a frequency) and one optional argument, preceded by "-4" (the value to use as the frequency of A4). Args: arglist list of str): arguments from the command line. Returns: namespace: the parsed arguments, as a namespace HI parser ArgumentParser parser. add_argument (treg" typeufloat, help a frequency in H2) parser. add_argument (a typeut toat, default=440.0, help frequency to use for A4) args parser.parse_argsCarglist) return args I 1 name . args parse_args (sys.argv[1:1) main(args.freg, a4-args. a4)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!