This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2013-02-13 12:50:42

Blayer98
Scratcher
Registered: 2012-03-22
Posts: 100+

I need the music in my game to fade out, and not just stop instantly!

i'm talking about the VOLUME BLOCKS in the 'Sound' Category.

Please help!

HOW do i get them to WORK?


http://i50.tinypic.com/16lwmlj.png
The first Collab to have it's very own Cloud Variables! Coming Soon!

Offline

 

#2 2013-02-13 13:13:20

Snowdrift
Scratcher
Registered: 2011-06-22
Posts: 500+

Re: I need the music in my game to fade out, and not just stop instantly!

It's the same as making a picture fade out, except instead of the ghost block you use the volume one.

Offline

 

#3 2013-02-13 13:33:37

Blayer98
Scratcher
Registered: 2012-03-22
Posts: 100+

Re: I need the music in my game to fade out, and not just stop instantly!

i've tryed it in Scratch 2.0, it DOESN'T WORK.

never worked for me in 1.4 either!

i use repeat (10)
play sound [PKMUSIC v]


IT DOESN'T WORRRKKKK!!!!!!!!!!!!!


http://i50.tinypic.com/16lwmlj.png
The first Collab to have it's very own Cloud Variables! Coming Soon!

Offline

 

#4 2013-02-13 13:58:21

Snowdrift
Scratcher
Registered: 2011-06-22
Posts: 500+

Re: I need the music in my game to fade out, and not just stop instantly!

Blayer98 wrote:

i've tryed it in Scratch 2.0, it DOESN'T WORK.

never worked for me in 1.4 either!

i use repeat (10)
play sound [PKMUSIC v]


IT DOESN'T WORRRKKKK!!!!!!!!!!!!!

Do
Repeat 100
Change Volume by -1

Offline

 

#5 2013-02-13 14:00:09

Kileymeister_test
Scratcher
Registered: 2010-01-31
Posts: 100+

Re: I need the music in my game to fade out, and not just stop instantly!

Instead of using the play block, you should be using the volume block, like so:
http://i46.tinypic.com/qyyds2.gif
The script you are currently trying to use just plays the same sound file 10 times, restarting it once every frame.

Last edited by Kileymeister_test (2013-02-13 14:01:18)


Kileymeister's test account.  I upload engines and demos and stuff for public use.
Currently Working on: Grapple Arms!

Offline

 

#6 2013-02-13 14:10:28

dechan
Scratcher
Registered: 2012-12-20
Posts: 69

Re: I need the music in my game to fade out, and not just stop instantly!

I'm using the "Techno" sound loop which comes with Scratch, it's an 8 sec. loop
Thankfully Scratch tells us how long a sound is when we import them.

when i receive [play_music_and_fade v]
set [music_dur_in_sec v] to (8) // number of seconds in the music loop
set [reps_to_reduce_volume_by v] to (20) // how gradually do you want to fade the final music?
set volume to (100) %
repeat (2) // 16 seconds of loop
play sound [Techno v] until done
end
play sound [Techno v] // final music
repeat (reps_to_reduce_volume_by)
change volume by <(-1) * <(100) /(reps_to_reduce_volume_by)>>
wait <(music_dur_in_sec) / (reps_to_reduce_volume_by)> secs
end
end
set volume to (0) %

Last edited by dechan (2013-02-13 14:14:27)

Offline

 

#7 2013-04-12 06:52:26

WIlliam7777
Scratcher
Registered: 2012-07-21
Posts: 41

Re: I need the music in my game to fade out, and not just stop instantly!

t h e bloop

Offline

 

#8 2013-04-12 08:34:42

cobraguy
Scratcher
Registered: 2009-11-18
Posts: 100+

Re: I need the music in my game to fade out, and not just stop instantly!

You can use a repeat block to fade in and out.

set volume to [100]%
repeat [100]
change volume by [-1]
end
stop all sounds
You can change the volume by minus whatever you want, you could also have a
wait [0.1] secs
block. Just change the amount of seconds and you can have a fast or slow fade out or fade in.

Last edited by cobraguy (2013-04-12 08:35:40)


Fruit Fighter, when your food eats you.
http://i.imgur.com/8CR6Lnj.png?1

Offline

 

Board footer