Introduction: Tic Tac Tunes - Now With Tic Tac Beat Box


Micro-organ and drum-kit in a Tic Tac box


This tiny box will give you hours of fun composing your own tunes. You can vary the tune tempo and switch between a pentatonic and blues scale as well as producing a variety of percussion sounds.
Load up a different program and it will compose its own percussion rhythms(Tic Tac Beat Box) or play with half a dozen different musical scales (Tic Tac Scales). Another cool feature is no power switch - It will hibernate when it's not being used.

There are great musicians around . . . and then there's me with no musical talent at all, but even I can get some great sounding tunes out of this. Watch the video and have a listen to the MP3 files to get an idea of what this little marvel can do.


UPDATE - Two new programs added - Tic Tac Scales and Tic Tac Beat Box - See step 6
Couple more sound files added (better quality)
Modification for right-handed version added to step 4.



Step 1: Parts and Tools Required


As well as standard workbench tools and soldering equipment, you will need :-

1 x PicAxe 08M or 08M2 microcontroller chip - see below
2 x 10K resistors - all are 1/4 or 1/8 W
1 x 330R resistor
1 x 22K resistor
1 x 560K resistor
1 x red LED
1 x 10K linear dual gang slide potentiometer (60mm).
2 x 1N4148 or similar diodes. Just about any small diode will do
1 x 0.1 uF capacitor (10V or more)
1 x 28mm x 4mm piezo sounder. This MUST be a low profile type or it won't fit
1 x PX28A 6V keyfob battery (4LR44 PX28A A544 L1325 equivalents)
1 x stereo 3.5mm jack socket
1 x jack plug for probe. This can be 2.5 or 3.5mm, mono or stereo
1 x stripboard 22 x 12 holes
1 x spring from a retractable pen
1 packet of TicTacs. Your choice of flavour

You'll also need a few bits of link wire and something to decorate it. I used the old Blue Peter favourite - sticky back plastic.

If you need to brush up on your soldering technique, there's an excellent guide HERE.

Most of my parts came from Maplin (UK), but Mouser or your friendly local on-line electronics store will have these in other parts of the globe. All the parts (including Tic Tacs and battery) shouldn't come to more that 10 pounds (16 dollars), but that may vary depending on where you are, and doesn't include p+p, or the programming lead (see below).

I've used a PicAxe 08M microcontroller which comes as a blank chip and needs to be programmed. To do this, you will need a programming lead and the free programming editor software. Both the PicAxe chip and the lead are available from Tech Suppliesin the UK or see HERE for other countries.  The 08m has been superseded by the 08m2 - Either will work.
Once you have the lead, you only need a PicAxe, two resistors and whatever sensors and output devices you choose to have a full PicAxe development kit which can program any of the PicAxe range, so you can design your own projects. I have an Instructable planned which will get you well on the way.

Step 2: Making the Circuit Board


Take the 22 x 12 stripboard, mark and cut as shown. To cut stripboard, score it deeply with a craft knife (using a ruler) on both sides. Then use a pair of pliers to very gently flex it. The board should weaken and break. Later on I accidentally broke off the thin leg so substituted a brass pin and used this to connect the -ve battery terminal.

