Musical instrument
Turn your eXperiBot into a musical instrument.

This project is compatible with all eXperiBot sets.
Task
As you probably know, your eXperiBot can play sounds. But did you also know that you can control these sounds just by moving it? Using the accelerometers in your Powerbrain, you can turn your eXperiBot into an air guitar! To do this, use the sensor readings to change the sound being played while your program is running.
Setup
All you need for this project is a Powerbrain!
Hints
Start with a loop that plays a frequency. Reduce the playback time to a small value, such as 0.1.
Replace the frequency with a variable. If you change this variable during runtime, the sound will change as well.
To use sensor values for sound playback, you must convert the value to a frequency that your eXperiBot can play. A suitable frequency range is between 50 and 7000 Hz.
To do this, use the “convert” block from the Math category.
Now insert a block into the “convert” block that outputs a sensor value. Make sure you select the correct value range for your sensor value. Otherwise an error will occur! If you want to be absolutely sure, you can use the “constrain” block from the Math category to limit the sensor values to a specific range.
You can check the eXperiBot live data to see what values each sensor is providing.
You can use as many sensor values as you like as input for the played frequency. You can also change the duration of the sound or use the concurrent block to play sounds without a time limit.
More ideas
Try changing the pitch using the function keys A (or “-”), B (or “•”), and C (or “+”).
Connect a Multisensor and let its sensor readings influence the sound generation.
Let your Powerbrain play real notes! To do this, create a list of frequencies for the notes and have your eXperiBot select elements from this list. You can find the frequencies for the individual notes in the API documentation.