The makey-makey isn't going to arrive until next month, but I've created the kiosk style setup for it on the pi already.
Hopefully when it arrives I'll be able to plug it in and go!
Starting from a base install of 2012-07-15-wheezy-raspian, logged in as 'pi':
$ sudo apt-get install gitEdit /etc/inittab:
$ cd /home/pi
$ git clone https://github.com/dalethatcher/piboard.git
$ cd /home/pi
$ git clone https://github.com/dalethatcher/piboard.git
$ sudo nano /etc/inittabMake sure two is the default runlevel:
# The default runlevel.Then replace the line:
1:2345:respawn:/sbin/getty --noclear 38400 tty1with:
1:2345:respawn:/sbin/getty -a pi -l /home/pi/piboard/run.sh 38400 tty1Reboot and verify that, after start up, the program is running on the first screen.
wheee thanks for this! i'm so excited for my makeymakey to arrive...
Cool! Totally got this working. Added python code to include the the pin out inputs on the MM and loaded up a bunch of spooky sound effects.
Plugged the MM directly into the Raspberry Pi (no mouse plugged in) and was able to trigger sound effects to my hearts content. Nice, too, because you can play more than one at a time and layer them.
I was worried that the Pi might not be able to power the MM and I'd have to add a powered USB hub, but it worked fine.
Outputting audio via the phono plug on the Pi to a PA system.
This is going to make a nice interactive Halloween display!
@CruzMark Glad it's working for you. You actually beat me to trying it! :)
hello, i'm a total noob in phyton, how do i link more sounds to other keys (like 'a' 'b' 'c') I understand the structure of the code. but when i try to add a new event i have no idea, how to define the new key.
elif event == curses.KEY_a: #for key 'a' didn't work
thy in advance
Look at the bit of code for the 'q' key and use that syntax instead of curses.
Hope that helps.
Sorry I was so brief last night. here you go:
elif event == ord('a'):
@CruzMark thanks for fielding the question!
Hey @Dale and @CruzMark,
I just got this working, but I'm having trouble with the sound quality from the 3.5mm jack. There's a low-level static constantly, and little blips here and there when the processor is working. Are you guys having this issue?
Thank you CruzMark, it works actually! Hurrei! ;>
@djcutlet I've not had problems with the sound from my PI. Maybe try a different USB power source?
I've also not had sound problems from the Pi. There are folks at the Pi Forums reporting sound issues, though.
@CruzMark really nice video!
I'm struggling to get mine to run, all the steps went ok but it doesn't run. I have tried running it from idle but it says pygame doesn't exist, any ideas?
@Goat which distribution are you running?
Many thanks for your post, this is my first project on raspberry
for information, you can add :
just before pygame.init()
to speed the action, otherwise, the play start with 2 seconds of delay.
@KKnar Interesting, I didn't have a problem with delays last time I tried, maybe something has been updated recently that breaks the code?
I'm not getting any sound from the program, but I can make sound work from aplay for the same '.wav' files. The board.py script runs fine, responds to keyboard inputs, acts like it's playing sound files but nothing happens. I'm running Wheezy Raspian.
Okay, not sure why this fixes it, but adding the following line before the init in 'board.py' makes it work.
pygame.mixer.pre_init(frequency=44100, size=-16, channels=2, buffer=256)
When I first added the line, the frequency was set to 22050, and I noticed that aplay was running at the higher rate. So I changed it and bingo!
Thanks for the blog.
@jaycuestu thanks for the tip and glad you got it working.
Thanks for the explanations.
Yet, it I can launch the soundboard from the terminal, It doesn't launch automatically despite the changes to the inittab file...
1:2345:respawn:/sbin/getty -a pi -l /home/pi/piboard/run.sh 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
4:23:respawn:/sbin/getty 38400 tty4
5:23:respawn:/sbin/getty 38400 tty5
6:23:respawn:/sbin/getty 38400 tty6
@Germain I've just tested with that change in my inittab and it still works ok for me with the 2012-12-16-wheezy-raspbian.img. I've uploaded my working inittab to github. If you clone again please compare your file and see if there are any differences. The '-l' may be catching you out? (that's a lower case 'L')
Thanks Dave, this is now working!
Thanks for this tutorial. I just got my raspberry pi in the mail and formatted my SD chip but I cant figure out how to use this code. Can anyone give me some direction? Do I plug the code in the terminal?
also, so far I have my makey makey hooked up to garare band but I want to be able to make my sounds portable. I was wondering if someone could explain how to use this code and put my sounds on the the rasberry?
@Mallory Moyer The lines that begin with a '$' are meant to be typed in at a command prompt. The other sections are some configuration files that need to be edited. It sounds like you don't have much unix experience so I'd suggest trying to find a friend that has who can help you. O'Reilly have a book that looks like it would get you started as well: http://shop.oreilly.com/product/0636920023371.do.
You'll need to convert any sounds that you want to play into WAV files. I expect you'll need to create a project in Garage Band and then export it as WAV.
Thanks so for responding. Well it's true that I know very little about physical computing but so far I have been able to re-code the makey makey and program the SD chip and get the rasberry to work so i'm feeling ok with tackling this. Also I unfortunately have no friends that know how to do this. So i'm going to try and get it to work. Im also familiar with html if that helps. And my project is due in 2 weeks and I am dependent on this working :)
I entered this piece first:
sudo apt-get install git
and it worked
Then I entered this:
it says 404 NOT FOUND failed to fetch address
Do you know what maybe I did wrong?
oh wait im sorry. I enter in the first bit of code and it works. Than it asks me if i want to continue and use 306kb and I enter the letter Y. Then I get the error.
I have a 16GB chip and the program says it only using 13.8MB. So I guess its not connecting to the internet to fetch the files it needs...
I figured out how to get passed the error. I followed this great tutorial:
Now its installing :D
I also downloaded the book too so i'll start reading up. Thanks Dale
Hi, I am just trying to get your program but think the gitup adress is wrong now.
I am trying to change the sounds but I only hear a clicking sound the sound files are also wav but bigger. What can I do?
hi there, i managed to get it all working ok, now just trying to figure out how to connect a video file to each sound. so instead of just being able to produce audio it plays a video on the screen at the same time? Any Ideas
No idea on video sorry.
Hi I just got this working, great. How do I get other sounds to replace the left right words?
@ChrisPruski You can add more WAV files if they're in a compatible format (16bit, mono 44100Hz works possibly others). Then you can edit the program in board.py to add them.
Thank you very much for this program. I have a question:
Is there any way to make the keyboard buttons act like clicks instead of press and hold. In other words, can I stop the keyboard from repeating commands if I press and hold a key down? If I press any of the arrow keys I want a sound to play only once, even if I hold the key down, and when i release the key and touch it again I wan´t it to play the sound once more and so forth. I would be really greatful for a reply.
@Johannes The easiest way is probably to just turn off key repeat. Have a look here: http://www.tutorialspoint.com/unix_commands/setterm.htm.
I've not tried but it should work.
i cant get the 1.234 part to save. how do i do that?
@Alexa The "^X" at the bottom of the screen means you have to press Ctrl-X.
Post a Comment