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.
I don't understand this question. What has playing a note got to do with drawing a box? As a clarinet???
Thanks.
chok
Squeak can play notes. Do the drawing of the box as you're doing the playing. That's all. Mark Guzdial
should we pause the sound so you hear each note individually? Squeak does everything so quickly that it is playing mine as one ugly chord.
~Amy Hurst
There are a lot of methods that sounds respond to which can help you out.... a.
p _ Pen new.
p place: (100@200).
p go: 100.
p turn: 90.
(AbstractSound noteSequenceOn:
(FMSound soundNamed: 'clarinet')
from: #((c4 0.5 500))) playAndWaitUntilDone.
p go: 100.
p turn: 90.
(AbstractSound noteSequenceOn:
(FMSound soundNamed: 'clarinet')
from: #((d4 0.5 500))) playAndWaitUntilDone.
p go: 100.
p turn: 90.
(AbstractSound noteSequenceOn:
(FMSound soundNamed: 'clarinet')
from: #((e4 0.5 500))) playAndWaitUntilDone.
p go: 100.
p turn: 90.
(AbstractSound noteSequenceOn:
(FMSound soundNamed: 'clarinet')
from: #((f4 0.5 500))) playAndWaitUntilDone.
b.
m _ EllipseMorph new.
m color: Color red.
World addMorph: m.
m bounds: (0@0 extent: (50@50)); refreshWorld.
(AbstractSound noteSequenceOn:
(FMSound soundNamed: 'brass1')
from: #((c4 1.0 500))) playAndWaitUntilDone.
a.
p _ Pen new. p place: (200@200).
d := Delay forMilliseconds: 10.
(AbstractSound noteSequenceOn:
(FMSound soundNamed: 'clarinet')
from: #((c4 1 500) (d4 1 500) (e4 1 500) (f4 1 500)) ) play.
4 timesRepeat: [ 100 timesRepeat: [ p go: 1. d wait. ]. p turn: 90. ].
b.
xpos := 200. ypos := 200. mSize := 7@7.
m _ EllipseMorph new. m color: Color red.
m bounds: ( xpos @ ypos extent: mSize ). World addMorph: m.
d := Delay forMilliseconds: 10.
4 timesRepeat: [
dx := dxArray at: index. dy := dyArray at: index.
index := index + 1.
100 timesRepeat: [
xpos := xpos + dx. ypos := ypos + dy.
m bounds: ( xpos @ ypos extent: mSize ); refreshWorld.
d wait.
].
].
chok (arghh.. can't get the indentation to display right)
Chok, you can use "& nbsp"(with no space) to force the html to display a space. Doug Powers
yeah i know, i saw how you did the indentation for the Sensor Mgmt Sys, just put everything in one same line. never mind though.