This layout developed as I built it, so look at the front and back photos to get the component and cut track locations. A spot face cutter is the best tool, but failing that, use a handheld 5mm (1/4") drill bit or a craft knife. Make sure no thin bridges of track are left.

Put in the programming socket and links first, then the resistors and finally the diodes and IC. Normally I'd use an IC socket, but there's no room for such luxuries here - The sounder wouldn't fit! Trim off anything sticking out the back of the board to reduce height. I did say this was tight!

Because we're not using an I.C socket be very careful when soldering the chip. Solder each pin for the shortest possible time to get a good joint, and let the chip cool down between pins.

For the piezo mounting posts I used brass pins from a wire-wrap IC socket, but any stiff solderable wire would do. Use two pieces (approx 8mm) soldered into the board for the posts the piezo sounder will sit on. Once soldered, bulk them out a bit with heat-shrink. Cut 2 lengths from the biro spring so that when you sit the sounder on the posts and slide the PCB into the box, the sounder is sprung against the top.

I've used the 'repair' brass wire to connect another stiff wire to and solder to the -ve of the battery. This holds the battery reasonably firmly in place. The terminals are easy to solder to, but do it quickly so as not to overheat the battery. Leave the wire from the positive terminal unconnected at the moment, until we're ready to put the whole thing together.

Step 3: Building the 'Keyboard'.


For the keyboard I've used a 10K LINEAR slide dual gang potentiometer. These are the type of thing you'd see on a mixer desk, only smaller. It works in the same way as a normal pot, but in a straight line. Dual gang means there are two of them in the unit (for stereo signals). Linear means the resistance increases evenly across the length.

Firstly, bend up the eight lugs and remove the resistive element, then look closely at the third picture and notice the diagonal lines on the element. This is where the resistive part starts and will be significant later.

Cut off the six legs, and very carefully cut and grind away the board up to the holes as in the sixth picture. Grind away the through-holes on the back a bit and roughen up the back as we will be gluing this later. Careful here - these things aren't all that rugged and the track is easily scratched.

Fit a link across the holes at one end and thin wires from the two at the other end as in the eighth picture. In the picture, the yellow wire will go to the +ve, the blue to the -ve. Build up a blob of solder on the +ve terminal. This will be the contact for controlling the tempo.

For the probe I'm using just the top pin of a 3.5mm jack plug. Stereo or mono, or 2.5mm would be fine. Use good flexible wire for connecting this. Solder a single wire to the centre terminal and ideally add some heatshrink as strain relief.

Step 4: Putting It All Together


To position the sound-hole, put the springs on the posts and put the sounder on top. Gently press down and slide the whole assembly into the box then put the lid on. Mark the position of the sounder hole and then remove the circuit and drill a small hole there. A hot soldering iron is great for tidying the edges up. While you're at it, make a hole in the lid of the tic tac box to let the probe lead through. Also make another hole near the base of the box to allow the wires from the keyboard through.

Feed the probe and keyboard wires through into the box and cut these as short as you safely can then solder them to the board. Connect the wire from the battery +ve terminal. The circuit is now live!

Put the sounder in place and feed everything in for the last time. Use a hooked piece of stiff wire to pull the keyboard wires through so they don't foul the battery placement. Take your time over this step.

Impact adhesive is about the only thing which will stick the pot base to the plastic box, so give them a thin coat and leave to dry. After 5 minutes or so, carefully stick it down.

I'm left handed and have made this to suit a left-handed person. For the right-handed version, stick the resistor strip lower down on the panel and turn the unit around when you're playing it.

The insulating tape is important. It has to go around the box and cross the tracks exactly on the diagonal stripe mentioned earlier. This sets the end-points for the keyboard.

Trim away the tape around the solder blob on the keyboard. This is the control button which turns it on, and sets the tempo and scale.

Decorate it in a style of your choosing and clear the sound-hole with your soldering iron tip. I went for the purple holographic sticky vinyl to give a futuristic look but with a retro purple seventies vibe (and because the shop was selling it cheap).

Step 5: Circuit Diagram


As space is at a premium here, I'm using a small 6V battery and dropping the voltage down by 1.2V to 4.8V with the diodes D1 and D2. The PicAxe chip is happy up to 5V so this is fine.

R1 and R2 are required to allow this to be programmed in-circuit and to re-program I plug in the USB / serial programming lead to the 3.5mm socket under the box lid.

The 0.1uF decoupling capacitor is good practice with any circuit. It absorbs the voltage transients when transistors within the ICs switch. Without these, digital circuits can behave very strangely.

R3 is to pull the input to ground when the probe is not touching the track, otherwise it floats and generates all sorts of spurious noises. The solder blob on the track is to the positive rail to give a definite level for the control.

I've used a wide angle red LED but any LED will do. Drop R5 to 150R or so if using blue or white. There's not a lot of LED activity so as to keep the current consumption down.

Current consumption is around 1mA when active and drops to 200uA when in sleep mode, so the battery should last a fair while.

I used ExpressSCH to draw the schematics, and PDF Redirect to save to a PDF file. Both free.

Step 6: PicAxe Microcontroller and Code


Code posted below in Word and Programming Editor formats. If you have trouble opening the code file, use 'save link as' and rename the .tmp file to .bas. I'll be commenting the code after the current re-write, but here's a quick summary :-

Tic Tac Tunes starts up after programming in 'sleep' mode. When asleep, the unit wakes briefly every 4 seconds and checks one of the ADCs (analogue to digital converters). If this reads 255 it wakes up. The ADC is held at 0 with no contact with a pulldown resistor.

Tic Tac Tunes now uses the ADC to read the track value which gives a reading from 0 to 255. The solder blob is at the positive rail voltage, so reads 255.

When awake, additional 255 pulses increase the tempo of the played notes (flashing the LED for each contact), and once the count gets to 8, it reverts to 1 and also switches to the other scale of notes (long LED flash). The PicAxe can only produce notes with a fixed duration, hence the need for the tempo control.

The tracks are in series, so the far end reads at around 127. This value is split in the software to upper and lower keyboard, and then into 18 notes, with 8 divisions for the percussion. An ADC value of zero (probe not touching) gives silence.

The percussion sounds are generated with a chunk of PicAxe SOUND commands, and the notes using TUNE. A watchdog timing loop is reset every time a note is played and if this doesn't happen at least every 20 seconds or so the unit goes into sleep mode until next awoken.

Tic Tac Scales adds more scales to the box, but drops the percussion. Turn on in the same way as Tic Tac Tunes, and select tempo and scale with the control blob. The LED will flash with tempo changes, and also beep as the scale changes to show the scale loaded. They are :-
1) Minor pentatonic
2) Blues
3) Hungarian
4) Arabic
5) Hejaz
5) Chromatic

