CSC111 Lab 3
Contents
Software Setup
Before you can use the JES programming environment, you need to install it first.
- Login to your Novell account.
- Open your H: drive in Windows Explorer.
- Open Windows Explorer a second time, so that you have two windows open.
- In the second window, enter this address in the Address bar: \\rescent\pc\COURSES\CSC\CSC111
- This is the place on the Novell network where you will find many files related to the homework assignments and the labs.
- Drag the folder named jes-3-1-1windows from the CSC111 window to your H: drive.
- Since you are there, drag as well the Sound Files folder from the CSC111 window to your H: drive.
- You can now close the windows showing the CSC111 folder. You won't need it for the rest of this lab.
- In the window showing your H: drive, open the JES folder and click on the JES icon (snake face with glasses :-)
- After a few (long) seconds, you should get the JES programming environment.
If you want to install JES on your personal computer
If you want to install JES on your Mac or Windows laptop or computer, you can get also get JES from the Web, at this address http://coweb.cc.gatech.edu/mediaComp-teach/26. Click on the the file jes-3-1-1-windows.zip if you use Windows, or on jes-3-1-1-macosx.dmg if you have a Mac, and install as you would a regular application.
Notes for Mac users
Jes for the Mac is available on Google code. Get Jes 3.2.1 for the Mac and install on your mac.
Your First JES Program
Open JES by double-clicking on the icon or navigating through the start menu (on pcs)
- In the window that opens, the top portion is program area, and the bottom portion is command area (the interactive window we have already seen on beowulf).
Creating and running programs
In the Program area, type in the following lines, being careful to follow the format exactly (including all punctuation and indenting)
.
def main():
name = raw_input( "what is your name? " )
print "hello there, " + name + "!"
.
- Save the file by typing Control-S.
- A popup window opens up. Save the file as hello.py in your H: drive
- Click on Load Program button to load the file just stored in JES.
- In the command area (black window), type
main()
- to call the function.
- Make sure you see the pop-up window asking for your name, and the response of the program in the interactive area.
Playing Sound Files
In the JES program area, type in the following main() function:
.
def main():
file = pickAFile()
sound = makeSound( file )
blockingPlay( sound )
.
.
for sample in getSamples( sound ):
value = getSampleValue( sample )
setSample( sample, value/2 )
blockingPlay( sound )
.