Spring2015.CITA180Homework1 History

Show minor edits - Show changes to markup

Added lines 7-19:

Assignment

In class we worked through several programs that create and play a single note. We also saw how to do arithmetic in Python. Since music is numbers and number is music, it is only natural to learn how to combine the two in a Python program.

For this assignment, you are asked to write a program that inputs two numbers:

  • an octave (from 1 to 8)
  • a pitch within that octave (0 to 11)

The program should then play a corresponding whole (WN) note, and terminate.

Remember that MIDI octaves are numbered from 0 to 9. So, in this program, we are interested in a note ranging from the second MIDI octave to the penultimate (one-before-the-last) octave.

Deleted lines 32-46:

Assignment

In class we worked through several programs that create and play a single note. We also saw how to do arithmetic in Python. Since music is numbers and number is music, it is only natural to learn how to combine the two in a Python program.

For this assignment, you are asked to write a program that inputs two numbers:

  • an octave (from 1 to 8)
  • a pitch within that octave (0 to 11)

The program should then play a corresponding whole (WN) note, and terminate.

Notes

  1. Remember that MIDI octaves are numbered from 0 to 9. So, in this program, we are interested in a note ranging from the second MIDI octave to the penultimate (one-before-the-last) octave.
Changed lines 7-12 from:

Purpose

This assignment focuses on:

  1. Be able to edit and run a Python program using the JEM integrated development environment (IDE).
  2. Interact with simple Python programs that produce output and do arithmetic.
to:

Learning Objectives

This assignment has the following objectives:

  • Understand the fundamentals of music theory.
  • Apply numeric data types to represent information.
  • Use variables in program development.
  • Understand arithmetic operators and use them to design expressions.

Also how to:

  • Edit and run a Python program using the JEM integrated development environment (IDE).
  • Interact with simple Python programs that produce output and do arithmetic.
Changed line 5 from:

Last modified on February 12, 2015, at 09:40 AM (see updates)

to:

Last modified on February 12, 2015, at 09:40 AM (see updates)

Changed lines 1-2 from:

Assigned Date: Friday, Jan. 23, 2015
Due Date: Wednesday, Jan. 28, 2015\\

to:

Assigned Date: Monday, Jan. 26, 2015
Due Date: Friday, Jan. 30, 2015\\

Added lines 1-80:

Assigned Date: Friday, Jan. 23, 2015
Due Date: Wednesday, Jan. 28, 2015
Due Time: 9:20am

Last modified on February 12, 2015, at 09:40 AM (see updates)

Purpose

This assignment focuses on:

  1. Be able to edit and run a Python program using the JEM integrated development environment (IDE).
  2. Interact with simple Python programs that produce output and do arithmetic.

Assignment

In class we worked through several programs that create and play a single note. We also saw how to do arithmetic in Python. Since music is numbers and number is music, it is only natural to learn how to combine the two in a Python program.

For this assignment, you are asked to write a program that inputs two numbers:

  • an octave (from 1 to 8)
  • a pitch within that octave (0 to 11)

The program should then play a corresponding whole (WN) note, and terminate.

Notes

  1. Remember that MIDI octaves are numbered from 0 to 9. So, in this program, we are interested in a note ranging from the second MIDI octave to the penultimate (one-before-the-last) octave.

Bonus

Once you complete the above, you may feel like doing additional work, for bonus points. Here are some ideas:

  1. Explore the use of the Python for loop to make the program play 10 notes in sequence.
  2. Any other idea you can think of (just document your idea in the program's comments, so that I'll know what you are trying to do, when I am grading).

Documentation

You should comment any variable, obscure statement, block of code, etc. you create. Follow the textbook examples on how to document code.

Additionally, your code should always have header documentation that explains what the program does, in general terms.

For this assignment, just copy and paste these into the top of your program. (For future assignments, you will have to modify these comments, to fit the new assignment.)

(:source lang=Python tabwidth=3 -trim :)

  1. digitalPiano1.py
  2. Author:
  3. Email:
  4. Class: CITA 180
  5. Assignment: Homework #1
  6. Due Date:
  7. Purpose: This program plays a single note from the computer keyboard.
  8. Input: Two integers from the computer keyboard. The first is the octave
  9. of the note to be played (ranging between 1 to 8). The second is
  10. the relative pitch within the octave (ranging between 0 and 11).
  11. No error checking is performed (i.e., we assume the user makes
  12. no mistake when entering these values).
  13. Output: The corresponding note played via the computer's synthesizer.

(:sourcend:)

NOTE: In the above, replace the bracketed phrases, e.g., , with your name, e.g., John Smith. Do remove the brackets.

Submissions

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

  1. Your Python program. Call it, digitalPiano1.py.
  2. A printout of your program - to be submitted in class on the due date.
  3. If you do the bonus, submit a separate, additional program. Give the program a different name, e.g., digitalPiano1.bonus.py

Grading

Your grade will be based on how well you followed the above instructions.