Discuss Scratch

SaraVenture
New Scratcher
5 posts

How to play random sounds?

Hi All!

I've got a bunny who every time he eats the bananas plays the sound “nom!” and thats working fine. However I've recorded a ton of variations of the sound clip “nom” and I want them to be randomly selected when the bunny eats a banana, to give it some variations.

How do I script “play sound (random from list) once”?

Thank you!
drmcw
Scratcher
1000+ posts

How to play random sounds?

playsounditemrandomoflistuntildone
SaraVenture
New Scratcher
5 posts

How to play random sounds?

DUDE!!!!!!!! You're AWESOME!!!!!
SaraVenture
New Scratcher
5 posts

How to play random sounds?

So how do I define the list to include those sounds?
drmcw
Scratcher
1000+ posts

How to play random sounds?

Go to data and press the make a list button. When you've created a list then just fill it with the names of all the sounds you have. If you call the sounds “nom1” “nom2” “nom3” etc then you could do without the list and just use
playsoundjoinnompickrandom1to10untildone assumes 10 sounds, change number to fit
drmcw
Scratcher
1000+ posts

How to play random sounds?

See you've created a couple of lists. To fill it either get the list showing in the editor and press the + button at the bottom of the list and start typing and adding to the list or script it like this
whenclickeddeleteallofnom soundsaddnom nom? starttonom soundsadd NomNomtonom sounds. . .etc

MASTER was very good

Last edited by drmcw (May 22, 2014 21:32:01)

SaraVenture
New Scratcher
5 posts

How to play random sounds?

Thank you!!
SaraVenture
New Scratcher
5 posts

How to play random sounds?

Finished! How do you like it?
SBJ1943
Scratcher
52 posts

How to play random sounds?

This is simply marvellous. In the same subject, I want to add my experience, which will benefit many scratchers.
————
I was searching for a solution to my problem, which is a bit different. I wanted to combine three sounds, a digital variable in between two recorded sounds.followed by a ‘say’ statement to the same effect. ( Of course I have recorded digits from 1-20 spoken!)
I searched and searched on Scratch WIKI and could not. Just after midnight , I got a spark and tried the following and it worked!
whenIreceivedefineSpeakSound#SayStatementDurationplaysoundSpeakplaysoundSpeakplaysoundSpeakThusIcouldcombinethreesounds,thecentralonebeingaspokenvariable.Idonotknowhowtoputactualpictureofmycode,butitworked.Thestatementwas....bCongratulations.Yougotthemall,in.....9seconds/b
SBJ1943
Scratcher
52 posts

How to play random sounds?

Sorry…I made a mistake in the blocks

whenIreceiveBingospeakspeakspeak
Really_A
Scratcher
1000+ posts

How to play random sounds?

SBJ1943 wrote:

This is simply marvellous. In the same subject, I want to add my experience, which will benefit many scratchers.
————
I was searching for a solution to my problem, which is a bit different. I wanted to combine three sounds, a digital variable in between two recorded sounds.followed by a ‘say’ statement to the same effect. ( Of course I have recorded digits from 1-20 spoken!)
I searched and searched on Scratch WIKI and could not. Just after midnight , I got a spark and tried the following and it worked!
whenIreceivedefineSpeakSound#SayStatementDurationplaysoundSpeakplaysoundSpeakplaysoundSpeakThusIcouldcombinethreesounds,thecentralonebeingaspokenvariable.Idonotknowhowtoputactualpictureofmycode,butitworked.Thestatementwas....bCongratulations.Yougotthemall,in.....9seconds/b/quoteThanksforyourinfo,butIthinktheownerisnolongerneedanyansweranymore,becausethistopicisabout2yearsold!:)
SBJ1943
Scratcher
52 posts

How to play random sounds?

whenIreceiveBingo
definescratchblocksdefinescratchblocksdefine
SBJ1943
Scratcher
52 posts

How to play random sounds?

How to post a snap shot of my code here?
Really_A
Scratcher
1000+ posts

How to play random sounds?

SBJ1943 wrote:

How to post a snap shot of my code here?
Huh? Can you please be more specific?
ScratchModelMaker
Scratcher
100+ posts

How to play random sounds?

You will need ImageShack to upload a picture.

Upload the picture into ImageShack, then copy the url of the picture.

Simply press the image button and put your link in between the squared brackets.
MCJB05
Scratcher
30 posts

How to play random sounds?

Hi! I'm just showing you my simple expertise in making random sounds.
This method works on both the offline and online editor:

playsoundpickrandom1to10

or

playsoundpickrandom1to10untildone

I am assuming you have 10 sounds.

There.

Goodbye!



Tepiglover101
Scratcher
3 posts

How to play random sounds?

playsoundjoinnompickrandom1to10untildone
name your songs nom1 or nom2 or nom 3

Last edited by Tepiglover101 (Nov. 13, 2015 01:12:43)

abperrone
Scratcher
7 posts

How to play random sounds?

Tepiglover101 wrote:

playsoundjoinnompickrandom1to10untildone
name your songs nom1 or nom2 or nom 3

this was the most elegant solution. THANK YOU!!
cwkMemelookers
Scratcher
17 posts

How to play random sounds?

whenclickedsetSong numbertopickrandom1to3ifSongnumber=1 thenplaysoundMeow ifSongnumber=2 thenplaysoundWoof ifSongnumber=3 thenplaysoundCheep
thansau_239
New Scratcher
2 posts

How to play random sounds?

Thank you. I have same problem
————————————————————
<a href="http://dulichre.org"Du lịch rẻ </a>
Du lịch rẻ

Last edited by thansau_239 (April 13, 2016 08:05:10)

Powered by DjangoBB