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

Sum02 Final Exam Review: Multimedia Programming in Squeak

Edit Sum02 Final Exam Review: Multimedia Programming in Squeak here.

Write the Squeak code to draw a box, where you play C in the fourth octave during the first line, D in the second, E in the third, and F in the fourth – as a clarinet.


aPen := Pen new .
aPen up .
aPen goto: 100@100 .
aPen down .
(AbstractSound noteSequenceOn:
(FMSound soundNamed: 'clarinet')
from: #((c4 0.5 500) (d2 0.5 500) (e3 0.5 500) (f4 0.5 500))) play .
aPen goto: 100@200 .
theDelay := Delay forSeconds: 0.5 .
theDelay wait .
aPen goto: 200@200 .
theDelay wait .
aPen goto: 200@100 .
theDelay wait .
aPen goto: 100@100 .




alan fay

can we get a yes/no from a staff? Specifically is this single threaded so that while the four notes are playing, the machine waits, then, when those are done, the program continues?

well, i ran it in squeak. it works! :) alan fay

Link to this Page