Instructions for wavesynthTune2

(produced at 00:07 a.m. UTC on 2024-03-25)

This task is part of project08 which is due at 23:00 EDT on 2024-04-02.

You have the option to work with a partner on this task if you wish. Working with a partner requires more work to coordinate schedules, but if you work together and make sure that you are both understanding the code you write, you will make progress faster and learn more.

You can download the starter code for this task using this link.

You can submit this task using this link.

Put all of your work for this task into the file tune2.py
(you will create this file from scratch)

For this task, we want you to review concepts covered in the first part of the class, like loops, functions, and conditionals, giving you space to design your own code that uses these constructs. Back at the start of the class you did either a custom scene or a custom song a way of learning about Python basics; now you will have a chance to make something more complex, using what you've learned so far. This task focuses on wavesynth audio, while you could instead do the turtleScene2 task which focuses on drawing with turtle and turtleBeads.

The requirements are again simple, with no restrictions on what audio you produce: the only rules are that you must make use of certain Python statements.

To start, you need to create a new file, named tune2.py. This file must be in a folder where wavesynth.py is also present. Download the starter code, unzip it, and then create your tune2.py file in that folder.

Your tune2.py file must satisfy the following criteria:

  1. Your file must start with the usual docstring with authorship information. Here's a template you can copy and paste:

    """
    Authors: Anon & Ymous
    Consulted: T. A.
    Date: 2023-10-31
    Purpose: Wavesynth tune task version 2
    """
    
  2. Your file will have to import the wavesynth module.

  3. Your file must include a nested loop, which can be any combination of for and/or while loops as long as they're directly inside each other. Inside the inner loop of this nested loop, you must call a custom function called addOne.
  4. Your addOne function must accept at least two parameters.
  5. Your addOne function must contain at least one if/else statement.
  6. Your addOne function must call at least one of the following functions:
    • addNote
    • addBeast
  7. You must use at least one of the functions climbUp, climbDown, halfStepUp, halfStepDown, climbUpFrom, climbDownFrom, halfStepUpFrom, or halfStepDownFrom to change the current pitch between notes, or to compute a pitch based on another pitch.
  8. You must use at least one of the setVolume, quieter, and/or louder functions to manipulate the volume of one or more notes or beats.
  9. You must use at least one of the setTime, rewind, and/or fastforward functions to alter the time at which some notes or beats are created.
  10. You must use the saveTack function so that your program saves the music to a file. You may name your saved file whatever you wish. As an extra goal, you may also use the printTrack function to print out a record of the notes you created. Calling playTrack is not required, but if simpleaudio can be installed on your system, it's a faster way to hear the audio than opening up the saved file each time.

You are welcome to use other wavesynth features in addition to the ones listed above, but only the above features are required.

After completing this task, you must take the audio file that saveTrack produces, name it correctly, and upload it to the shared google drive folder as explained in the submission instructions.

Examples

Rubric

Group goals:
 
unknown No errors loading code
Your code should be able to be loaded without errors. Run your code before submitting it to make sure this is true.
 
unknown Use any kind of loop
Use any kind of loop in at least one place.
 
unknown Use any kind of loop
Within the loop, use any kind of loop in at least one place.
 
unknown Call addOne
Within the loop within the loop, call addOne in at least one place.
 
unknown Define addOne(_, _, ___)
Use def to define addOne(_, _, ___)
 
unknown Use a conditional
Within the definition of addOne(_, _, ___), use an if statement (possibly accompanied by an elif or else block) in at least one place.
 
unknown Call addNote
Within the definition of addOne(_, _, ___), call addNote or addBeat in at least one place.
 
unknown Call climbUp
Call climbUp, climbDown, halfStepUp, halfStepDown, climbUpFrom, climbDownFrom, halfStepUpFrom, or halfStepDownFrom in at least one place.
 
unknown Call setVolume
Call setVolume, quieter, or louder in at least one place.
 
unknown Call setTime
Call setTime, rewind, or fastforward in at least one place.
 
unknown Call saveTrack
Call saveTrack in at least one place.
 
unknown Call printTrack
Call printTrack in at least one place.