We’re all familiar with those musical greeting cards. Give the Hallmark store $10, and you have a card with a microcontroller inside that plays one of several songs available. [Jarv] was playing around with translating MIDI tracks to square wave songs with an Arduino earlier, so he decided to see how cheaply he could reproduce these musical cards. The resulting build allows him to put any song he wants in his card and costs less than the Hallmark offering.
The circuit is extremely minimal – just an ATtiny 85, a battery holder, and two piezo speakers for two-voice harmony. After soldering up the battery and speakers, [Jarv] needed a way to get music on his chip. For this, he used MuseScore, a music notation program that allows [Jarv] to merge multiple voices together.
Once the sheet music was cleaned up, [Jarv] used his XML2H Python script that takes MIDI data and spits out frequencies and delays. In the end, [Jarv] spent less than $5 on his greeting card – almost cheap enough to start thinking about musical throwies to complement the batteries, LEDs and magnets on our window flashing.
Check out the video after the break to hear [Jarv]’s circuit play the theme from Toy Story.
[youtube=http://www.youtube.com/watch?feature=player_embedded&v=gntKQZFomi8&w=470]
Front page post with minimal text.
Also: ATTiny hacks ftw
copesthetic!
Copacetic? Yes very much so.
On/off switch?
take the battery out.
Nice, but why the two speakers? Just connecting the 2 PWM-outputs together with a couple of 100 ohm resistors oughtta give the same result, with just one speaker.
Extra laziness :) played around with some resistor values but in the end decided it would be easier to use two speakers. http://jarv.org/2011/11/arduino-music-from-a-midi-file/ has an example using the arduino, three timers and hooking up the arduino to a single speaker.
Stereo!
Lame cards are in mono, high end cards are in stereo!
I am LOVING the dual piezo harmony!! NICE
sounds like the music is out of sync or something
It sort of sounds like it;s taking notes of different lengths and playing them all back with the same length.
I also have some examples of converting midi to audio tones here using the three timers of the Arduino, with the outputs mixed on a single speaker – http://jarv.org/2011/11/arduino-music-from-a-midi-file/
This could be used to hack musical cards ala the Barbie Liberation Front
http://sniggle.net/barbie.php
What could be better than a “Congratulations on your wedding card” that played Highway to Hell!
I think you don’t even need resistors to make 2-voice polyphony – just hook up negative piezo terminal to one uC pin and positive to another.
Excluding DC (which isn’t conducted by piezo) 2- voice polyphony signal has 3 levels (0, +, -) – checked this in Audacity. Plus, you can make two signals in antiphase for louder monophonic sound (not sure, but maybe even louder than 2 independent speakers)
Cool tip, thanks for sharing.
Funnily I worked the other way round. My local poundshop sells a thingammy which consists of half a dozenb or so small candles, a mini roman candle and one of these (playing happy birthday). You light it in the centre and you get a small table-top fireworks show for about thirty seconds. It’s the cheapest way I know to get piezos inside a nice little plastic housing if you want to make e.g. you own heartbeat sensor.
Very nice. When playing the same tone in both speakers I hear a slight beating between the tones, as if they were slightly out of tune. Is it done on purpose to give sound more warmth or it’s due to some speed limitation of the uC used?
Yeah you aren’t hearing things though my ear may be less sensitive to it. dealing with the limitations of a chip that’s not designed for this sort of thing :/ It has to do with choosing two different pre-scalers (a scaling factor for the timer) for the two parts.
http://jarv.org/files/midi-avr/tones_attiny.html
one part is using “256” the other is using “64”, It’s a tradeoff between precise pitch between note intervals and having a larger dynamic range. If I brought the two parts closer together in range then it wouldn’t matter as much.
You can order chips from Integral in Belarus custom-made with any tune you want. They sound pretty much like this.
how do I find these chips? I really want to make a card for my girlfriend but I’m not really very technologically inclined and I can’t really follow what everyone is saying here. I would pay anywhere from 15-20 dollars for a card tho…
I sure would love to find a piezo speaker in any source listed over the past 4 years. I recently looked inside the fold of all the Hallmark talkers and found mini-paper speakers and other mini- magneto speakers and NO piezo speakers. I haven’t found the cheap alarms for traveler protection that some DIYers…
But enough about me ;) Can anyone tell of a reliable source for piezo speakers that won’t cost an arm and a leg? Even alibaba shows about 30% of its pictured stock under the term “piezo” actually magenetic mini speakers and most of any listed item requires 1000 piece orders.
Hallmark and American Greetings (Innovation) are NOT piezo talkers…
TIA
I actually own a company that sells the sound modules (or music chips / voice chips) used to make your own greeting cards. It’s pretty simple to record or program your own modules. I even made some videos showing how this is done. Here are some links showing how this is done, how to make your own musical greeting cards, and how to purchase. We even put lcd video screens as well as webkeys and NFC tags (near field communication, rfid) in greeting cards, brochures, and invitations and sales folders as well.
http://www.bigdawgsgreetings.com
http://stores.ebay.com/bigdawgsgreetings
DIY musical sound modules and voice chips, blank recordable greeting cards, usb programmamble sound, music box (light sensor), user programmable motion sensor sound boxes. Mainly for education, crafts, scrapbooking, and hobbies.
http://www.bigdawgspromo.com
Prerecorded sound modules, and video lcd screens (with a sound or video you provide) and custom printed cards and invitations. Mainly for events (personal or business), and marketing purposes.
Please share your thoughts as we are trying to expand our business.
– Edgar Davin
Hi Ed,
I just received my order of a half dozen of your light activated sound modules and they work great and it’s 2016 so I guess BigDawgs is going strong, nice work!
Very easy to set up with some .mp3’s and have been doing some fun experimentation for a product we are working on.
We are working on an idea and are looking for ways to squeeze as much oomph (volume) out of these modules as possible. Do you offer a higher spec speaker option if we can order a large enough quantity?
If you have any tricks to get these louder do let me know. Maybe a large wedge of sticky foam with a recess that creates a bit of a speaker cabinet. They seem to be a little louder on a sheet of card and when I peel the speaker off the double sided tape ring and box it from behind it seems a bit louder.
I am thinking we can get an audio engineer to create an eq filter to adjust our music to get the most out of speaker could also help and clean up sound from any distortions.
If there is a sound guy at BigDawg that can give me a few tips I’d be very appreciative.
Cheers!
Hi davemodowest,
First, the best way is to make sure your sound is amplified enough first. If you get an audio engineer they can you “high limiting” and/or “compressing” techniques. The sound modules do not play well frequencies above 16KHz or below 100Hz, so you can reduce these in an EQ.
Yes experimenting with the position of speaker and creating as much as an acoustic chamber will increase output as well. If you cup your hand behind the speaker you can hear the dramatic difference this makes.
Larger speakers are also available, but you will have to contact our corporate sales team here: http://bigdawgspromo.com/contact
Cheers!
— Edgar Davin
Specializing in SOUND, LED, LCD and NFC devices for gifting, crafts, hobby, scrapbooking, and presentation projects.
I want to make my own invitations cards for my wedding do u have ideas where to get the sound module very cheap ?
I own a company that designs and manufactures musical greeting cards and sound modules. If you want a fully professionally printed invitation with music, we can make a min of 50pcs for $7.10/pc, 100pcs for $6.42/pc. This are the same professional quality (sound and print) as musical greeting cards sold in retail store (like Hallmark, Carlton Cards, etc). You can view more here: http://bigdawgspromo.com/cards-mailers-a-brochures.html
Or if you like you can just order the modules. We can make professional sounding ones with and MP3 file or WAV file you send us. 50pcs will cost you $3.31 and 100pcs – $3.25, with a 30-50sec sound.
Or you can buy modules you can record yourself here: https://bigdawgsgreetings.com/product-category/sound-modules/slider-switch-modules-for-greeting-cards/
Cheers!
— Edgar Davin
Specializing in SOUND, LED, LCD and NFC devices for gifting, crafts, hobby, scrapbooking, and presentation projects.