Archive for the 'Construction' Category

25
Nov
17

Piezos Pt 2 – Contact microphones

The first plan I had was to use piezos as contact microphones.  This would enable me to amplify small string and percussion instruments, and, with additional circuitry, create new ambient electronic instruments.

The first step would be to wire the elements to cables and jacks.  It’s best I had read, to use shielded wire to do this, especially where the cables are long, so I thought it would be easier to buy and reuse cables with jacks already attached.  These are generally only about £1.50 – £2.00, so I bought some 2m leads with mono 3.5mm and 6.35mm jacks, and cut them in half.

I soldered the stranded shield to the outside of the disc and the core to the centre, using lengths of different diameter shrink tubing to strengthen the connections and make sure the cut wires were kept apart.  The already-attached leads were colour-coded black and red to indicate their function.

At this point I tested the discs to make sure they were picking up sounds before moving on to the next stage.

*

The next thing I did – again, a procedure suggested by Nic Collins – was to seal and further strengthen the piezo discs with rubberized paint.

There don’t seem to be many of these on the market these days, and although – compared to the other components in these projects – it was rather expensive (having had to be imported from the US), I opted for the one Nic Collins used: Plasti-Dip.

There is a cheaper Ronseal product, which is advertised as a liquid rubber for sealing flat roofs, but I wasn’t sure if it would be the right consistency.  Ronseal has a very annoying website which doesn’t allow you to search for products by name, and I couldn’t find it there, but it’s called Isoflex , and you can get more details by searching suppliers’ websites.

The Plasti-Dip looked rather thick, but the piezo discs are very thin and it wasn’t at all difficult to dip the ends in and cover them to a level just above the shrink tubing – the tin, as can be seen in the picture, is tall and thin, presumably for this reason.

The Plasti-Dip did the job perfectly, and I’ll be looking for other uses for it in projects and around the house, as hardly any of it was used up!  I bought the 400ml tin, as, at around £18 it seemed better value than the small tin at about £14 for 250ml, but even 250 ml would be a lifetime’s supply at the present rate.

By the way, although there are many colours available, I chose black because of its lack of visibility, in case the microphones would be used in situations where they needed to be discreet – e.g. in the presence of wildlife.  This would potentially be important in one particular future project.

Nic Collins recommends putting a small piece of insulating tape over the solder connections on the backs of the discs to give them extra protection against breaking off – which would be a great shame after all the soldering and dipping – but I forgot to do this, so I hope the dipping is enough to keep them together.

After dipping them I hung them up to dry overnight and dipped them again the following day to improve the seal

After two dips they looked fine.  I was worried that too much paint would dull the sound too much: although there would be a number of applications where I would use the piezos without dipping – or with a single dip – Nic Collins certainly mentions two dips and says that three would cause dampening of the sound pickup.  I was thinking that these ‘stand alone’ piezos might be used in a context where they needed to be waterproof, and one dip didn’t seem to seal them enough, so I left it there.

The following picture shows two sizes of piezo mic, 18mm diameter on the right, 27mm in the centre.  The one on the left has two elements connected in parallel.  I thought this might be useful to record oddly-shaped objects or objects with a large surface area.

*

I had read in more than one place that, although piezos can be used as contact mics just by plugging them into an amplifier or recorder, they work much better if the signal is run though a buffer circuit first.  The buffer needn’t necessarily amplify, but the low-frequency response would in any case be significantly improved.

A very useful series of articles starting here or here gives much greater detail on this.  I adapted the low noise preamp from that site, here or here:

Features of the circuit: the two diodes protect the opamp inputs from damage by restricting the maximum voltage that they can receive from the piezos.  The TL072, which I used – or the lower noise pin-for-pin replacement, the NE 5532 – is a dual opamp, so two of these circuits can be built using the same chip.   (The TL074 is a quad version, from which four  circuits can be made).  The pin numbers in brackets are those used by the second circuit built around the TL072: the second circuit is identical, and the only place where the two circuits meet is at the point marked A, the half supply voltage point created by the voltage divider – these two 100k resistors don’t need to be repeated for the second circuit.

The majority of piezo buffer circuits I found seem to use FET transistors, but these are quite expensive in comparison to the TL072, TL074 or NE5532.  I also read in one of the articles referred to above that ‘the manufacturers of FETs don’t control their parameters well . . . The gate-source voltage needed to bias the transistor into the linear region can vary between 0.25V and 8V, which leaves a good 7.75V down to a hopeless 0.4V for the transistor and load if used with a typical NiCad 8.4V PP3.  You’ll have to get more FETs than you need and throw out the dogs . . . Design manuals get all sniffy about that sort of thing because selecting FETs obviously adds to the cost if you are mass producing something. That’s not the case here, and there’s just no way to cope with a manufacturing tolerance which can throw more than 90% of the battery voltage away in variations in manufacture without screening the bad ‘uns.’

So I decided to stick with the opamps – the most recent batch of TL072’s I bought were between 4p and 5p each; the NE5532’s were more expensive at about 20p.

So, as soon as the microphone assemblies were ready, I made up one of these circuits with a TL072 and tested it out.

I plugged it into the line input of my MacBook, and it seemed to produce little background noise.  I attached two of the piezos which I had prepared as above, and clipped them to a plate, recording the sound in the Audacity app as I tapped the plate with a pen. As a comparison, I turned off the buffer and plugged the piezos directly into the computer.

The following short sound file illustrates the difference the buffer makes.  The output was a little louder with the buffer than without so I adjusted the recordings to be more or less the same volume.  First heard are the taps with the piezos plugged directly into the computer; then the taps using the buffer.  The difference is quite striking.

