Spring2015.CITA180Homework4 History

Show minor edits - Show changes to markup

Added lines 1-57:

Assigned Date: Friday, Mar. 13, 2015
Due Date: Friday, Mar. 20, 2015
Due Time: 9:20 AM

Last modified on March 13, 2015, at 11:41 AM (see updates)


Write three different programs, each modeling one of J.S. Bach's canons.

Aim towards more complicated canons. The goal is to be as diverse (from your classmates) as possible.

Learning Objectives

  • Analyze Bach canons and how they are constructed
  • Apply Mod functions
  • Synthesize programs that generate canons

Also how to:

  • Analyze music and create musical studies modeled on pre-existing works.
  • Apply numeric and string data types to represent information.
  • Use variables in program development.
  • Use predefined classes in program development (object-based programming).


The Golden Rule of Style: "A program should be as easy for a human being to read and understand as it is for a computer to execute." [1]

In general, you should comment any variable, obscure statement, block of code, etc. you create.

Follow the documentation instructions from Homework 1. In particular, your header documentation should mention the name of the piece where the music comes from, and, if you used a score available on-line, include the URL where the score can be found.


Once you complete the above, create your own music (using Mod functions in a meaningful way), for bonus points.

Document your idea in the program's comments, so that I'll know what you are trying to do, when I am grading.


You will submit your assignment via OAKS. Be ready to demo your music to the class. Your submission consists of:

  1. Your Python programs. Give them meaningful names (see Ch. 4 for examples).
  2. The MIDI files generated from your program. Again, give them meaningful names.
  3. Printouts of your programs - to be submitted in class during the performance.


Your grade will be based on how well you followed the above instructions, and the depth/quality of your work.


  1. Cooper, D. and Clancy, M. (1985) "Oh! Pascal", 2nd ed., W.W. Norton & Company, New York, p. 42.