Difference between revisions of "CSC111 Lab 3"
(→If you want to install JES on your personal Mac) |
(→Note for Mac Users) |
||
Line 51: | Line 51: | ||
* Click on '''RESCENT.PC''' | * Click on '''RESCENT.PC''' | ||
− | This will create a ''Drive'' on your Desktop. | + | This will create a new ''Drive'' called RESCENT.PC on your Desktop. |
− | * Open the drive | + | * Open the new drive |
* Select '''Courses''' | * Select '''Courses''' | ||
* Select '''CSC''' | * Select '''CSC''' |
Revision as of 15:29, 8 February 2010
You are going to use the computers in Windows mode today. Be sure to reboot them if they are in Mac mode, please!
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 Windows 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.
If you want to install JES on your personal Mac
Jes for the Mac is available on Google code. Get Jes 3.2.1 for the Mac, open the zip file, and move the JES 3.2.1.app to your Applications folder.
Note for Mac Users
If you want to download the Sound Files to your MacBook, Follow these steps:
- Click on the desktop to bring up the Finder menu
- Click on Go
- Click on Connect to Server
- Click on aft://rescent.smith.edu
- Click on RESCENT.PC
This will create a new Drive called RESCENT.PC on your Desktop.
- Open the new drive
- Select Courses
- Select CSC
- Select CSC111
- Drag the Sound Files folder to your Desktop.
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 )
.