The buffer does amplify the sound, but I’ve tried to minimise this in the recording: nevertheless, there is a noticeable increase in the lower frequency response when the buffer is used.  The sound is much fuller, so, although the small expense and time involved in making buffers does add to the cost and the effort of piezo projects, I think it’s probably worthwhile for the improvement in the quality of the results.

In the following posts I’ll describe some particular projects in which I used the piezo elements as microphones, mostly with the buffers.

Advertisements
25
Nov
17

Piezos Pt 1 – General

Piezos, Piezo Sensors, Piezo Transducers, or Piezo Elements are small, cheap components that can be useful in several different ways to the electronic musician.  I had some ideas for ways I’d like to use them, and this series will describe some projects in which piezo elements were employed.

A transducer is a device which changes energy from one form to another – for example, tape heads and record pickup cartridges are transducers as they change magnetic signals on the tape or movement in the grooves of a record into electrical signals; microphones and speakers are transducers because in the first case they change movement in the air into electrical signals , or in the other they change electrical signals into movement in the air.

Piezo elements are transducers because they can transform physical movement into electrical signals like a pickup cartridge, or electrical signals into movement in the air like a speaker.  They do this not by sensing magnetic fields, like a tape head or guitar pickup, but by the movement of crystals, and this is what a piezo element has inside it.

Piezos work especially well when attached to something which will vibrate and produce electrical signals which can be amplified, or can amplify the vibration of signals fed into it.

In everyday life, they’re usually found in mobile phones, in buzzers or in place of speakers in smaller children’s toys.  This gives a clue as to the different ways in which they can be employed in electronic music circuits: as microphones, as speakers, or as triggers for switches.

Much of the information below was gleaned from Nic Collins’ book Handmade Electronic Music, and his series of videos on YouTube called Hack of the Month Club.

First of all, this is what piezo elements look like if you buy them from a components supplier, or take one out of a phone or musical toy:

or sometimes like this, if they come in the form of a sounder or buzzer – in this case, the element can be carefully removed from the plastic surround.

They vary in diameter from 10mm to 50mm.  I have used some of the smaller ones, but most of the ones I have are 18 or  20mm, and 27 or 35mm.

When I buy them, I prefer the ones with the leads already soldered on.  This saves a job – and it’s said to be quite tricky to do the soldering effectively – and they’re still very cheap.  The last batch I bought worked out at about 12p each for the 35mm diameter ones, and just 6p each for the 18mm ones.

Perhaps the first piece of music to use transducers in its realisation was Cartridge Music by John Cage, composed and first performed in 1960. As described on the webite of the John Cage Trust: ‘The word ‘Cartridge’ in the title refers to the cartridge of phonographic pick-ups, into the aperture of which is fitted a needle. In Cartridge Music, the performer is instructed to insert all manner of unspecified small objects into the cartridge; prior performances have involved such items as pipe cleaners, matches, feathers, wires, etc. Furniture may be used as well, amplified via contact microphones. All sounds are to be amplified and are controlled by the performer(s).’

Another composer who famously used transducers was David Tudor. Tudor – who was closely associated with John Cage – created a piece called Rainforest – originally in the mid 1960’s, but it went through a number of changes during the rest of the decade as Tudor’s techniques and equipment developed. The piece was based on the idea of making objects other than speakers vibrate, picking up the sounds they made with microphones and then filtering and mixing the resultant sounds.

‘My piece Rainforest IV‘, Tudor explained, ‘was developed from ideas I had as early as 1965. The basic notion, which is a technical one, was the idea that the loudspeaker should have a voice which was unique and not just an instrument of reproduction, but as an instrument unto itself . . .’

‘. . . I eventually acquired some devices called audio transducers. They were first developed for the US Navy because they needed a device which could sound above and under the water simultaneously . . . I had them in 1968 when MC [choreographer Merce Cunningham] asked me for a dance score and I decided that I would try to do the sounding sculpture on a very small scale. I took these transducers and attached them to very small objects and then programmed them with signals from sound generators. The sound they produced was then picked up by phono cartridges and then sent to a large speaker system.’

‘Several different versions of this piece were produced. In 1973 I made Rainforest IV where the objects that the sounds are sent through are very large so that they have their own presence in space. I mean, they actually sound locally in the space where they are hanging as well as being supplemented by a loudspeaker system. The idea is that if you send sound through materials, the resonant nodes of the materials are released and those can be picked up by contact microphones or phono cartridges and those have a different kind of sound than the object does when you listen to it very close where it’s hanging. It becomes like a reflection and it makes, I thought, quite a harmonious and beautiful atmosphere, because wherever you move in the room, you have reminiscences of something you have heard at some other point in the space.’

