(See Also: ru interwiki)
m (Now a part of the music extension.)
Line 1: Line 1:
 
{{block
 
{{block
 
|name      = Rest for () Beats
 
|name      = Rest for () Beats
|image      = File:2.0 Rest_for_()_Beats.png
+
|image      = rest for () beats
|category  = [[Sound Blocks|Sound]]
+
|category  = [[Music Extension|Music]]
 
|type      = [[Stack Block|Stack]]
 
|type      = [[Stack Block|Stack]]
 
|default    = 0.2
 
|default    = 0.2
 
|argType    = number
 
|argType    = number
 
|added      = 1.2.1
 
|added      = 1.2.1
 +
|sb        = yes
 
}}
 
}}
The '''Rest for () Beats''' [[Blocks|block]] is a [[Sound Blocks|Sound block]] and a [[Stack Block|Stack block]]. The block pauses its [[script]] for the specified amount of beats, which can be a decimal number. To change the length of beats, the [[Change Tempo by () (block)|Change Tempo by ()]] block and the [[Set Tempo to () bpm (block)|Set Tempo to () bpm]] block can be used.
+
The '''Rest for () Beats''' [[Blocks|block]] is a [[Music Extension|music block]] and a [[Stack Block|stack block]]. The block pauses its [[script]] for the specified amount of beats, which can be a fraction. To change the length of beats, the [[Change Tempo by () (block)|Change Tempo by ()]] block and the [[Set Tempo to () bpm (block)|Set Tempo to () bpm]] block can be used.
  
 
{{note|Some musical knowledge may be needed to fully understand this article.}}
 
{{note|Some musical knowledge may be needed to fully understand this article.}}
Line 16: Line 17:
  
 
Some example uses for the '''Rest for () Beats''' block:
 
Some example uses for the '''Rest for () Beats''' block:
* Pauses in songs made with the "play [[Play Note () for () Beats (block)|note]]/[[Play Drum () for () Beats (block)|drum]]" blocks
+
 
 +
* Pauses in songs and sound effect sequences made with [[Play Note () for () Beats (block)|Play Note]] and [[Play Drum () for () Beats (block)|Play Drum]]
 +
 
 
<scratchblocks>
 
<scratchblocks>
 
play drum (8 v) for (0.25) beats
 
play drum (8 v) for (0.25) beats
 
rest for (0.2) beats
 
rest for (0.2) beats
 
</scratchblocks>
 
</scratchblocks>
* A pause in sound effects made with the [[Sound Blocks]]
+
 
 
* A music generator
 
* A music generator
  
Line 64: Line 67:
  
 
<scratchblocks>wait (((60) / (tempo)) * (number of beats)) secs</scratchblocks>
 
<scratchblocks>wait (((60) / (tempo)) * (number of beats)) secs</scratchblocks>
 +
 
However, this freezes the sprite and should be avoided in [[One Sprite One Script Project|1s1s projects]].{{fact}}
 
However, this freezes the sprite and should be avoided in [[One Sprite One Script Project|1s1s projects]].{{fact}}
  
Line 70: Line 74:
 
* [[Play Drum () for () Beats (block)|Play Drum () for () Beats]]
 
* [[Play Drum () for () Beats (block)|Play Drum () for () Beats]]
 
* [[Play Note () for () Beats (block)|Play Note () for () Beats]]
 
* [[Play Note () for () Beats (block)|Play Note () for () Beats]]
{{Sound Blocks}}
 
  
[[Category:Sound Blocks]]
+
[[Category:Music Extension]]
 
[[de:Pausiere () Schläge (Block)]]
 
[[de:Pausiere () Schläge (Block)]]
 
[[ja:() 拍休む (ブロック)]]
 
[[ja:() 拍休む (ブロック)]]
 
[[ru:Подождать () тактов]]
 
[[ru:Подождать () тактов]]

Revision as of 22:01, 26 April 2019

Rest for () Beats
rest for () beats
Category Music
Type Stack
Introduced in 1.2.1

The Rest for () Beats block is a music block and a stack block. The block pauses its script for the specified amount of beats, which can be a fraction. To change the length of beats, the Change Tempo by () block and the Set Tempo to () bpm block can be used.

Note Note: Some musical knowledge may be needed to fully understand this article.

Example Uses

As the block will pause its script with beats instead of seconds, it is widely used in music scripts where there must be pauses that fit the beat.

Some example uses for the Rest for () Beats block:

play drum (8 v) for (0.25) beats
rest for (0.2) beats
  • A music generator

Notation

Unlike sheet music, the block uses number values to determine the beats. This table shows the beat number values for the most common rests in the most common time signatures, interpreted in the most basic ways.

WholeRest.png HalfRest.png QuarterRest.png 8thRest.png 16thRest.png
TimeSig4.png 4 2 1 0.5 0.25
TimeSig8.png 8 4 2 1 0.5
TimeSig2.png 2 1 0.5 0.25 0.125

Workaround

Main article: List of Block Workarounds

This block can be replicated with the following code:

wait (((60) / (tempo)) * (number of beats)) secs

However, this freezes the sprite and should be avoided in 1s1s projects.[problematic]

See Also