Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Exercise 4: Notes Synthesis In [ ]: Image ( 'lab2_exercise4.png', width = 1000) Out[5]: EXERCISE 4: Notes Synthesis Note Frequency (Hz) 220 o 0 O
Exercise 4: Notes Synthesis In [ ]: Image ( 'lab2_exercise4.png', width = 1000) Out[5]: EXERCISE 4: Notes Synthesis Note Frequency (Hz) 220 o 0 O o B 220.28 0 0 C# B C# D E F# G# 220-23 220-213 D . For this exercise we will synthesize 8 notes for A-Major scale shown above E 220.213 Using the generate_sine() function, synthesize 8 notes that make up A-Major scale. Each note should last 1 second. F# 220.21 G# . 220 - 2H For each note, use sampling rate fs = 8000 and amplitude = 1 A 440 Once all 8 notes are constructed, concatenate them into a single 1D array Play the concatenated notes using simpleaudio and write it into an audio file with name "a_major_scale.wav". In [ ]: # YOUR CODE HERE In [ ] : NOTE: Multiply your concatenated notes (with amplitude of 1) with 32767 followed by conversio # before playing or writing your audio array into a file. Exercise 5: Chord Synthesis In [ ]: Image('lab2_exercise5.png', width = 1000) Out[6]: EXERCISE 5: Chord Synthesis Note Frequency (Hz) 220 B 220.21 ft C# 220.21 Chord 2 Chord 4 Chord 1 =A+CH Chord 6 O Chord 2 =B+D 0 0 0 o Chord 3 =C#+E 0 Chord 4 =D + F# A B C# D E F# G# Chord 5=EG# + Chord 6F#A Chord 1 Chord 3 Chord 5 For this exercise, we will expand upon exercise 4 to synthesize music chords -ie. set of pitches consisting of multiple notes D 220.22 E 220.27 . F# 220.223 . For example, a chord could be A+ Bor B + C#+D, etc G# 220.21 . 440 Generate 6 chords as shown above figure - each chord consists of addition of two notes and should last for Is with sampling frequency of 8000Hz. Make sure you normalize the amplitude of the chord between-1 and 1 to be compatible with simpleaudio standard. Concatenate 6 chords into a single 10 array and write into audio file with a name "6_chords .wav" 42 In [ ]: # YOUR CODE HERE In [ ]: # NOTE: Multiply your concatenated notes (with amplitude of 1) with 32767 followed by conversio # before playing or writing your audio array into a file
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started