Tic Tac Beat Box is a free-running beat generator. Start it up by touching the probe anywhere on the top track. It will then invent random beat sequences with 2 to 5 beats, at a range of tempos. It also mixes two sets (at the same count and tempo) to give a bit of variety. Every now and then, it starts a new set. At the start of each set the LED will flash to show the beat count, and gives a brief flash at the start of each bar. Touch the top track again to put it to sleep.

The PicAxe was initially developed for the educational market in UK schools but is being widely used by hobbyists. The PicAxe is based on various PICs but with bootstrap code to interpret the downloaded programs and handle the programming side. They come in all flavours from this suprisingly powerful 8 pin package up to full blown 40 pin.
Look at the manuals and datasheets on the PicAxe site to see the full capabilities. Programming of the chip is via a serial link and done in-circuit. It takes about 20 seconds and you don't even have to unplug the lead to run the program.
I've been in electronics since the early eighties and I've never found a programming environment where the coding / simulation / proving cycle is so simple. Documentation and support from the forum is excellent and there are many robotics enthusiasts using the chips. Control for servos, steppers, ADCs etc are built in to the BASIC-like programming language as well as a host of other goodies. You can also simulate the circuit before you build, and do real-time debugging on a running controller. Look out for more PicAxe based projects from me.

Step 7: Musical Notes


I've no formal musical training and this is a compressed version of what knowledge I've picked up over the years. If anyone finds errors, or has further ideas, please leave a comment.

The PicAxe can produce musical tones across three octaves, which in a full chromatic scale (with the sharps and flats) is 36 notes. Because of the way the waveforms interact and the way the brain interprets this, some notes will sound 'wrong' when played next to each other.

Other scales have developed around the world which use a selection of these notes, and some of these don't allow the disharmonies of the full scale. The pentatonic (5 note) scales are like this. I've chosen a minor pentatonic of A C D E G.

The blues scale is similar, but usually has 6 or 7 notes and combinations of these are harmonious, but do give a sense of tension and resolution in certain combinations. I'm using C Db E Gb Ab Bb.

The chromatic scale is what you would use to play 'proper' tunes from written music, but the lack of definite note positions on TicTacTunes makes hitting the right note difficult. The positions could be marked, but it will take a better musician than me to play a recognisable tune. Improvisation with one of the harmonious scales is the way to go with this gadget.

On the title page are sound files recorded using other selections of 6 notes from the octave which characterise the sound of music from various areas of the world.

Step 8: Future Development


