First time here? Check out the FAQ!
x

In a Script, why can't I start a Sound stored in a variable... sometimes?

0 votes
270 views

In a Script, if I create an instance of a Sound (from one of the input Sounds of the Script) with parameters and store the result in a variable I can't later send the "start:" message to that Sound. 

But if I set the variable to the Sound without specifying any of the parameters, I can. 

Why is that?

eg, in a Script:

"where buzz is one of the Script's Inputs"

| r |

"doesn't work, gives a 'start: message not understood' error."
r := buzz freq: 431 hz.
r start: 0 s.

"does work"
r := buzz.
r freq: 431 hz. 
r start: 0 s.

asked Jun 13, 2019 in Capytalk & Smalltalk by alan-jackson (Virtuoso) (15,840 points)
Ah the plot thickens...

This doesn't work too:
    
    r := buzz.
    r := r freq: 431 hz.
    r start: 0 s.

So I'm guessing when you send a message (like start:) to "buzz" (which is an Oscillator prototype) it returns an Oscillator.

Which makes me wonder, what is "buzz"?

Please log in or register to answer this question.

...