[squeak-dev] Sound library (from Squeaking up for "'click' sound play")

Hannes Hirzel hannes.hirzel at gmail.com
Sat Apr 24 08:34:32 UTC 2010


Hi Jerome

Thanks for starting to work out a write-up how to deal with sound in Squeak 4.1.

On 4/23/10, Jerome Peace <peace_the_dreamer at yahoo.com> wrote:
> Hi Hannes.
>
>
>>Hannes Hirzel hannes.hirzel at gmail.com
>>Fri Apr 23 09:25:54 UTC 2010 wrote:
>>
>>Yes, Jerome
>>
>>I am interested as well to have a good sound library in Squeak which
>>is easy to access. With a sound browser.....
>>
>>Would it be possible to summarize with a few code snippets how we are
>>supposed to work with sounds as it is currently
>
> Yes. I decline. I'm a lazy programmer and it is easier to use the selector
> to guarentee the return of a playable sound based on the name of the
> receiver.
>
> "'click' sound" guarentees you have a playable sound.
>
> Assuming there are entries in SoundLibrary:
> currentSound := SampledSound soundNames atRandom sound .
> currentSound play.
> will make one. (If the library is empty you will get a debug box from
> atRandom)

OK so may I consider SampledSound to be the sound library?

> "'click' sound play" on the other hand will play the default sound.
>
> Wait.
> You're in luck. My brain just remembered how to browse the sound library.
> Open a view on any morph. One of the basic thing you can do is 'make sound'
> the argument is selected from a pull down list of what is in the sound
> library.
>
>>and secondy what you think it should be in the future.
>>
> I haven't gotten that far in my thinking yet. I wandered into the creation
> of this selector because "Beeper beep: 'click'" was used extensively in one
> of my programs. When the deprecated Object>>#beep: got nuked it didn't work
> anymore.
>
> Rather than patch back the past I decided I wanted to have a selector I
> could send to the name of the sound I wanted to play.


> Seymour Papert talks about bricolage. Spending time building with things
> already on hand. Building in a playful spirit. The sound classes in squeak
> are amazing toys to play with. Beyond the sounds in the SampledSound sound
> library you can play a great number of things. I've just started to notice
> its capabilities.
This is interesting. Do you have a reference?


> The selector I am proposing is just a way to connect a name with something
> that can play.
>
> So someday:
> "'myGreatMasterpiece' sound play"
>
> I just have to find a way to build a sound library of masterpieces and teach
> the selector how to have access to it. :-)

Yes, we need a good way to access sounds. That means 'code idioms'
which are easy to grasp for a beginner to use sounds.


(Or in SW engineering terms - an embedded DSL for handling sounds)

It would help to have a couple of good example statements what can be
done with sound as of now.

Did you check out the Squeak wiki? I found an entry
Squeak sound architecture
http://wiki.squeak.org/squeak/1952

I did not go through it.
We need to know what still works or how things are done these days.

This could then be an entry in the 'Help' menu called 'Sound' which
contains code snippets and instructions how to deal with sound.

> A journey sometimes starts with only a notion of a destination or even just
> a need to leave the present location. The path unfolds as one goes. Always,
> a journey starts with a first step.

I agree. And you did that step.


> Yours in curiosity and service, --Jerome Peace
>

In your service as well

Hannes

P.S. The  class AbstractSound  and the subclasses - do they contains
useful comments?



More information about the Squeak-dev mailing list