This project is actually a spin-off from another one which I wouldn't have time to complete for the sound contest. The other project has been at the planning stage for some time . . . about thirty years!! With my recent discovery of the PicAxe microcontroller, what I was planning becomes so much easier so I'll be cracking on with it now. (Once I've got a couple of other projects out of the way.)

The Project -
Many years ago I read the 'Vermilion Sands' series of short stories by J.G. Ballard and was intrigued by the 'Sonic Scupltures' which appear in several of the stories. These are sculptures which react in a musical way to the environment and to the presence of people. My first attempt at this was a bank of astable multivibrators made to change frequency in response to temperature and light, and interlinked so as to produce a wide range of bleeps, hoots, whistles and warbles (now I think about it, incredibly similar to theThingamagoop). This never got further than the workbench due to the pressures of 'real life'. With the PicAxe, making a polyphonic, environment sensing structure becomes much easier.

Comments

author
ToggleSwitch (author)2014-03-30

So what chip did you insert in this tic tac tunes machine? I must'v missed it and can you buy it or do you have to make it?

author
Kjata1013 (author)2013-10-30

This rules. I love the idea! I'm making an arduino version of this. Simply because I don't have the funds to dive into the PicAxe.

author
Coolkid4 (author)2012-07-01

could you post a video tutorial on how to program the 08m2 chip

author
jdorne (author)2012-06-13

Here's an idea, change the instructable to use a 08M2 which has 2048 bytes of memory which means you can store all the programs on it and switch between them using a tactile switch connected to the unused PICAXE pin 3.

author
AndyGadget (author)jdorne2012-06-14

I made this around 3 years ago, well before the 08m2 came out, but yes, you could do a lot more with a re-write using an 08m2 (although I do quite like the challenge of getting maximum functionality out of a small device.)
Maybe one day, but I'm playing with polyphony on a 14m2 at the moment.

author
jdorne (author)2012-06-12

I have successfully made the Tic Tac Tunes. using the single gang slide pot made one half of the pot be the sounds and the other half the scales and its awesome.

Here it is: http://youtu.be/22etKzCdVO4

author
AndyGadget (author)jdorne2012-06-12

Great! - Glad you like it.
I've got and even awesomer (?) thing in the pipeline, if only I ever get around to finishing it.

author
jdorne (author)2012-06-10

I could only get hold of a single gang 10k linear slide pot but it is the perfect tic tac box size and tests 0-9k with multimeter. I noticed in the program that there is only a readadc command on picaxe pin 4. Do I need both parts of a double gang pot? or will the single gang do fine.

author
jdorne (author)2012-06-09

My piezo sounder I have is almost half the size of yours and has no screw holes. It works with the PICAXE and it has a tiny hole in the bottom of it and a larger hole in the top. will it be safe to super glue it to the top of the chip? Or does the tiny hole at the bottom have to be uncovered. Either way, I could glue just the edge of it on the chip and it'd still fit i think.

author
AndyGadget (author)jdorne2012-06-10

Glue it to the chip - No problem.
Covering the small hole may make it slightly quieter, but try it by blocking it with your finger first to see if it makes a difference.

author
moneyfuskie935 (author)2012-01-27

The amazingness of modern technology...

author
Drakencas (author)2012-01-15

I think that this can also: http://www.rapidonline.com/Electronic-Components/PICAXE-08-Starter-kits-80318

author
Drakencas (author)2012-01-14

no i'm from the netherlands its not so funny in the netherlands they dont sell picaxe and download cable for picaxe and socket

author
AndyGadget (author)Drakencas2012-01-14

If there's no Picaxe supplier in the Netherlands then the UK Picaxe site, Techsupplies, may be your best bet.  It looks like postage for a smallish order to Europe is 3.6 Euro.  They do all the parts you need. 

author
Drakencas (author)2012-01-14

can this piezo sounder to? http://www.ebay.nl/itm/2-x-Cased-Toko-Piezo-Audio-Sounder-With-Leads-30-x-4mm-/390377033134?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item5ae448cdae#ht_1456wt_1139

author
Drakencas (author)2012-01-14

what is the sort socket a: stereo PICAXE socket or a: Surface mount Stereo Picaxe socket

author
Drakencas (author)2012-01-14

what will one tic tac tune cost if you have to buy everything (download cable)

author
AndyGadget (author)Drakencas2012-01-14

 
Assuming you're in the US (I'm not), probably around $20 plus P&P, half of which will be the programming cable.

author
Drakencas (author)2012-01-13

i have a question

if i buy the picaxe 08m2 whats in the box (download cable, programming socket)

author
AndyGadget (author)Drakencas2012-01-13

 
That will just be the chip - The other parts you'll have to buy separately.  The programming circuit is the 3.5mm socket and two associated resistors shown on the diagram as the chip is programmed in circuit.  You will also need the AXE027 programming lead which you can get from the same place as the PicAxe chip.  The software (Programming Editor) is a free download from the Picaxe site.

author
BrunoG (author)2011-12-18

How do I program it??

author
paintballer97 (author)2011-11-17

Could a 330 ohm 1/2W 5% Carbon Film resistor be used in place of the 330r Resistor or is that the equivalent??

author
blinkyblinky (author)2011-11-09

I love it!!!

author
blinkyblinky (author)2011-11-08

Whats the difference between each one?

Which one should I use?

author
madbutler (author)2011-10-29

You dont know where the cheapest place is to buy dual gang potentiometers? I would love my students to have ago at this circuit but at $12 a pot they are to expensive. Is there any other thing that would replace the dual gang pot?

Madbutler

author
gada888 (author)2011-10-13

I found the picaxi 08M and pic12f683 out in market.are they the same thing?

author
jwoo2023 (author)gada8882011-10-25

no, PICAXE is pre programmed so that you can 'program' in BASIC unlike PIC which is different

author
blinkyblinky (author)2011-10-03

Nice...but I tried my hand at PICAXE chips...

