Welcome to the Parallax Discussion Forums, sign-up to participate.

# Set tempo for "Play a" block

Posts: 651
Is there a way to assign a beats per minute to duration values in a set of "Play a" blocks?

• Posts: 6,865
Are you using the S3 or Activity Board block type?
• Posts: 651
Scribbler S3
• Posts: 4,138
edited 2017-10-30 - 02:57:27
@John,

Could you use the play tone block and use the duration to achieve the same thing? For instance, at 120 BPM, each beat would be 500 ms (1/2 second)? This could make a very interesting lesson in math and music. The block could be used for rests (or with a wait block).

See this great resource at wiki - https://en.wikipedia.org/wiki/Tempo
• Posts: 4,138
edited 2017-10-30 - 02:59:34
If you prefer the configuration of the play note block look and configuration - You could change the play tone block to an inline configuration as shown below. Both blocks are shown for comparison.

• Posts: 651
Sure, no problem to achieve goal with play tones block. I use it for a student extension to investigate both duration and the physics of frequency.

But for play block, having a duration doesn't have a meaning in music without a tempo (or as the DJ's say: beats per minute). I don't know if it would be easy to have a block that sets tempo. I think there might be one in Scratch.
• Posts: 4,138
I know that one was being experimented with at one time...

Here is something fun that could be Saved As to start a new bit of code or appended to code.

http://blockly.parallax.com/blockly/editor/blocklyc.jsp?project=15299#
• Posts: 651
Thanks, Whit.
Sometimes brute force is a fine solution.
• Posts: 4,138
I know that one was being experimented with at one time...

BlocklyProp Code for S3 - BPM Set and Volume Set for S3 Play Tone Block - http://blockly.parallax.com/blockly/editor/blocklyc.jsp?project=15299