Two weeks of Pibrella

pibrella-pcb-layoutSince my Pibrella arrived a couple of weeks ago i’ve been driving SWMBO & my posse of cats nuts by making it blink & squawk at all hours of the day and night while trying to get reasonable sound quality out of the piezo buzzer a la Camputers Lynx. There have been lots of “WHAT! are you doing?”, “Are you writing a program?”, “What’s that sound?”, “do you HAVE to do that now?” comments and cats suddenly appearing on my desk and sniffing and batting at the Pibrella. The Raspberry Pi+Pibrella has been knocked down more often than Chumbawumba. I’m still waiting on a solenoid and if it doesn’t arrive soon i’ll take a run, ok a jog, ok a slow stroll up the road to Radioshack & see what they have especially as now I have music sussed on the Pibrella I have the silly idea of using the wiringPi softTone function to have 5 piezo buzzers on a Pibrella play the same tune as a sort of 5 voice choir or performing a round.

Although I still haven’t played with the I/O on the Pibrella nothing in the last couple of weeks has changed my mind from the opinion that everyone who has a Raspberry Pi should have a Pibrella as well as it can be used for so many different things. So far i’ve used it as a rudimentary timer, a “clock”, a disco karaoke machine, a cat annoyer, a wife annoyer, a temperature indicator, an overclock indicator, a morse key and those are just the things i’m willing to admit to :)

I do have a few gripes but one of which I can’t really in all honesty blame Pimoroni or Cyntech for but I will 😀 My currently single Model A when I finally unboxed it after 8 months seems to have DOA USB. It looks like no power is going to the power pins in the USB slot :( and that was the Raspberry Pi the Pibrella was destined to be married to as it fits nicely on top of a Model A Pibow case & my plans for the Pibrella don’t require anything but a wifi dongle or a CC1000 in USB formfactor It’s all their fault :)

The second gripe IS Pimoroni’s fault and I hope their secret labs in darkest Sheffield are working on it. A Raspberry Pi with a Pibrella attached won’t fit neatly and safely in any case currently available, at least none I currently own so they need to do a few batches of Pibrella compatible layers. Layer 7, possibly 6 too & a nice clear top layer with holes for the leds, buzzer, I/O & button so that everything look pretty and fits snuggly

My final gripe is that the button is too clicky. i’d prefer something without so much feedback & volume but i’m sure much research was done before selecting the button they used so it might just be me that really doesn’t like the current one.

Just in case anyone else would like to take my efforts at playing music in a 80s home computer style & improve them i’m posting them below.



import pibrella, time, sys

#Note frequency for 8th Octave
notes  = { "C":4146, "C#":4435, "Db":4435, "D":4699, "D#":4978, "Eb":4978, "E":5274,
           "F":5588, "F#":5920, "Gb":5920, "G":6272, "G#":6645, "Ab":6645, "A":7040,
           "A#":7459, "Bb":7459, "B":7902, "R":0, "Q":0 }

def PlayMusic(tune):
  for i in range(0,(len(tune)-4),4):
    if note != "Q":
      frequency = notes[note] / octave
      delay = 1000 / duration
      if dots == 1:
        delay = delay * 3/2
      if note == "R":


#PlayMusic takes an "array? list?" that contains a bunch of comma separated
# "note name",octave,duration,dotted e.g.
# "F",4,4,0,"G",3,2,1,.....

Some music to use with the above program.

"A#",2,4,0,"A#",2,4,0,"R",2,8,0,"F",3,4,0,"F",3,4,0,"R",2,8,0,"D#",3,8,0,"R",2,8,0,"D",3,8,0,"R                                       ",2,8,0,"C",3,8,0,"R",2,8,0,"A#",3,4,0,"A#",3,4,0,"R",3,8,0,"F",3,4,0,"R",2,8,0,"D#",3,8,0,"R",                                       2,8,0,"D",3,8,0,"R",2,8,0,"C",3,8,0,"R",2,8,0,"A#",3,4,0,"A#",3,4,0,"R",2,8,0,"F",3,4,0,"R",2,8                                       ,0,"D#",3,8,0,"R",2,8,0,"D",3,8,0,"R",2,8,0,"D#",3,8,0,"R",3,8,0,"C",3,4,0,"C",3,4,0,"Q",0,0,0







I also did the obvious thing & took the above program & turned it into a simple keyboard/organ :)

import pibrella, time, sys, tty, termios

notes  = { "A":4146, "Q":4435, "Z":4435, "S":4699, "W":4978, "X":4978, "D":5274,
           "E":5588, "C":5920, "F":5920, "R":6272, "V":6645, "G":6645, "T":7040,
           "B":7459, "H":7459, "Y":7902 }

#notes  = { "C":4146, "C#":4435, "Db":4435, "D":4699, "D#":4978, "Eb":4978, "E":5274,
#           "F":5588, "F#":5920, "Gb":5920, "G":6272, "G#":6645, "Ab":6645, "A":7040,
#           "A#":7459, "Bb":7459, "B":7902 }

def PlayNote(frequency,octave):
    if frequency >=4146 and frequency <= 4978:     elif frequency >= 5274 and frequency <=6645:        pibrella.light.amber.on()     else:     frequency = frequency / octave fd = sys.stdin.fileno() old_settings = termios.tcgetattr(fd) tty.setraw(sys.stdin.fileno()) print "@ukscone's wonderful PiBrOrgan\r" octave=4 while 1:     ch =     if ch=='\r':         break     elif ch==' ':         pibrella.buzzer.stop()     elif ch >= '1' and ch <= '8':
    elif ch.upper() in notes:

termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)

They really aren’t that good but hopefully they’ll be inspiration for someone to do better.


Leave a Reply

Your email address will not be published. Required fields are marked * © 2014 Frontier Theme