Fall2011.CSCI180Homework3 History

Hide minor edits - Show changes to output

Changed lines 66-67 from:
@@pitch = ((velocity - minVelocity) / (maxVelocity - minVelocity) * 90) + 30@@
to:
@@pitch = int((velocity - minVelocity) / (maxVelocity - minVelocity) * 90) + 30@@
Added lines 70-73:
Alternatively, we could use the jythonMusic @@mapValue()@@ function. This function expects as arguments the value to be mapped, the smallest and largest possible value to be mapped, and the smallest and largest values of the destination range:

@@pitch = mapValue(velocity, minVelocity, maxVelocity, 30, 120)@@
Added line 76:
# '''Make your program do all the necessary calculations.''' In other words, your program should include the formula that generates each pitch. Make your program do all the work (as opposed to you doing some of the calculations (e.g., in the Python interpreter, or via a calculator) and then using the numeric results in the program).
Deleted line 78:
# Make sure you convert @@pitch@@ to an integer (via the @@int()@@ function) before using it to create a MIDI note.
Changed line 7 from:
''Due Date'': Friday, Oct. 28\\
to:
''Due Date'': Monday, Oct. 31\\
Changed line 14 from:
''Due Date'': Thursday, Oct. 27\\
to:
''Due Date'': Tuesday, Nov. 1\\
Changed lines 136-137 from:
# Olivier Messiaen, "[[http://www.youtube.com/watch?v=ME5laJctGCo | Mode de valeurs et d'intensites]]" (1949).
to:
# Olivier Messiaen, "[[http://www.youtube.com/watch?v=ME5laJctGCo | Mode de valeurs et d'intensités]]" for piano (1949).
Changed lines 136-137 from:
# Olivier Messiaen, "[[http://www.youtube.com/watch?v=ME5laJctGCo | Mode de valeurs et d'intensites]] (1949).
to:
# Olivier Messiaen, "[[http://www.youtube.com/watch?v=ME5laJctGCo | Mode de valeurs et d'intensites]]" (1949).
Changed lines 136-137 from:
to:
# Olivier Messiaen, "[[http://www.youtube.com/watch?v=ME5laJctGCo | Mode de valeurs et d'intensites]] (1949).
Added lines 52-55:
!!!Planets and the Golden Ratio

Using Bode's law, it has been shown that "the orbital data of all planets, asteroids, moons, and rings in the solar system reduce to a simple numerical pattern based on the golden ratio. A set of integers, not unlike the quantum numbers of atomic systems, defines the mean orbits of all planets and major satellites." [2]
Changed lines 79-80 from:
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]
to:
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." [3]
Added line 133:
# Jan C. A. Boeyens, "[[http://137.215.9.22/bitstream/handle/2263/16355/Boeyens_Commensurability(2009).PDF | Commensurability in the solar system]]", Physics Essays, 22(4), pp. 493-500, Dec. 2009.
Added lines 1-138:
(:table border=0 width=100%:)

(:cell width=14% valign=top align=left style='padding:5px;':)
'''Section 1:'''
(:cell width=86% style='padding:5px;':)
''Assigned'': Friday, Oct. 21, 2011\\
''Due Date'': Friday, Oct. 28\\
''Due Time'': 10:50am\\

(:cellnr valign=top align=left style='padding:5px;':)
'''Section 2:'''
(:cell style='padding:5px;':)
''Assigned'': Thursday, Oct. 20, 2011\\
''Due Date'': Thursday, Oct. 27\\
''Due Time'': 9:20am\\

(:tableend:)

Last modified on {$LastModified} (see [[http://www.cs.cofc.edu/~manaris/index.php/Fall2011.CSCI180Homework3?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)