I like pics more though (No offense, though.)

author
Mutantflame (author)2011-09-05

Great instructable AndyGadget,

I was just about to make an order on Tech Supplies for the PicAxe chip, but then I realised that the link is broken for me. Is there any other website that sells them and will ship to the UK?

thanks,
Z

(Now, off to maplin!)

author
AndyGadget (author)Mutantflame2011-09-05

 
Are you using an old bookmark link?  The site moved a few months ago.
Currect address is HERE.

They're shipping the 08M2 now which is a more powerful replacement for the 08M, but It should work in this circuit - Please let me know if it doesn't.
(I know there's a problem using the 08M2 with my Piecax project, but I'm working on resolving that.)

author
Mutantflame (author)AndyGadget2011-09-05

Thanks, this link works fine for me.

Does the 08M2 cost any more than the 08M? If the price is the same or similar I shall be giving it a try.

Z

Oh, and just to confirm, I only need the Chip and the cable right, not the CD disk or any of the things, correct? I don't want to make an order to find out that I am unable to program it.

Thanks!

author
AndyGadget (author)Mutantflame2011-09-05

 
I think the 08M2 is cheaper than the old 08M.  The reason is that it's a custom masked item from Microchip (i.e. a component in itself) and not a standard PIC programmed by RevEd like the 08M was.

You only need the cable and chip - yes.  The software you download from HERE. You'll need the Programming Editor and the AXE027 drivers.  While you're ordering, get yourself another 08M2 and a proto-board too for playing about with.  Also a battery box to power it.  It's amazing how many things you can do with just that setup and using different sensors and output devices. 

author
Mutantflame (author)AndyGadget2011-09-06

Thanks for your help, AndyGadget! I will get back to you in the future as to how it works!

author
Oi23 (author)2011-08-28

Is there anywhere I can buy a finished "Tic-Tac Tunes"?

author
AndyGadget (author)Oi232011-08-28

 
Nope, you'll have to make it yourself.
(If you're after something ready-built, there's always the Stylophone.)

author
WhiteHatJake (author)2011-08-01

How would you classify those audio files above? How would you describe their genre?

author
AndyGadget (author)WhiteHatJake2011-08-01

 
I've got another project in development which generates an endless succession of this sort of tune (algorithmic music generation) and I may set it up as a ShoutCast station.  I think the genre which best defines it is 'experimental'.

author
WhiteHatJake (author)AndyGadget2011-08-01

Thank you very much. :)

author
retrotimelord (author)2011-07-28

cool soldering iron

author
AndyGadget (author)retrotimelord2011-07-29


Thanks, and I'd bet money that it's a lot older than you are.  I've been using it since the early 1980's (but had to change the bit a few times #;¬)

author
futureventions (author)2011-06-22

With the peizo sounder, what colour wire attaches to the Picaxe?

author

 
It doesn't matter - Connect the piezo either way around. 

That only comes into play when you're using two or more speakers :-  If you connect them different ways around then one is 'pushing' the air in one direction while the other is pushing in the other, so the pressure waves (sound) from each would tend to cancel out to some degree.
This is very noticeable with stereo loudspeakers if you connect them to the amplifier with one reversed. (It's called 'phase reversal'.)

author
futureventions (author)2011-06-20

soory to be a bother, but where abouts does the programming socket connect to, it's just that in the picture it looks like nowhere.

author


Look at the 3rd picture in step 2 showing the back of the board. The socket is in the top right . The top 2 are linked and the bottom 2 are linked. The tracks connect to the rest of the circuit. Relate the top side photo to the bottom side and the circuit diagram to see where.

author
futureventions (author)2011-06-20

could you please tell me where abouts the wires for the keyboard go, as i can't quite tell from the pictures.

author


If you hover over the yellow boxes on the 4th picture on step 2 it shows the keyboard connections to the top track (+V), in the middle (to the IC pin 3) and bottom track (0V).

author

it's ok now, i just hadn't read the previous slide properly!

author
cproo12 (author)2011-06-17

i ade y tic-tak box into an i pod i s took apart an old ipod and sed the parts i took off the screen thogh

author
AndyGadget (author)cproo122011-06-17



Could you make one into a keyboard?

(You appear to be having a little trouble with yours #;¬)

author
godofal (author)2009-11-05

any way to have this in an attiny form? would help me alot, since i cant program PIC's (yet, but that "yet" might take a long time...)

About This Instructable

90,547views

372favorites

License:

More by AndyGadget:Simple Effective Mouse CatcherAuto-lock mod for smartphone caseThe Orange Screamer
Add instructable to: