Programming in Java Practical Class

Java Tick 5*


A graphical display is just one method of communicating the evolution of a pattern in a Game of Life. In this tick you will experiment with audible representations of the game world and write a program which can produce a WAV audio file which represents the evolution of the game. Your workstation has a headphone port on the front. If you don't have any headphones please ask to borrow a pair.

A simple library for writing audio files has been provided to get you started. You should download this from the course website at http://www.cl.cam.ac.uk/teaching/current/ProgJava/sound.jar. The Javadoc for this library is available at: http://www.cl.cam.ac.uk/teaching/current/ProgJava/sounddocs. It's a good idea to start by reading the documentation of the AudioSequence class.

There are three possible ways to get your tick:

To gain the tick your submission must produce an audible output which is representative of the world state in some way. Your implementation should include a main method inside a class called SoundLife inside the package uk.ac.cam.your-crsid.tick5star. Your implementation of SoundLife should support at least three parameters on the command line:

You should submit your favorite "tune" in a WAV file called competition.wav as part of your submission. You should also include a text file called notes.txt which contains instructions written with a sufficient level of detail to enable a competent programmer to re-implement your program. The best audible rendering of a Game of Life will be displayed on the course website next week. Once you are happy that your program works correctly, construct a jar file called crsid-tick5star.jar containing your code and email it as an attachment to ticks1a-java@cl.cam.ac.uk. Your jar file should contain at least:

META-INF/
META-INF/MANIFEST.MF
uk/ac/cam/your-crsid/tick5star/notes.txt
uk/ac/cam/your-crsid/tick5star/competition.wav
uk/ac/cam/your-crsid/tick5star/SoundLife.java
uk/ac/cam/your-crsid/tick5star/SoundLife.class

You do not need to include any of the contents of the library sound.jar in your submission but any other required classes should be included. Your jar file should have the entry point set so that the following renders six generations of a Glider pattern to the file competition.wav:

crsid@machine:~> java -jar crsid-tick5star.jar \
"Glider:Richard Guy (1970):20:20:1:1:010 001 111" 6 competition.wav

Copyright 2008-2012 Alastair R. Beresford and Andrew C. Rice