I need to write a program that generates notes c-cleff. The function should output a vector of samples of a note at the specified sampling rate and…

I need to write a program that generates notes c-cleff. The function should output a vector of samples of a note at the specified sampling rate and for the specified duration. The function should be called “mytone.” i must write the main program that calls on mytone for notes in a song so that my program plays “Mary had a little lamb”. The main programs should play the song via soundsc. BELOW IS WHAT I HAVE DONE SO FAR AND WHERE I AM STUCK. PLEASE BE AS DETAILED AS POSSIBLE.This is the tone function that i have come up with.function [x] = MyTone (fo, tduration)fs=5000;ts=1/fs;t=0:ts:tduration;x=sin(2*pi*fo*t);endNow I need to call “mytone” function so i can play the notes, the main programs should play the songs via soundsc. This is what i have so far but it is not working and i cant hear any sounds.fs=8000a = MyTone(4000,.1)x=[x a]soundsc(x,fs)

Leave a Reply