Write a function called createMelody(), which returns a phrase of notes with pitches and durations randomly selected from a scale and a list, respectively. The function should accept three parameters,...



Write a function called createMelody(), which returns a phrase of


notes with pitches and durations randomly selected from a scale


and a list, respectively. The function should accept three parameters,


namely, numNotes, scale, and durations (a list of durations) to choose


from. For example, the following call



phrase = createMelody(10, PENTATONIC_SCALE, [QN, SN, EN])


should generate a phrase of 10 notes from the pentatonic scale with


durations randomly selected from the provided list. (Hint: See the


“Pentatonic Melody Generator” case study in Chapter 6.)



May 26, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here