View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

F02 Final Exam Review: Multimedia Programming in Squeak

(a)

myPen

myPen := Pen new.

myPen up.
myPen north.
myPen down.
myPen go: 50.

(AbstractSound noteSequenceOn:
(FMSound soundNamed: 'brass1')
from: #((c4 1.0 500))) play.

myPen turn: 90.
myPen go: 50.

(AbstractSound noteSequenceOn:
(FMSound soundNamed: 'brass1')
from: #((d4 1.0 500))) play.

myPen turn: 90.
myPen go: 50.

(AbstractSound noteSequenceOn:
(FMSound soundNamed: 'brass1')
from: #((e4 1.0 500))) play.

myPen turn: 90.
myPen go: 50.

(AbstractSound noteSequenceOn:
(FMSound soundNamed: 'brass1')
from: #((f4 1.0 500))) play.


(b)
e := EllipseMorph new.
e color: (Color red).
e openInWorld.
e move: e toPosition: 100@50.

(AbstractSound noteSequenceOn:
(FMSound soundNamed: 'brass1')
from: #((c4 1.0 500))) play.

e move: e toPosition: 200@50.

(AbstractSound noteSequenceOn:
(FMSound soundNamed: 'brass1')
from: #((d4 1.0 500))) play.

e move: e toPosition: 200@150.

(AbstractSound noteSequenceOn:
(FMSound soundNamed: 'brass1')
from: #((e4 1.0 500))) play.

e move: e toPosition: 100@150.

(AbstractSound noteSequenceOn:
(FMSound soundNamed: 'brass1')
from: #((f4 1.0 500))) play.

e move: e toPosition: 100@50.



The (a) above doesn't include the time delays to print one side of the box as the sound is being made.
a (with time delays) myPen := Pen new.

myPen up.
myPen north.
myPen down.

(AbstractSound noteSequenceOn:
(FMSound soundNamed: 'clarinet')
from: #((c4 1.0 500))) play.

myPen go: 50.

temp := Delay forSeconds: 1.
temp wait.

(AbstractSound noteSequenceOn:
(FMSound soundNamed: 'clarinet')
from: #( (d4 1.0 500))) play.

myPen turn: 90.
myPen go: 50.

temp wait.

(AbstractSound noteSequenceOn:
(FMSound soundNamed: 'clarinet')
from: #((e4 1.0 500))) play.

myPen turn: 90.
myPen go: 50.

temp wait.

(AbstractSound noteSequenceOn:
(FMSound soundNamed: 'clarinet')
from: #((f4 1.0 500))) play.

myPen turn: 90.
myPen go: 50.

Link to this Page