Orange
Posts: 44
Joined: Tue Jan 24, 2012 6:41 am

Music on the Pibrella

Sun Apr 06, 2014 7:25 am

My wife bought 3 Pibrellas for her primary school and I'm impressed with how easy they are to use. They work really well with ScratchGPIO and the kids love programming them. I found that for playing songs through the buzzer ScratchGPIO was ok but wasn't brilliant (well it is a buzzer after all). I decided to add Pibrella support to my own scripting language and I was quite pleased with the result. The buzzer is now playing nice pure tones as you can see (hear) here:

https://plus.google.com/110265018208679 ... nVb9FeAqU2

This is my script:

Code: Select all

:main
use_addon Pibrella

# Frere Jacques
start Light Show
play_song 2 c d e c c d e c e f g,2 e f g,2
play_song 4 g a g f e,2 c,2 g a g f e,2 c,2
play_song 2 c g0 c,2 c g0 c,2

:Light Show
flash Red 1
wait 4
turn_off Red
set_brightness Amber 25
wait 1
set_brightness Amber 50
wait 1
set_brightness Amber 75
wait 1
set_brightness Amber 100
wait 1
turn_off Amber
flash Green .25
wait 4
start_wait Finale
start_wait Finale

:Finale
turn_on *
wait .5
turn_off *
wait .5
turn_on *
wait .5
turn_off *
wait .5
You can get the latest version of my script interpreter here and the readme is here.

Return to “General discussion”