Spring2011.CSCI180Homework2 History

Hide minor edits - Show changes to output

Changed line 2 from:
'''Due Date''': Wednesday, Apr. 6, 2011\\
to:
'''Due Date''': Friday, Apr. 8, 2011\\
Added lines 1-124:
'''Assigned Date''': Wednesday, Mar. 30, 2011\\
'''Due Date''': Wednesday, Apr. 6, 2011\\
'''Due Time''': 8:55am

Last modified on {$LastModified} (see [[http://www.cs.cofc.edu/~manaris/?n=Spring2011.CSCI180Homework2?action=diff&source=n&minor=n | updates]])

This is a '''pair-programming''' assignment (i.e., you may work with '''one''' partner). '''You may discuss the assignment only with your partner or the instructor.'''

!!Purpose

This assignment focuses on:

* creating music with computers,
* connections between numbers and music,
* fundamentals of algorithmic composition,
* MIDI notes, durations, etc., and
* generating a MIDI file.

!!Introduction

According to Scaletti [1],

-> [t]he idea of representing data in sound is an ancient one. For the ancient Greeks music was not an art-for-art's sake, practiced in a vacuum, but a manifestation of the same ratios and relationships as those found in geometry or in the positions and behaviors of the planets.

!!!Johannes Kepler

In 1619 [[http://en.wikipedia.org/wiki/Johannes_Kepler | Johannes Kepler]] wrote his "[[http://en.wikipedia.org/wiki/Harmonices_Mundi | Harmonices Mundi (Harmony of the Worlds)]]" treatise. While philosophers spoke of the "music of the spheres," Kepler discovered physical harmonies in planetary motion and is a key figure in the scientific revolution that brought us out of the dark ages.
* Here is a modern [[http://www.willieruff.com/soundfiles/01.Mercuryoutward.mp3 | sonification]] based on Kepler's "Harmonices Mundi" and actual orbital data of planets in our solar system.
* Here is [[http://www.willieruff.com/kepler.html | more information about this sonification]].
** [--Here is a lesser quality, but still relevant [[http://www.youtube.com/watch?v=1EFZuzgcIzY | YouTube video]].--]

!!!Bode's Law

The [[http://en.wikipedia.org/wiki/Titius%E2%80%93Bode_law | Titius–Bode law]] (aka Bode's law) is an attempt to model the symmetries and proportions of our solar system. Actually, it predicted [[http://en.wikipedia.org/wiki/Asteroid_belt | the asteroid belt]] between Mars and Jupiter (long before it was discovered), but fails to account of the irregularly moving Neptune and the (now demoted non-planet) Pluto.

%height=200px% http://www.aerospaceweb.org/question/astronomy/solar-system/solar-system.jpg

!!Assignment

Write a Jython program that generates a sonification of the planets' organization using the jMusic programming library for musicians. Your program should generate a MIDI file with your sonification.

In particular, convert the orbital velocities of the planets to MIDI notes:

* Map the range of [[http://www.windows.ucar.edu/tour/link=/our_solar_system/planets_table.html&edu=high | orbital velocities]] to the range of 30-120. Use the resulting numbers as MIDI pitches.

To do so, use the following formula:

@@pitch = ((velocity - minVelocity) / (maxVelocity - minVelocity) * 90) + 30@@

where @@velocity@@ is the orbital velocity of some planet, @@minVelocity@@ is the smallest orbital velocity among the planets, and @@maxVelocity@@ is the largest orbital velocity among the planets.

!!!Notes:

# Do include Ceres (i.e., the asteroid belt) and Pluto.
# Make sure you initialize each of the above variables appropriately.
# Make sure you convert @@pitch@@ to an integer (via the @@int()@@ function) before using it to create a MIDI note.
# Feel free to experiment with other astronomical data from the planets.

!!Documentation

Follow 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." [2]

In general, you should comment any variable, obscure statement, block of code, method, and class you create.

Your comments should express '''why''' something is being done, as opposed to '''how''' – the how is shown by the code.

!!!Top Documentation

Additionally, your code should always include opening comments as follows:

(:source lang=Python tabwidth=3 -trim :)
#
# Author: <Your Name(s)>
# Email: <Your email address(es)>
# Class: CSCI 180, Section 1
# Assignment: HMWK2
# Due Date: <The assignment's due date>
#
# Certification of Authenticity <remove one of the following>:
#
# I certify that this lab is entirely my own work.
#
# I certify that this lab is my own work, but I received
# some assistance from: <Name(s)>
#
# Purpose: <Provide a simple, yet complete description of the task being
# performed by this program. It may be several sentences long.>
#
# Input: <Provide a simple, yet complete description of the input required
# by this program.>
#
# Output: <Provide a simple, yet complete description of the output generated
# by this program.>
#
(:sourcend:)

!!Submissions

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

# Your Jython program (call it '''harmonicesMundi.py''').
# Your MIDI file (call it '''harmonicesMundi.mid''').

!!Grading

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

!!!Relevant Quote

"Any amount of work can be done in any amount of time... only the quality varies." ~Joao Meidanis

!!Reference

# Quote from [[http://www.symbolicsound.com/ssc.html|Carla Scaletti]], "Sonification - An Ancient Idea Made Feasible by New Technology", ''ACM SIGRAPH '93 - Course Notes 81'', Aug. 1993, p. 4.2.
# Cooper, D. and Clancy, M. (1985) "Oh! Pascal", 2nd ed., W.W. Norton & Company, New York, p. 42.
# Enchanted Learning.com, "[[http://www.enchantedlearning.com/subjects/astronomy/planets/ | The Planets (plus the Dwarf Planet Pluto)]]", Accessed on-line, Feb. 17, 2010.

!!A Few Interesting Submissions

Here are three submissions from a previous semester [--(independent of grade earned - grading depended on more than just sound)--]

# [[http://www.cs.cofc.edu/~manaris/uploads/Spring2010/harmonicesMundi.AltmanMiller.mid | Harmonices Mundi #1]] (by Courtney Miller and Caitlin Altman)
# [[http://www.cs.cofc.edu/~manaris/uploads/Spring2010/harmonicesMundi.McNellisFricker.mid | Harmonices Mundi #2]] (by Douglas McNellis and Ian Fricker)
# [[http://www.cs.cofc.edu/~manaris/uploads/Spring2010/harmonicesMundi2.BloughWayles_McSween.mid | Harmonices Mundi #3]] (by Matthew Blough-Wayles and Shea McSween)