Skip to content
Parallax Learn

Parallax Learn

  • Welcome
  • Tutorials
        • Tutorial Series head tag

          Tutorial Series
        • Tutorial Series

          The special, classroom-ready series pages are organized collections of tutorials for our most popular hardware and/or languages. The tutorials for each topic are conveniently accessible from a single page, shown in the order it is recommended that they be completed.
        • Robotics Series Head tag

          Robotics Series
        • Robotics Series

          • Artificial Intelligence
          • Cybersecurity: Radio Data tutorialCybersecurity
          • cyber:bot + Python
          • cyber:bot + MakeCode
          • Boe-Bot Tutorial SeriesBoe-Bot
          • Arduino Shield-Bot
          • ActivityBot with C TutorialsActivityBot + C
          • ActivityBot with BlocklyProp Tutorial SeriesActivityBot + BlocklyProp
          • Scribbler 3 Tutorial SeriesScribbler 3
        • Electronics & Programming Series Head tag

          Electronics & Programming Series
          • BS2 Board of Education Tutorial SeriesBS2 Board of Education
          • Propeller C-Language BasicsPropeller C Basics
          • FLiP Try-It Kit C Tutorial SeriesFLiP Try-It Kit + C
          • FLiP Try-It Kit BlocklyProp TutorialsFLiP Try-It Kit + BlocklyProp
          • Badge WX Tutorial SeriesBadge WX
          • Propeller BlocklyProp Basics and ProjectsPropeller BlocklyProp Basics
          • View All Tutorial Series »
        • Browse Tutorials
        • Browse Tutorials

          Individual tutorials sorted by robot or kit, and language.
        • By Robot or Kit
          • ActivityBot
          • SumoBot WX
          • Boe-Bot
          • Shield-Bot
          • cyber:bot
          • Badge WX
          • ELEV-8
          • ARLO
        • By Language
        • By Language

          • Propeller C
          • Arduino
          • BlocklyProp
          • PBASIC
          • Python
          • MakeCode
          • View All Tutorials »
  • Educators
  • Reference
  • Downloads
  • Home
  • All Courses
  • Tilt Tones with BlocklyProp

Tilt Tones with BlocklyProp

Tune your Tilt Tones

The example code is easy to modify to make personal custom mini-tunes.

Change the Tempo

In the example code, recall that a set variable block initialized beat to 500.  Later, you insert the beat into the frequency out block’s duration field.

This makes each note last for 500 ms, giving you a little time to tilt the board to a new position to select a new note before the code makes another trip through the repeat forever loop.  If you want to slow down the tempo, perhaps to practice the movements to play a tune, initialize beat to 750 or 1000.  For peppier tunes, and a coordination challenge,  try reducing beat to 250. 

  • Experiment with different beat initialization values.

Play New Notes

If you want to play different notes to make your own 4-note tunes, simply replace the four elements in the Note array with new frequencies.

To make it easier to see which tilt motion will correspond to which frequency (and which LED will light up) you can insert this debugging code into your program, just below the index = get the states...blocks. 

Here’s what the Terminal would show if you tilt your Board downward to the right.

 

Challenge Yourself

The familiar song Mary Had a Little Lamb uses only four notes: A, B, D, and G.  It also has a simple, steady beat which works well for our Tilt Tunes toy. 

B  A   G  A  B   B   B     A   A   A     B   D   D
ma-ry had a lit-tle lamb, lit-tle lamb, lit-tle lamb,

B  A   G  A  B   B   B     B     A    A    B   A   G
ma-ry had a lit-tle lamb, its fleece was white as snow

 

  • Referring to the keyboard diagram below, try modifying your program to use these four notes, then see if you can play the song.


Printer-friendly version
Play Tilt Tones with Blocks
Prev
Extra Parts for FLiP Kit
Next

DISCUSSION FORUMS | PARALLAX INC. STORE

About | Terms of Use | Feedback: learn@parallax.com | Copyright©Parallax Inc. 2024

© 2025 Parallax Learn • Built with GeneratePress