Veggieman001 (talk | contribs) m |
Dominic305 (talk | contribs) m (sb) |
||
(15 intermediate revisions by 10 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{about|the block|more information about the value this block reports|Volume (value)}} | ||
{{block | {{block | ||
| name = Volume | | name = Volume | ||
− | | image = | + | | image = volume |
| category = [[Sound Blocks|Sound]] | | category = [[Sound Blocks|Sound]] | ||
| type = [[Reporter Block|Reporter]] | | type = [[Reporter Block|Reporter]] | ||
| added = 1.2 | | added = 1.2 | ||
+ | | sb = yes | ||
}} | }} | ||
− | The '''Volume''' [[block]] is a [[Sound Blocks|Sound block]] and a [[Reporter Block|Reporter block]]. The block holds a [[Sprite|sprite's]] or the [[Stage|Stage's]] [[Volume (value)|volume]]. This block can be displayed as a [[Stage Monitor|Stage monitor]] | + | The '''Volume''' [[Blocks|block]] is a [[Sound Blocks|Sound block]] and a [[Reporter Block|Reporter block]]. The block holds a [[Sprite|sprite's]] or the [[Stage|Stage's]] [[Volume (value)|volume]]. This block can be displayed as a [[Stage Monitor|Stage monitor]]. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==Example Uses== | ==Example Uses== | ||
− | As this block holds how loud | + | As this block holds how loud [[sound]]s, drums, and notes will be played, it is useful in music projects where they must sense how loud an instrument has been played. |
Some common uses for the Volume block: | Some common uses for the Volume block: | ||
− | *Volume controls | + | * Volume controls |
− | <scratchblocks>when | + | <scratchblocks>when this sprite clicked |
repeat until <not <mouse down?>> | repeat until <not <mouse down?>> | ||
point towards [mouse-pointer v] | point towards [mouse-pointer v] | ||
− | if <(direction) < [0]> | + | if <(direction) < [0]> then |
point in direction (0 v) | point in direction (0 v) | ||
else | else | ||
− | if <(direction) > [100]> | + | if <(direction) > [100]> then |
point in direction (100 v) | point in direction (100 v) | ||
else | else | ||
Line 36: | Line 32: | ||
say (join (volume) [%]) for (2) secs</scratchblocks> | say (join (volume) [%]) for (2) secs</scratchblocks> | ||
− | *Loops that must stop once the volume is at a certain amount | + | * Loops that must stop once the volume is at a certain amount |
<scratchblocks>repeat until <(volume) = [0]> | <scratchblocks>repeat until <(volume) = [0]> | ||
Line 42: | Line 38: | ||
end</scratchblocks> | end</scratchblocks> | ||
− | *Sensing how loud something is being played | + | * Sensing how loud something is being played |
<scratchblocks>when gf clicked | <scratchblocks>when gf clicked | ||
forever | forever | ||
say (volume)</scratchblocks> | say (volume)</scratchblocks> | ||
+ | |||
+ | ==Workaround== | ||
+ | {{main|List of Block Workarounds}} | ||
+ | This block can be simply replicated with the following code: | ||
+ | |||
+ | <scratchblocks>([volume v] of [sprite v])</scratchblocks> | ||
+ | where "sprite" the name of the wanted sprite. | ||
==See Also== | ==See Also== | ||
− | *[[Change Volume by () (block)|Change Volume by ()]] | + | * [[Change Volume by () (block)|Change Volume by ()]] |
− | *[[Set Volume to () % (block)|Set Volume to () %]] | + | * [[Set Volume to () % (block)|Set Volume to () %]] |
− | *[[Volume (value)]] | + | * [[Volume (value)]] |
{{Sound Blocks}} | {{Sound Blocks}} | ||
[[Category:Sound Blocks]] | [[Category:Sound Blocks]] | ||
+ | [[de:Lautstärke (Klang Block)]] | ||
+ | [[ja:音量 (音ブロック)]] | ||
+ | [[ru:Громкость]][[hu:Hangerő (blokk)]] |
Latest revision as of 13:47, 10 December 2019
- This article is about the block. For more information about the value this block reports, see Volume (value).
Volume | |
volume | |
Category | Sound |
Type | Reporter |
Introduced in | 1.2 |
The Volume block is a Sound block and a Reporter block. The block holds a sprite's or the Stage's volume. This block can be displayed as a Stage monitor.
Example Uses
As this block holds how loud sounds, drums, and notes will be played, it is useful in music projects where they must sense how loud an instrument has been played.
Some common uses for the Volume block:
- Volume controls
when this sprite clicked repeat until <not <mouse down?>> point towards [mouse-pointer v] if <(direction) < [0]> then point in direction (0 v) else if <(direction) > [100]> then point in direction (100 v) else set volume to (direction)% end end say (join (volume) [%]) end say (join (volume) [%]) for (2) secs
- Loops that must stop once the volume is at a certain amount
repeat until <(volume) = [0]> change volume by (-10) end
- Sensing how loud something is being played
when gf clicked forever say (volume)
Workaround
- Main article: List of Block Workarounds
This block can be simply replicated with the following code:
([volume v] of [sprite v])
where "sprite" the name of the wanted sprite.