(from An Interview with David Tudor by Teddy Hultberg in Dusseldorf, May 17-18, 1988, http://davidtudor.org/Articles/hultberg.html).

A reviewer present at a performance of Rainforest described the appearance and sound of the piece as follows: ‘The entire piece sounds at first like an ethereal insect chorus, but the layers gradually disperse into patterns of jagged counterpoint, which in the performance seemed to harmonize perfectly with the movements of the dancers . . .

‘Most of the sounds are created by sine tones being reverberated through a forest of suspended metal containers, pieces of junk that function as “biased” loudspeakers imparting their own timbral colouration to the sounds which pass through them. These sounds are picked up by contact microphones, fed back into Tudor’s mixing and filtering controls, and then recycled back into the expanding forest of increasingly hybrid noises. The array of metal containers usually fills an entire gallery, and spectators are invited to walk around and put their heads inside the containers.’

(Roger Sutherland, Musicworks, Number 75, Fall 1999, http://moderecords.com/catalog/064tudor.html)

Some modern performances of Cartridge Music will use piezo elements instead of cartridges, although this might be considered cheating. Piezos, on the other hand, are ideal for achieving the kinds of effects employed by Tudor in Rainforest, and the different projects I planned with them will hopefully cover these uses and more.

 

 

12
Oct
17

The Carousel Keyboard

‘Carousel’ was just the brand name of this toy keyboard, it didn’t unfortunately look like a carousel . . .

. . . but having just finished the Animal Band and The Telephone, I wanted, while it was in my mind, to work on another device that could be controlled by the Bigfoot, only this time with a full two octave span, the ability to play a variety of different scales, and be tuned to play these scales in any key.

I opened up the Carousel, and it looked as though it would fit the bill.  The chip on which it was based was securely hidden under a black blob, but there were sufficient additional components to make me think a few simple hacks would be possible.

First of all, I wanted to check the instrument’s ability to be tuned.  I inserted batteries, switched on and began testing the circuit using the traditional wetted finger method – that is, starting the instrument playing one of its demo tunes and applying a wetted fingertip to different resistors on the board.

After a short test, I found the resistor that controlled the instrument’s pitch and timing.  It was a tiny SMD (surface-mounted) component, just 3 or 4 millimetres long, so was easily – though carefully – removed.  Its value – again, printed on the circuit board – was 300k, so after it was removed I replaced it with a 1M potentiometer, to increase the range of notes the instrument could produce.  The spot from which the resistor was taken is arrowed on this photograph, and the two leads going to the potentiometer can be seen:

(Also visible in the background are the wires connected to the PCB tracks required to trigger the notes).

I experimented with the resistance and found that the minimum the device would accept without crashing was about 200k, so I added an extra couple of 100k resistors before the 1M potentiometer, and found that a considerable variation in the pitch was achievable.

*

Early on in this process I disconnected the internal speaker, which was quite terrible, and added my standard 4mm banana sockets for attaching an external speaker.  The sound was 100% improved, and experimenting became a great deal more pleasurable.

Just beneath the speaker sockets a switch can be seen, which I connected up to allow the internal speaker to be selected, if an external speaker wasn’t available.

I later added an audio out socket, to allow the Carousel Keyboard to be played through the Taurus amplifier.  At first this didn’t work at all – virtually no sound came out, even though it would work with the internal or external speakers.  But I realised the output of the circuit needed a load in place of the speaker, so I put a 10 ohm resistor between the audio out and ground pins on the audio out socket, and after that it worked fine with an external amplifier.

*

I was saved from having to do the job I had performed on the Animal Band and The Telephone, working out which PCB tracks needed to be connected to produce the different notes: to my surprise, this was printed on the back of the circuit board.

There appeared to be an 8 x 5 matrix, so connections were made to the relevant PCB tracks, ready to be brought out to a new board.

*

The intention was to be able to control the keyboard with the Bigfoot sequencer, so I added a 5-pin DIN socket and 4050 buffer, as usual, ready to accept the Bigfoot’s 4-bit binary input.  This is in the form A B C D, where A is the last – rightmost – bit in the binary number, and D is the leftmost.  A is sometimes referred to as the LSB (Least Significant Bit) and D the MSB (Most Significant Bit).

The binary number 0010, for example (the number 2) would mean that D was 0, C was 0, B was 1 and A was 0; in practical terms this means that input D was 0v, C was 0v, B was +v and A was 0v.

I needed one of the inputs (D) to be inverted – i.e. if the input was 0v, I needed +v, and if the input was +v, I needed 0v – so with the 4050 was a 40106 inverter, with sections which change 0v to +v and +v to 0v.  There was very little space inside the keyboard case, so the board with the 4050 and 40106 was tucked under the output socket.  (This was before I added the 10 ohm resistor on the socket).

The circuit of the input section was like this:

There are 6 buffers in the 4050 chip; 4 of these are used (marked A B C D) and the inputs of the other two are connected to ground.  Likewise, there are 6 inverters in the 40106; 1 of these is used and the inputs of the other 5 are connected to ground.  Unused inputs on CMOS chips should normally be grounded like this to ensure correct operation.

Normally, I would use a 4067 to cover the two octaves produced by the Bigfoot – as in the Animal Band and The Telephone – but in this case that wouldn’t work.  The 4067 is essentially a 16-way switch with a single pole; in this case there were 4 different ‘poles’ to which connections needed to be made, since the notes are produced by a matrix.

Using four 4067’s would be perfectly possible, but unnecessarily expensive – each one costs between 30 and 50p, and is physically quite large, being in 24 pin wide format.  As there would only be 4 or 5 connections to each pole, it would be more effective in terms of cost and space in this circuit to use 4051’s.  The 4051 is an 8 pole switch which works in more or less exactly the same way as the 4067, but is physically smaller  – and costs less than 15p!

An important difference between the 4051 and the 4067 – related to the number of outputs – is that the 4067 requires a 4-bit binary input (16 numbers, from 0000 to 1111), but the 4051 only a 3-bit (8 numbers from 000 to 111).  This means that a different way must be found with the 4051’s to ensure that outputs for the first 8 numbers are separate from the outputs for the second 8 numbers.

This can be done by using the Enable/Inhibit pins of the 4051’s.  Each 4051 – just like the 4067, in fact – has an Enable/Inhibit pin: if this pin is at 0v, the chip will work, and convert its binary inputs into individual outputs; if the pin is at +v, it won’t work.

So, the first 3 inputs from the Bigfoot binary input socket, A B & C, are passed on to the 4051’s in the next part of the circuit, but the 4th input, D, is not.  Instead, the 4th digit is used to turn pairs of the 4051’s off and on via their Enable/Inhibit pins.

4051’s 1 & 2 output the lower 8 numbers (0000 to 0111), so as long as the 4th, leftmost, digit is ‘0’, these two 4051’s are enabled.  0v at the Enable/Inhibit pin achieves this.

4051’s 3 & 4 output the higher 8 numbers (1000 to 1111), so if the 4th digit is ‘1’, an inverted signal from the 40106 sends 0v to enable these two.

The circuit to convert the binary input to separate outputs looks like this. (The 40106 gate is repeated from the diagram of the input circuit):

The lower 8 notes are divided between the top two 4051’s in the diagram, which work together with no overlap in notes, and the higher 8 notes are divided similarly between the bottom two, according to which common pin they must connect to.  The pin connections are named in the diagram as they appear printed on the keyboard’s main PCB: the 4 common pins are connected to tracks named BP10, BP11, BP12 and BP13.

The reason there are many more than 16 output pins shown is connected with the principle of the Bigfoot sequencer.  The idea is that the sequencer outputs the notes of a scale – do, re, mi, fa, so, la, ti, do – but the exact scale – major, minor, melodic, harmonic, etc. – is determined by switches on the receiving instrument.  Normally there would be 5 double pole switches, but due to the configuration of the pins in the Carousel keyboard, one of the switches (SW2) needs to have 3 poles.

*

As with other of my designs like this, there wasn’t a lot of circuitry as such – just a lot of interconnection between the chips.  After soldering the dozens of wires needed to link the 4051’s with the switches and the Carousel keyboard’s PCB, the inside of the instrument looked like this:

There was just enough room for the new circuit board with the four 4051’s on it.

The Chessboard Keyboard proved very useful in checking that everything was working properly – one wrong note revealed a connection error on one of the switches! – and the 4 LEDs were a good double check that the binary input was being interpreted correctly.

*

Although the pitch control potentiometer worked well, I decided there was a need to be more precise about the pitch, which would effectively set the key the instrument would be playing in when controlled by Bigfoot.  So, as I had done earlier with The Telephone  – referred to above – I added a switch to change between the potentiometer and a 12-way switch.

Between each of the output pins of the switch, I inserted a 100k trimmer – with an extra 100k trimmer before pin 1 – so that the pitch of the instrument could be set to any one of the 12 steps in the octave.

In The Telephone I used ordinary single-turn trimmers, but I though it would be a good test to see if multi-turn trimmers would be as good – that is, as accurate in establishing the pitch, remaining in pitch, and not taking up too much space in the cramped enclosure.

The type I chose looked like this:

Buying 20 at a time enabled me to get them at a reasonable price – about 8p each, although this was probably twice as much the single-turn trimmers I had used in The Telephone.  They were also much more than twice as big.

However, I soldered them all in place and set about adjusting the pitches.

In this instance, I didn’t really find a big advantage in using the multi-turn trimmers.  I was tuning the pitches by ear – maybe I was able to be more accurate than with the single-turn trimmers, maybe not.  It took longer to tune each note, of course, because of the number of extra turns required.

I would have been glad if the potentiometer/trimmer arrangement had been a bit smaller, but I found space on the right-hand side of the keyboard to fit it in with the potentiometer and the other switch.  This picture shows 1 – the 12-way switch with trimmers, 2- the 1M potentiometer, and 3 – the SPDT switch which allows either the 12-way switch or the potentiometer to be selected.

I chose two knobs which fitted the space available on the top surface, drilled holes and fixed them in place.

*

That was everything I planned to do with the Carousel keyboard for now, so I carefully closed up the case and screwed it back together.  I had to cut some rectangular holes in the base to make room for the 5 switches, but surprisingly everything else fitted in.

 

09
Oct
17

The MIDI CPU Project – 3. Bass Pedals

After building the MIDI CPU box and programming it to accept input from keys, switches and potentiometers, it was necessary to build MIDI instruments to use its features.

As the MIDI CPU accepted input via a 25-way DIN socket, it would just be necessary to equip each instrument with such a socket and link it to the MIDI CPU with a suitable cable.

The first instrument I’d planned was a set of 13-note bass pedals, and the initial SysEx file with which I’d programmed the MIDI CPU was suitable for this application, with the first 13 control terminals, 0 – 12, configured as a complete octave from C0 to C1.

I got the pedals from a local seller on eBay who dismantled and repaired Hammond organs.

They were in excellent condition, and the switches on each of the pedals seemed to be still wired.  They looked like this:

and the actual connections were like this:

Pedal switches

The two tabs on the front linked one side of all the switches together; when a pedal was pressed, this bus would be connected to the other side of that individual switch, the tab on the top.  This was perfect for this application, in which an individual switch connected to 0v would be interpreted by the MIDI CPU as a note command.

My main task, then, was to connect each of the 13 switches to a 25-way socket, in order to pass the switch presses to the MIDI CPU box.

In addition to this, I wanted to have Octave Up and Down and Hold commands available, so there would be 3 further connections to the 25-way socket.

Finally, I would have to construct a housing in which the pedal unit would sit.

*

There were no circuits as such involved in this project – it was just a case of wiring up the switches and connecting them to the socket.  At the same time I decided to add a couple of extra sockets that would enable the pedals to be used in a different way if necessary.

The additional sockets added were a 15-way socket, which would be compatible with the Superstylonanophone (another MIDI device, with  a built-in MIDI-USB interface):

and a 9-way socket compatible with the Apple IR remote:

*

I connected the switches to the sockets and, because the enclosure I had planned was designed to have another instrument on top of it (another MIDI foot controller, a Digikick Footar) I connected the Hold and Octave Up and Down connections to 1/4″ sockets so these switches could be external, rather than on the top of the pedals.  All the sockets were housed in a small panel, which would be attached to the rear of the enclosure.

*

After connecting the switches to the sockets, I found a D25 cable and attached the Bass pedal unit to the MIDI CPU box.  At the moment the MIDI CPU box is connected to a laptop via a Midisport 2×2 MIDI-USB interface – along with the Digikick Footar – and controls software instruments in Apple Logic.

I added 2 or 3 different bass instruments to the Logic set-up and tested the pedals.  All notes worked as they should.

With an external switch I tested the ‘HOLD’, ‘OCTAVE UP’ and ‘OCTAVE DOWN’ functions, which seemed to be working OK, so deemed it safe to screw down the top of the case in which the pedals were housed and fix the panel to the back of the case.

06
Sep
17

The Animal Band & The Telephone

This project came about as I was looking through my collection of electronic toys for additional devices that could be controlled by the Bigfoot sequencer or the Chessboard keyboard.

I don’t know if ‘Animal Band’ and ‘Telephone’ are the correct names for these toys, but they are sufficiently descriptive to identify them amongst my various devices.

Both the Bigfoot and the Chessboard encode the 15 pitches (2 octaves) they can produce into 4-bit binary numbers so that they can use standard 5-pin DIN connecting leads – the same as MIDI leads – rather than more complex multi-way connectors to control sound-making instruments.

I came across two devices, which were rather limited in that they played only a one octave scale; but it was the same scale – B major – and one of them had not only small animal musicians who moved as the notes were sounded, but was also capable of playing a scale with various animal noises.  For some reason, this scale turned out to be A major, but this was only a minor inconvenience.

The additional electronics required would be similar to those in The StyloSound, the main thing being a circuit to convert the binary number input from the Bigfoot or The Chessboard to the individual notes of the scale.  Both the devices would need one of these.

The basic circuit I use looks like this:

Receive circuit 3

At the beginning, the input passes through a non-inverting buffer.  (There are 6 connections from the input to the buffer in case a later plan for operation via MIDI is implemented, which is designed to use 6 bits.  For the time being, only the first 4 are being used, the other 2 remaining unconnected).

The purpose of the buffer is to reduce the incoming signal level (which, from both the Bigfoot and the Chessboard, is at 9v) to 4.5v, the voltage of the Animal Band.  The 4050, unusually, is able to deal with an input signal which is higher than its supply voltage, which makes it ideal for this purpose.

When functioning, the 4067 will interpret the 4-bit binary input on pins 11, 12, 13 and 14 as a decimal number from 0 (0000) to 15 (1111) and act as a switch, connecting pin 1, the Common, to one of its 16 outputs on pins 2-9 and 16-23.  Each of the 4 binary inputs is held at 0v by 100k resistors, interpreted as a ‘0’ by the 4067, so a +v pulse on one or more of the inputs pulls them high, acting as a ‘1’

To avoid silences – Bigfoot produces 16 notes, the Animal Band produces only 8 – the output pins for notes 9 – 15 are connected to the pins for notes 2 – 8.

Pin 15 is brought out to an SPDT switch.  When connected to +v, the 4067 is turned off; when connected to 0v, it is turned on.  The Telephone would have a similar switch.  In this way either instrument can be set to work or not work without disconnecting the power.

*

To find exactly where to connect the Common and output pins of the 4067 I needed to search inside and test different points on the printed circuit board.

I removed the top:

Animal Band top

and examined the inside:

Animal Band inside marked

The important sections are marked.  (Normally the LEDs are pointing upwards, but I was in the process of examining them when I took this picture and had unscrewed the circuit board on which they are mounted).  In the centre of the device you can also see the rod by which the stepper motor moves the figures of the animal band when notes are sounded, and at the bottom the actuators which are pressed by the keys.

The first thing I did after opening the case was to give the actuators a clean.  They are the typical type – like computer keyboards or game controllers – which, when pressed, connect together two narrow tracks on the PCB.  If dust and dirt get inside them, they can operate erratically.

This is a typical example (from The Telephone) of the PCB tracks underneath a button:

Button pad

Apart from cleaning these small PCB tracks, I gave the carbon or graphite blocks which make the connection a light scrape to make sure their surfaces were also free of dirt and dust.

The important connections inside the Animal Band seemed to be grouped together in the bottom left-hand corner, so these are the connections I looked at first.  After testing them, I could see that the following connections needed to be made:

Animal Band PCB

The point marked ‘Common’ needed to be connected to pin 1 of the 4067, and the 8 notes to first 8 output connections on the 4067.  (Actually, output 1, pin 8, in the Bigfoot system is not connected, so the unit is silent on receipt of 0000.  The first note sounded is 0001, so the outputs used are 2-9, starting with pin 7).

In the Bigfoot system, an instrument which can sound all 12 notes  in an octave would have switches to raise or lower some notes of the scale (the 2nd, 3rd, 4th, 6th and 7th notes), but the Animal Band and the Telephone are fixed to play a major scale, so these switches aren’t needed.

*

Finally, there needed to be a circuit to connect the Animal Band and The Telephone.  This would have to combine the input from Bigfoot, the Chessboard (or other 4-bit binary input) and send this in binary form to The Telephone.

This consisted only of inputs from two DIN sockets, entering via diodes, and passing through a second 4050 buffer.

The circuit board ended up looking like this, as I had originally planned to include a further circuit which would convert 16 individual inputs to a 4-bit binary output (as used in the Chessboard):

circuitboard

The large 24 pin chip at the bottom left is the 4067; the two chips above are the input and output 4050 buffers; the other 3 chips are two 4532’s and a 4071 for the unused binary-converting ‘Send’ circuit.  The diodes in the bottom right are for the inputs from Bigfoot and the Chessboard.

The board was designed to fit into the rear section of the Animal Band, behind the ‘organ pipe’ section with the LEDs in it.  I added 6 extra LEDs here, connected to the 6 outputs of the 4050 input buffer.

Most of the connections – including the 6 new LEDs – can be seen in this view of the inside, just before putting the case back together.

IMG_0947-2

This picture shows 3 of the new sockets and switches.  1 = the 5-pin DIN Out socket; 2 = the 4067 Enable/Inhibit switch; 3 = the audio out socket.  When a 3.5mm plug is inserted into the socket, the speaker connection is cut out.

IMG_0950-2

*

The Telephone needed a similar circuit.  The 4067 is one of my favourite chips, and I’ve been using it for some years, but recently, it seems , the Arduino hobbyists have started to use it, as there is now a reasonably-priced breakout board available, using an SMD version of the chip.  This looked like a real time-saver for me, so I bought a stack of them – at a cost of about 70p each – and The Telephone was my first chance to use one.

4067-Breakout-BoardAs can be seen, the 16 outputs are brought out on the left-hand side of the board, and on the right-hand side are ‘SIG’, which is the Common output on pin 1; the 4 binary inputs S0-S3; ‘EN’, the Enable or Inhibit pin; +v and Ground.

I couldn’t use this breakout board in every situation: the information with it said the maximum voltage should be no more than 7v – elsewhere I have even seen 6v.  I think the intention is that it would be used with 5v, like the Arduino, but in any event the 4.5v I was planning to use with the Animal Band and Telephone would be well within the limits.

Inside, The Telephone looked like this:

Telephone inside

The main circuit board inside The Telephone sits under the 12 buttons of the keypad.  It looked as though the important connections were down the right-hand side of the board, so, tracing the tracks, it was possible work out which ones needed to be connected to produce each of the notes The Telephone was capable of.

Track 8 was the ‘Common’.  This track needed to be connected to one of 8 of the other tracks to produce the notes of the scale.  I identified which 8 tracks these were and connected these, plus the Common, to the 4067.  As with the Animal Band I connected outputs 9 – 15 to outputs 2 -8 to make sure The Telephone would be constantly sounding – except when in receipt of a 0000 input.

According to the circuit diagram of the module, it appeared that the Inhibit or Enable pin  was tied to Ground with a 10k resistor, so the unit would automatically be working when the power was switched on. 4067 breakout board schematicThis meant that only a SPST switch would be required to connect the pin to +v if it was necessary to stop it functioning.

The telephone was a less complicated unit than the Animal Band, so I just needed to connect the 4067 module to the input via a 4050 buffer, for which I just used a 16-pin i.c. socket, rather than a piece of veroboard:

Also visible in this picture are the four 100k resistors connecting the inputs of the 4050 to ground, and the audio out socket, which cuts out the internal speaker when a 3.5mm mono plug is inserted.

The outputs of the module were connected to the appropriate points on the Telephone PCB:

The only other thing to add was a switch attached to the enable/inhibit pin of the 4067 to allow the unit to be switched off without removing the power.  As mentioned above, the enable/inhibit was attached to ground internally in the module, so the switch just required a connection to +v, which would stop the 4067 from functioning.

This switch can be seen on the front left of this view of the outside of the finished unit:

On the rear can be seen the audio out (top) and 5-pin DIN (bottom) which can accept input from the Bigfoot sequencer, or a device compatible with the Bigfoot 4-bit binary note system (e.g. the Chessboard keyboard).

*

Having reassembled everything, it was time to check the devices in operation with the Bigfoot and the Chessboard, plugging them together with standard 5-pin DIN (or MIDI) cables, like this:

Everything seemed to work as expected, and the two units played in unison – or individually if one or other of the enable/inhibit switches were turned off – when operated either by the Bigfoot or the Chessboard.

Click here for a short film of the set-up taken on my iPhone.

 

19
Aug
17

The Chessboard Keyboard

The purpose of The Chessboard was two-fold: firstly, to continue my experiments with alternative keyboards, and secondly to use the ability of the Bigfoot to control a Stylophone (or other sound-producing devices, but so far the only ones I have which are adapted for this purpose are the SoftPot Stylophone and the StyloSound) by means of binary input.

The idea for the Chessboard was that it would have 64 keys, one for each of the black and white squares.  These would not be arranged according to the Janko, Wicki-Hayden or other alternative keyboard layout, as the principle of the Bigfoot is not to provide all the notes in the octave, but just the notes in a particular scale.  So the 64 keys would cover 15 notes over 2 octaves, like the sequencers in the Bigfoot, and note information would be passed to Bigfoot in 4-bit binary form.

I managed to get 64 buttons – tactile switches – for  a few pence each, and glued one to each square on the board.  One side of each button was connected to +V, and diagonal rows of buttons were connected in parallel to produce a pattern of notes in the 2 octave scale, like this:

Chessboard keys 5a

‘1’ means ‘root note’, ‘2’ means 2nd interval, ‘3’ means 3rd interval, etc.  Switches on the Bigfoot determine whether the intervals 2nd, 3rd, 5th, 6th and 7th are major or minor (natural, or lowered by a semitone).  [Note 8 is an octave above the root, note 15 is two octaves above; the 9th, 10th, 12th, 13th and 14th intervals follow the 2nd, 3rd, 5th, 6th and 7th ; the 4th and 11th are not changeable].

Chessboard top

The circuitry to encode the 15 individual notes into binary form was exactly the same as I had recently used in the StyloSound, utilising two 4532 chips and a 4071.  The four binary outputs were buffered by a 4050 before being sent to a 5-pin DIN output socket.

Chessboard keys 5b

LEDs were wired to the  A B C D outputs, to give a visual indication of the binary signal being sent out.  This was also helpful as work progressed in checking the correctness of the output and the smooth operation of each of the 64 buttons.

In fact, I added them into the circuit between the 4532s/4071 and the 4050.  This was an old design from a few years ago, which I’d just got round to finishing: if I was to redesign it now I’d put in a duplicate 4050 – one for the LEDs, one for the output, just to make sure the circuit would operate reliably.  I’ll keep an eye on it and make sure I get the output I’m expecting at all times.

Chessboard LEDs

As can be seen from the photographs, the particular chessboard I used was a small travelling set, which would normally be folded in half, with the pieces kept safe inside.   I arranged it so the board could still be folded and the circuitry – including the battery and the inline DIN socket – retained within.  In the end I replaced the battery with a 3.5mm socket – in common with many of my instruments – as this was a more versatile method of powering the circuit.

Chessboard Closed

The only problem remaining at the end was that the circuit board was not quite thin enough to enable the board to be opened up and laid flat to be played, so some inserts need to be added to raise the base a little higher.  I’ll add a picture when I’ve worked out the best way to do this.

Chessboard inside

04
Aug
17

The MIDI CPU Project – 1. The Hardware

I should have done this project 5 years or more ago!  However, illness, retirement and moving house all conspired to delay my progress.

When I finally came to put into action the plans I had drawn up in 2010, when I bought the module I’m about to describe, I found the device had been discontinued and support was about to cease – a great shame, because Highly Liquid, the company that made the MIDI CPU, were second to none in their support of every type of hobbyist and constructor who used their products (they made some other great devices, too), and their forum was – well, still is, until the end of this year (2017) – a mine of information.

So, my description of my endeavours is unlikely to help anyone embarking on the same project, but it might, on the other hand, be of interest to someone attempting something similar.

[Edit: also, see below for further information on the possible continued existence of the MIDI CPU and other Highly Liquid products (including the MIDI widget, which is the opposite of the MIDI CPU, i.e. a MIDI decoder).  There is a connection with codeandcopper.com, which is run by the same guy, John Staskevitch, and which is home to his current projects].

First of all, then, the MIDI CPU – what is it?

This is what it looks like:

midi-cpu-large_zyevag

It’s a small board, about  7 or 8cm long by 3 or 4cm wide with sufficient components to function as a MIDI controller.  Exactly what kind of MIDI controller depends on you: each of the 24 control terminals along the top edge of the board in the picture above can be programmed via SysEx to perform various logic or analog functions – i.e. they can be configured as switches for notes, switches for MIDI control messages, inputs from potentiometers, pitch and mod wheels, and so forth, whatever your application requires.

The 8 connections on the right-hand side are jumpers to set the MIDI channel, if you don’t want to have to set this as part of the programming.  The 4 pairs of connections are marked 1, 2, 4,and 8, so connecting them to +v or 0v like a binary number will set the channel.  Leaving them disconnected is effectively 0000, binary zero, or channel 1; connecting all of them is 1111, binary 15 (8+4+2+1), or channel 16, and so on.

The 5 connections at the bottom right are MIDI in and out, so the MIDI CPU can be connected to a computer and other MIDI equipment via conventional 5-pin MIDI sockets.

As I say, it’s sadly not being marketed any longer by Highly Liquid, although I see the boards, firmware and detailed information do now appear on circuithub.com and github.com, so it might be possible to obtain one after all, even if you have to solder it together yourself.  It seemed to me at the time an ideal purchase, due to its simplicity and versatility.  The cost was reasonable, around £40, as I recall.  I elected to make it a little more complicated than it needed to be, but you could, with minimal external wiring, create quite a complex MIDI instrument with it – 24 control terminals is plenty for a switch matrix, mod wheels and various other controls.

*

So, what did I do with it?  Well, I had alluded before, in my post on ‘A new use for USB keyboards‘, to a MIDI project which was going to fill up the rest of the enclosure which then included – amongst other things – the PCB out of an old Apple keyboard, and the MIDI CPU was this project.

Some buttons and modulation wheels would be built into the box, but essentially the MIDI CPU board would be accessed via a 25-way socket on the back of the enclosure, so any one of a number of different devices could be attached, and the MIDI CPU could when necessary be reprogrammed to allow for different uses of its control terminals.

*

MIDI CPU inside

This is what the enclosure looked like when I left it, and I now set about filling the top half with the MIDI CPU board and associated circuitry.

The first thing I wanted to do was to add pitch and mod wheels, buttons and potentiometers.

For the potentiometers I used the type with an integral press switch – if the external unit plugged into the 25-way socket had its own, I wanted these to be able to be taken out of the circuit.

For the pitch and mod wheels I bought a set off eBay which originally came from a DX7 or some such.  These were pre-wired and ideal for the purpose – the pitch wheel was properly sprung to return to centre – and were only about £10.

pitch & mod wheels

Conscious of the space problem, I decided on an unusual solution for the buttons: a 16-button keypad.  Although this looked like any keypad, internally it was rather untypical.

Keypads are normally arranged in a matrix pattern, so the output leads are ‘Column 1’, ‘Row 1’,  ‘Column 2’, ‘Row 2’ etc., and each button is in a unique position at the junction of a particular row and column; but this was a special design where each of the 16 buttons, when pressed, was simply connected to a common input.  I connected the common input to 0v, so that a button, when pressed, would be able to ground one of the MIDI CPU’s control terminals.  This is the signal the terminals need to be activated.

As far as momentary button presses were concerned, this was ideal, but to create latching switches – switches that stayed on until pressed again – extra circuitry was necessary.  What I used was a system with 4 ‘flip-flops’, plus a few signal inverters to make sure the flip-flop would be activated by a positive pulse, but the MIDI CPU control terminal would be activated by a negative pulse.  There were to be 4 latching switches, so 4 circuits like this were needed:

Latching switch circuit

Each of the circuits uses half a 4013 flip-flop chip, and half a 40106, which has 6 inverting gates altogether.  The input to the inverter on the left is kept high, so the output of the 4013 is kept low; the inverter in the middle keeps the MIDI CPU control terminal high, and the inverter on the right keeps the anode of the LED low.  In this way the MIDI CPU control terminal and the LED are both off until the switch on the left is pressed; when the switch is pressed the 4013 output changes state, the MIDI CPU control terminal and the LED are both switched on, and stay on until the switch is pressed again and the 4013 changes state again.

I added a 4-way switch so that all the latching buttons could be taken out of circuit if the external unit plugged into the 25-way socket had its own, or didn’t need them.

Finally, I wanted to add a MIDI channel selector switch, rather than rely on  programming to provide the channel, or hard-wire the jumpers on the MIDI CPU board (described above) to fix the channel permanently.

I got this idea from the Highly Liquid Forum.  The selector switch I used was a type of rotary encoder – specifically a hex encoder, which had 16 positions, and 4 outputs, which could output a binary number in each of these 16 positions, going from zero (0000) to 15 (1111).  (I had used one of these before, in creating the Bigfoot automatic stylophone controller).

The beauty of using this particular type of encoder – and they aren’t all the same, by any means – is that each of the 4 outputs is connected to a common terminal when it’s set at 1, but not connected when it’s at 0.  At the beginning (0000), none of the 4 outputs are connected to the common terminal; at the end (1111), all of them are; and in between (e.g. 0101) some of them are and some of them aren’t.  If the common terminal is connected to +v, then the 4 outputs can all be inputs to electronic switches, turning on when set at 1, turning off when set at 0.

A suitable electronic switch is the 4066, which has 4 switches in one chip, just right for the 4 connections which need to be made on the MIDI CPU board to change the MIDI Channel anywhere from 0 to 15, which represents the full number of MIDI Channels 1 to 16.

I also wanted to add an indicator of what MIDI channel was currently set.  To do this I used a chip which you’ve seen me use before, the 4067.  As luck would have it, this chip also requires a binary number from 0000 to 1111 as its input, and for each of these 16 different inputs it connects one of its 16 different outputs to a common terminal.  So, in this case I made the common terminal +v – via a small resistor – and connected 16 LEDS from the outputs to 0v.  In this way, as the MIDI channel changes, a different LED is lit up – no need for them all to have their own LED, as only one of them will ever be lit at one time.

The simple, but effective circuit, looked like this:

MIDI Channel Selector

*

I then needed to connect everything together, and the quantity of components and wires in the  enclosure – as so often with my projects – began to increase rapidly.

IMG_0387 IMG_0388 IMG_0390

The keypad with the white buttons is the keypad I was describing above; in the first configuration I made of the MIDI CPU’s control terminals, the keys with letters play the appropriate notes of the scale: A, B, C, D, E and F; O plays A#/Bb, and 9 plays G; the other 8 numbered keys are divided between latching and momentary switches.

The keypad with the black buttons is not part of the MIDI CPU project: it’s connected to the USB keyboard PCB shown in the first picture of the inside of the enclosure above.  The numbers and letters it produces are useful in applications created with, for example, PureData, where the input can be interpreted in many different ways, as required.

The pitch and mod wheels can be seen on the left and the 16 MIDI channel indicator LEDs on the right.

*

In this view of the partially complete project, you can see 1. the MIDI channel circuit; 2. the MIDI CPU board; 3. the pitch  and mod wheels; and 4. the latching switch circuit.

Interior

The MIDI CPU board needs at this point to be connected to the MIDI in and out sockets and the 25-way socket for the control terminals, and the two keypads need to be connected to the USB keyboard PCB (upper keypad) and the MIDI CPU board (lower keypad).

*

I finished all the remaining interior connections, and the inside now looked like this:

Inside

I removed the excess wiring from the MIDI to USB board (removed from a commercial product, as described in the earlier post linked to above), which is now tucked under the long Apple keyboard PCB on the left-hand side; but the extra wiring from the MIDI CPU board to the internal switches and potentiometers and the external 25-way socket had still over-filled the enclosure!  This view from the outside makes it even more apparent that the box wasn’t going to close:

Back

So I was going to have to do something to make the interior larger before the unit could be used!

Nevertheless, every part of the circuit was now connected up, and it was going to be possible to test it.  I gingerly connected power and switched on.  Lights appeared – a blue light for power, indicator lights where potentiometers were pressed down for on; very bright lights in the centre where latching switches were on; the ‘MOD’ light, to indicate that the ‘Select’ switch for the ‘spare’ control terminal was turned to the modulation wheel position; a light in the MIDI Channel indicator column on the right, and – most crucially – the ‘Activity’ light (not yet labelled, but above the ‘power’ LED), connected directly to the MIDI CPU board, flickered on power up to indicate that it was ready for action.

Front

There was no instrument connected to the 25-way socket – I haven’t yet made any! – but there were enough controls on the box to test a good deal of functionality, including note on and off information from some of the keypad buttons.

Part 2 of this series describes the software, programming and testing of the MIDI CPU box.




andymurkin

December 2017
M T W T F S S
« Nov    
 123
45678910
11121314151617
18192021222324
25262728293031

Enter your email address to follow this blog and receive notifications of new posts by email.