""" Authors: Peter Mawhorter Consulted: Date: 2022-01-21 Purpose: SOLUTION for Lab01 melody exercises """ from wavesynth import * # Set our starting pitch setPitch(C4) # Add 4 1/4 second notes addNote(0.25) climbUp(1) addNote(0.25) climbUp(1) addNote(0.25) climbDown(2) addNote(0.25) # Rewind to start and add beats on the 1st and 3rd note rewind(1) quieter(2) addBeat(0.25) addRest(0.25) addBeat(0.25) # Set pitch one octave lower setPitch(C3) # Rewind to start and add a chord of 1-second notes # By using '4' and '3' half-steps between these notes, we get a "major" # chord that sounds cheerful. If we used 3 and then 4 half-steps, we'd # get a "minor" chord that sounds sad. rewind(1) addNote(1) rewind(1) halfStepUp(4) addNote(1) rewind(1) halfStepUp(3) addNote(1) saveTrack("melody.wav") playTrack()