Archive for the 'Modification' Category

26
May
16

Stylophones 5 – The Melophone

There are a number of different instruments called the ‘Melophone’ or ‘Mellophone’.  The one on the left in the picture below (by Kc8dis at the English language Wikipedia) is a brass instrument used in marching bands and the one on the right is ‘a cross between a guitar and a harmonium’, according to the Squeezytunes blog (at http://squeezyboy.blogs.com/squeezytunes/2008/02/melophone.html, from which the pictures came).

Mel(l)ophones

However, this Melophone which I recently acquired, is clearly a type of Stylophone – and a very stylish type of Stylophone at that!

Melophone2

Melophone1

I had never heard of this Melophone before, and found only a single reference to it on the internet.  A glance at the accompanying booklet – which, as you will see below, follows exactly the same style and format as the booklet from a 1960s/70s Stylophone – shows that it was not written by a native English speaker.  The company that manufactured it is (according to this website: http://www.pewc.com.tw/eng/) or was (according to this Wikipedia entry: https://en.wikipedia.org/wiki/Taiwan_Mobile) founded in Taiwan in the 1950s and acquired the name ‘Pacific Electric Wire and Cable Company’ on December 30th 1957.

The company would, therefore, have been in place to manufacture the Stylophone after its invention in 1967.  It looks as though it may have done so for some years as the picture on the box shows a Melophone with the early Stylophone keyboard with the black non-playing sections; just as the Stylophone was updated with a new keyboard, so it seems was the Melophone.

Box

The flap has a sticker on it showing the colour as yellow, which this one is; but other colours were presumably available.

It is, incidentally, not ‘Colour’, but ‘Color’, which may be an indication of the market it was intended for: Asia or America.  There would be no reason why it should not be intended for the UK, as the legend ‘Made in Taiwan’ was commonly seen during that period – except that genuine, British-made Stylophones were available over here, and Dübreq would surely not want to allow or encourage competition.

*

The similarities with the Stylophone – its appearance as well as its booklet – are striking: particularly the distinctively-shaped keyboard with its recess above to hold the stylus.

Stylus01

As can be seen  in the above photograph, the size and method of connection to the stylus are also the same as the Stylophone, and a detailed comparison of the yellow Melophone stylus with a black Stylophone stylus, shows that their dimensions are more or less identical:

Stylus02

Nevertheless, there are significant differences – aside, of course, from its handsome ‘Grand Piano’ shape!

First of all, although apparently identical, the Melophone keyboard is longer.  With a standard Stylophone on top, this can be clearly seen:

Keyboards

There are 2 extra notes at the bottom end of the keyboard, G and G#, and 1 extra note at the top, F – that is, 23 notes in total, as opposed to the Stylophone’s 20.

You can also see in the above photograph that the Melophone lacks the traditional Power and Vibrato switches at the left-hand end of the keyboard.  Instead, the Power On/Off switch is incorporated into a volume control on the top of the Melophone, to the left:

On_Off_Volume

The Vibrato switch is found on the left side, together with a control the standard Stylophone never had – an Octave-change switch!

Side

Using this switch, the range of the Melophone can be extended by another 12 notes, giving the instrument an exceptionally wide range.

Turning the instrument over reveals the battery compartment – like the original Stylophone, the Melophone requires a 9v PP3 battery – and the three screws which need to be undone to access the inside.

Back

The circuit board inside is quite different from the standard Stylophone – and so is the circuit itself: no fewer than 6 transistors can be identified in the following pictures (These are 1 x ED1402A, 3 x ED1402D, 1 x ED1402E and 1 x ED1602E, which are all NPN General Purpose transistors – except the 1602E, which is a PNP):

Inside1

Inside3

Inside4

Inside2

It has no tuning control like the standard Stylophone; I wonder if the top has been removed from one of the potentiometers in the first internal picture in order to make some pitch adjustment.

*

Comparing the Melophone Booklet with a typical Stylophone booklet of the period, the close similarity is evident:

Two CoversRead the Melophone Booklet

Even the two pieces of music at the back of the booklet are the same: ‘Silent Night’ in the key of Bb and ‘The Londonderry Air’ in the key of C, although references to ‘Stylophone’ or ‘Dübreq’ are noticeably absent.

*

One website (http://www.miniorgan.com/lib/view.php?miniorgan=80&view=E&srch=&srch_type=&sortby=&output=14) pictures and describes as ‘another very cheap STYLOPHONE clone’ an obvious copy (which they date to 1976 – the year after production of the original Stylophone ceased, according to the Stylophone Collectors Information Site  at http://www.stylophone.ws/index.html).  ‘Sounds poor and very poor plastic’, they say; but this Grand Piano Melophone seems like a step up from that, in sound and construction.

Here’s a brief example of the tones made by the Pacific Melophone:

Sufficiently Stylophone-like, I’m sure you’ll agree!  The two low notes beneath the Stylophone’s normal lowest note don’t come out too well, though.  I’ll have to see if something can be done about that.

Describing a Hong Kong made Stylophone, the Stylophone Collectors Information Site says ‘Problems were experienced by the Dübreq company regarding patent infringments, but licences were apparently also granted, so it is very difficult to categorise this particular model.’  Perhaps the same can be said for the Melophone: it definitely isn’t a Stylophone, but it seems to me reasonably built and with some very close similarities – was it somehow produced under licence, or just a clever copy?  If anyone has any further information, please let me know.

13
Mar
15

Guitar FXBOX – Part 2, the hardware

In my previous post on the FXBOX, I described a series of PureData patches used for guitar effects, and the need for a Foot Controller to operate it.

I happened to have a suitable case for this project – the remains of a previous mixer project which was never entirely finished. It was a large console-style case, about 18″ square, which I had already drilled with about 80 or 90 holes. The holes were too close together for all of them to be foot controller buttons, but about half of them could be used.

Outside of box DSCF0003

There were to be 4 sections to the controller, which would be: 1. Audio in/out and Audio to USB; 2. Audio to MIDI and MIDI to USB; 3. Keyboard Letters and Numbers, output via USB; and 4. Also via USB, Buttons and Potentiometers from a game controller.

*

1. AUDIO

The audio section was slightly more complicated than it might have been, as I’ve been using a twin-necked (6 and 12-string) guitar, and at some point intend to separate the output of the two sets of pickups.  For this reason, I added two audio input channels to the Controller.

The system basically works so that it can accept inputs either via a 6.35mm stereo socket or separate 6.35mm mono sockets, and can be routed either to a 6.35mm or 3.5mm stereo output, or two 6.35mm mono outputs. Each channel has a separate mono Send and Return, and there is stereo Send and Return covering both channels.

Audio DSCF0012

The 3.5mm output was included simply because this is the normal type of audio input socket on a laptop – which I was using to run Pure Data – and this would remove the need for a 6.35mm to 3.5mm adapter. Internally, there are connections to a Sonuus G2M Audio-to-MIDI converter – described in the next section – and an Audio-to-USB converter.

I took a chance on a cheap Audio-to-USB converter. I tried a few of the very cheapest type (99p on eBay), which worked OK, but I experienced too much latency, and these can only be used when the delay between playing and sounding isn’t important – on automatic or aleatory devices, for example. In this case, the next cheapest type (£2) seemed to work fine.

audio_usb

The intention of the Controller was that all four elements (the Audio to USB , the MIDI to USB, the keyboard numbers and letters, and the gamepad controls) would all be capable of output via a single USB socket. To accomplish this, I added an extremely reasonably priced (£3.95) 7-input USB hub. Given the number of items it would need to cope with, I got a powered one, which came with a 2-amp 5v mains adapter.

The inside of the box was going to be a bit like an enclosed pedalboard, and I simply velcroed this unit in position inside the case.

7 port hub

The hub was connected to a double USB socket unit – the type that would be fitted on a PC – with one socket connected to the type B output socket on the hub, the other one serving as an extra external input.

*

2. MIDI/USB

I added the MIDI section for two reasons: the first was that although MIDI implementation wasn’t really the point of this Controller, it could, I thought, come in handy for later applications, and be a convenient place to house my Sonuus G2M – a monophonic guitar-to-midi converter. The G2M, like the USB hub, was velcroed in place and linked up via internally-connected plugs.

G2M 27589983

Secondly, I’d successfully used a very cheap MIDI-to-USB converter in a previous project (‘A new use for USB keyboards‘), and decided for £3 or £4 that one could be included here. In this case, I didn’t even remove the outer casing as I had done the previous time, but simply shortened the IN, OUT and USB leads to fit and velcroed the unit to the inside of the case.

MIDI Inside box 1 DSCF0001

Audio and MIDI inputs would normally be via internal connections, but I added two 5-pin DIN sockets to the outside of the case. The first was for MIDI Out; the second, via a DPDT toggle switch, allowed input to the converter to be internal or external in case I wanted to connect a MIDI instrument or controller, such as my Behringer FCB1010, use another audio-to-MIDI converter, or decided not to use the G2M inside the case.

MIDI DSCF0012

*

3. LETTERS & NUMBERS

I had worked out for the previous project referred to above how to use the PCB from a defunct Apple keyboard as a means of outputting ASCII codes. The [key] function of Pure Data can be made to interpret and take action on these in any way required. I wanted to include this feature to help in using my looping program, Jesse Chappell’s Sooper Looper.

sshot6

As well as being controllable via MIDI, many of the Sooper Looper functions are controllable by input from the computer keyboard.  I wanted to include a simple system which would output some of the keyboard letters required to record, overdub, reverse and so on.

A 10×4 matrix would output all the letters in the alphabet, and the numbers 0-9, so I could put up to 40 buttons on the Controller (including a couple which represented punctuation marks), but I wouldn’t need anything like 40 buttons for this application.

I started confidently, as before, disassembled one of my collection of broken keyboards and took out the PCB.  It was very similar to the one I had used before: very wide, and with two USB input sockets on the ends – but it was a completely different make! So, I plugged the USB out cable into the computer, got the crocodile clips out, started up Open Office and began touching the matrix points together to see what letters came out – it had an entirely different layout from the one I’d used before!

However, after a certain amount of testing, it became clear that the matrix lines were essentially the same, but just in a different order on the board, which meant I could still get the 40 letters and numbers I wanted, and the pinouts on the sockets I planned to use (15 pin DIN HD) would still be compatible with the unit I had previously built.

In fact, it didn’t really matter about compatibility, as this would – at least as initially conceived – be a self-contained Controller unit, but I wanted to keep things consistent across my range of devices, and perhaps at a later date allow for an alternative or supplementary control unit to be connected to the Foot Controller.

I carefully connected the appropriate pins of the matrix to a ‘break out’ board, to which I connected a 15-way PCB header.

Apple PCB DSCF0004

This would make it a relatively simple job to connect buttons later.

*

4. GAME CONTROLLER

Again, I had used a game controller before, for the Theresynth/Cybersynth project, using the PureData [hid] function; but this time I needed to be more ambitious and use the joystick potentiometers as well as the buttons.

Of course, there are companies which produce USB controller modules, mainly for arcade controller enthusiasts, for example Ultimarc: http://www.ultimarc.com, and GroovyGameGear: http://groovygamegear.com.  The best value seemed to be the ZD (Zero Delay) Arcade controller, which is readily available on eBay.

Arcade Controller

I bought a couple of these two years ago at £8 each, but they seem to be even cheaper nowadays.

Good though they are, however, these units are limited to 12 buttons and two potentiometers.  Game controllers tend to have quite a large number of buttons – especially if you include the hatswitch buttons – and potentiometers on a single circuit board.

I needed 18 buttons, so I decided to use a game controller board for this part of the project.

There are a number of explanatory articles on the internet, such as this one: http://kevinreems.com/WorkShop/Joysticks//, and a lot of valuable information on this forum: http://forum.arcadecontrols.com/, as well as a few videos on YouTube. I like this one, which, although not captioned in English, is nicely visual: http://www.youtube.com/watch?v=9Y6ZqgT4Uk0.

Even Nic Collins’ classic book Handmade Electronic Music [http://www.nicolascollins.com/handmade.htm] has a chapter on the subject.

There are many different makes and models of gamepad, and one thing I’ve learned is that they’re all different – or liable to be different – in their electrical connections, so a certain amount of cautious experimentation is required to find out, for example, whether button connections are made to ground or some other voltage value in the circuit; if they’re arranged in a matrix; or if there’s a mixture of different systems. Sometimes this can readily be determined by looking closely at the circuit board and following the tracks around, sometimes it can’t.

So, if you’re reading this for hints on how to make the connections, use it as a guide to the type of thing you may need to do, but you may not necessarily be able to copy the steps precisely.

The other thing to note is that the connections on these PCB’s are usually very delicate, so you need to proceed carefully to avoid the narrow copper tracks coming away from the board.

As far as my gamepad was concerned, I used a Nyko Airflo, which was around £5 on eBay.

I removed the outside and an internal plastic piece which supported the two main PCBs and the fan which gives the Airflo its name.

Disassembled 2 IMG_1647

The idea was to reconnect the gamepad’s buttons to buttons on the FXBOX foot controller, so I detached the fan and looked for the button connections on the PCBs.

PCB 1 & 2 IMG_1650

Four of the 12 buttons were on their own mini-PCBs, connected by wires to the main board; the function of the wires was marked on the board, so I cut off the small PCBs and left the wires.

The various hatswitch connections and 6 of the remaining buttons were on the main board. These all had suitable spots in the copper tracks where it would be possible to solder wires.

The remaining two buttons were part of the joystick assembly on the second main board. It was easy to see the connections, and as the buttons were normally open (not connected), it would just be necessary to connect wires to the two sides of each one – or one side if the buttons all proved to have a common side, which is the usual practice.

I also needed to use the 4 potentiometers, two on each joystick, and wasn’t looking forward to de-soldering them, as I was anxious about damaging the tracks on the board. It doesn’t look too difficult on the videos, but I noticed on mine that there was small gap above the board where you could see the three legs of each potentiometer – the small ‘preset’ type – just enough room to insert a hacksaw blade and cut them off.   This is what I planned to do.

pots

First, as with the other devices in the Controller, I needed a much shorter USB out cable to connect to the hub, so I shortened the lead, but reconnected it before going any further, as this would be needed for testing.

The next step was to bring out the button connections to a ‘breakout’ board and find out exactly which ones I needed.

In most cases – perhaps all – I was sure that it wouldn’t be necessary to use 2 wires per button, as I had done with the Cybersynth; one side of the button connection would usually be Ground, and I hoped it would be possible to use one Ground connection for all of the 12 buttons.

This did prove to be the case, and I didn’t have the problem reported by some others of the unit not working at all without the joysticks connected.

I connected the 13 wires (one for each button + one for Ground) from the gamepad board to the breakout board, and a 13-way PCB header to give easy access to them.

The hatswitch connections looked as if they might be the same – except that there were 4 buttons, and I knew that 8 separate outputs are available from a hatswitch, meaning that 4 outputs were available from the 4 buttons individually and 4 outputs were available by connecting adjacent buttons simultaneously.

To make it easy to access these 8 outputs with 8 separate buttons, I connected diodes like this: hatswitch diodes

The connections at the top go to buttons in the Controller, and connections 1, 3, 5 and 7 at the bottom go to the 4 button positions on the circuit board; connections 2, 4, 6, 8 and 9 don’t need to be connected directly to the board.

This arrangement means that, for example, pressing Button 1 activates only Button 1, and pressing Button 3 activates only Button 3, but pressing Button 2 activates both Buttons 1 and 3 at the same time.

Only adjacent buttons are meant to be connected at the same time, which is why a hatswitch has 8 different outputs; but I discovered that connecting any two non-adjacent buttons on this particular board produced a ninth different output, recognised by PureData, which is why a ninth button is shown.

As a Ground connection was already available on the breakout board, I only needed 9 further connections for the 9 hatswitch buttons. This meant that 21 separate buttons would be available altogether.

*

The next task was to replace the two 2-axis joysticks with 4 potentiometers. Two of these would eventually be footpedals so that certain settings – volume and pan, for example – could be adjusted while playing.

I started by cutting through the legs of the existing potentiometers, as described above.  Once cut off, the potentiometers were easy to remove, exposing the three connections for each one.

Tracing the lines on the PCB, I could see that the ‘top’ and ‘bottom’ connections of each one were the same: only the middle pins had individual connections.

The bodies of the joysticks didn’t need to be removed from the board – and in fact were best left where they were, as some Ground connections from one part of the board to another appear to made through them.

I knew the potentiometers were likely to be more difficult to make use of than the buttons, but I was puzzled that I wasn’t able to get them working easily when I connected them to the board. For some reason they didn’t move smoothly from zero at one end to 255 the other as they were supposed to; on occasions they would return to zero and then refuse to move.

In the end, I read something that doesn’t seem to be mentioned much in articles on gamepad hacking, which seemed to be the root of the problem: joysticks are sprung to return to the centre of their travel, so a gamepad is expecting a midway reading on each one when it’s plugged in, and calibrates itself at that point to make sure the joysticks go back to the middle when let go. If potentiometers are used, and left at random values when the unit is plugged in, then the gamepad will get confused, try to calibrate itself wrong, and consequently fail to work properly – or at all.

The value of the joysticks in my gamepad was 100k, and they looked to be connected as voltage dividers, with the ‘top’ and ‘bottom’ tags all connected together, so, assuming these were +v and 0v (although it doesn’t really matter what they are) – I created a midpoint 50k from the top and 50k from the bottom (two 100k resistors in series = 50k). This would be connected to the centre tags of the potentiometer inputs to the board when the unit was turned on, the circuit would be calibrated, then the actual potentiometers could be connected and would correctly produce values from 0 – 255.

The writer of the article quoted above [http://kevinreems.com/WorkShop/Joysticks//] had a neat solution to this, using switched jack sockets, but I wasn’t able to use this method, as I wasn’t always going to be plugging into sockets. Instead, I connected the centre tags of the four potentiometer inputs to the centre tags on a 4 pole, two-way switch: this switch would be in the ‘off’ position when the unit was plugged in, which would connect the inputs to the ‘halfway’ voltage, enabling them to be calibrated, then when the unit was ready to be used the switch would be moved to the ‘on’ position, where the potentiometer inputs would be connected to actual potentiometers.

As a result, I ended up with a breakout board with 12 pins representing the 12 buttons numbered on the board, 9 pins representing the hatswitch buttons, 4 pins representing the 4 potentiometer outputs, and 3 pins representing +5v, 0v and +2.5v.

I also used 2 further pins for the game controller LED which lit up when the USB connection was made: I connected these to an LED on the outside of the case where I could see it and verify that the board was working.

That made 30 pins. Even when I calculated that I needed only 6 of the 9 hatswitch buttons, that still made 27 pins, plus 15 pins from the Apple keyboard PCB described earlier.

All the connections needed to be in place while the case was still open, so I needed to join all these pins on one side of the box where the circuit boards were to connectors on the other side of the box where the buttons were. To bridge this gap, I decided to use 40-pin ATA cables, normally found inside a desktop PC, which are inexpensive and compatible with the PCB connectors I was using.

ATA cables

These cables (as in the above picture) frequently have two separate connectors quite close together at one end. This made it easier to make connections not only from one side to the other, but also to special output sockets on the back of the case.  These could be used if alternatives were required to the buttons on the unit.

The 15-way socket on the back of the Controller has the same pin designations as my previous keyboard PCB-based project; the 25-way socket is a new arrangement, specific to the game controller:

Keybd & HID out DSCF0012

*

Finally, there was one downside with internal fixing of the Sonuus G2M ‘Guitar to MIDI’ unit – it runs off a PP3 battery: this would mean firstly that the ‘Battery low’ indicator couldn’t be seen from outside the case and secondly that the battery couldn’t be changed without taking the case apart. As this is held together with about 10 self-tapping screws, this would be too much trouble.

The main electrical supply was the the 5v adaptor that came with the USB hub, so I bought a small step-up voltage module for a couple of pounds to provide a 9v supply for the G2M.

voltage converter

I adjusted it to slightly over 9 volts, to make sure the G2M would be operated reliably and added a second power on/off switch for the 9v supply.

*

This is the almost finished base of the unit, showing the 7 elements.  All the connections are in place, except the power connector lead, which runs from connector 7 in the picture over to the power switches on the front of the unit:

Inside captioned IMG_1397

1: MIDI to USB

2: 7-port USB hub

3: Audio to USB

4: Apple keyboard PCB

5: Sonuus G2M, Audio to MIDI

6: Gamepad PCB

7: Power connector

This is the almost complete top section:

Top captioned IMG_1395

I gingerly put the two halves of the case together, and all the functions seemed to work, so I screwed it firmly together.

Now, with minimum use of the laptop keyboard, I was able to control the Looper with the buttons on the Top Panel:

Top Panel DSCF0009

and the FXBOX PureData program with the buttons on the Front Panel:

Front panel DSCF0010

I left space for additional button descriptions as the unit isn’t limited to controlling the Sooper Looper and FXBOX: in fact, it could be used to control any PureData patches which required [key] or [hid] inputs.

In addition to this, I had made provision on the front of the case for 4 footswitches which could duplicate the effect of any of the buttons on the panels:

Front DSCF0011

So far, I have just implemented two of the four possible: Footswitch 1 duplicates the ‘Overdub’ control in the Looper; Footswitch 4 duplicates the FXBOX ‘Freeze’ control.

I obtained some very nice momentary footswitches for only about £3 each from eBay.  They are apparently intended to operate tattoo machines, and have the advantage of coming with 1/4″ (6.35mm) standard mono jack sockets attached, perfect for this application.

tattoo switches

As for the footpedals, I haven’t implemented those yet.  When I do, I’ll describe this in a further post.

04
Nov
13

Fun with the Apple IR Remote, Part 3: Additions

In the previous post in this series, I dismantled and modified a white Apple infrared (IR) Remote control.

In this post I describe a foot controller which can be plugged into the DB9 socket on the modified remote, and then go on to consider what you can do if your Mac doesn’t have an IR receiver built in.

I had already constructed a very simple foot controller, which I had used with the Superstylonanophone.  The controller was  – well it was exactly what it looks like: a length of plastic guttering with a few push switches inserted into it, and a multi-way socket.

Footswitches1

There were just 4 buttons on the foot controller: two for bass drums and two for hi-hats.  These were connected very simply underneath: one side of each switch was a common connection, the other sides went to 4 appropriate pins on a 15-way D socket.

Footswitches2

It occurred to me that the same controller could also be used for the IR Remote, which also required a number of push switches with a common connection.  There would need to be more of them – at least 6 – and an alternative 9-way connector, but provided both connectors weren’t used at the same time, the controller could operate either device.

I had some spare buttons of the same type, so I added 3 extra ones in the spaces between the 4 originals (not in a very straight line between the 4 originals, it has to be said!), a new DB9 connector, and an LED which would come on when the foot controller was connected to the modified remote.

Outside DSCF0004

Only 6 of the buttons were required to duplicate the functioning of the Apple remote.  Using my IR Remote Tester in iRedLite, I verified that all the button presses – short, long and double – were being received and transmitted correctly from the six buttons I had wired up.  I connected the seventh so that the LED – which can be seen illuminated at the bottom of the picture – would go out if it was pressed, as a warning that it had no function.

Inside DSCF0003

I moved the bass drum triggers to the two leftmost buttons, and hi-hat triggers to the two rightmost.  At some point, when I revisit the Superstylonanophone, I can consider adding in further drums as there are now 3 spare buttons in the middle of the controller.

Connection DSCF0002

*

The foregoing is all very well if you have a MacBook, MacBook Pro or whatever, which has a built-in IR receiver – but what if your Mac doesn’t have this capability?

Fortunately, if this is your situation, all is not lost.  As I implied when discussing Joystick and Gamepad Tester, the Mac’s IR receiver is part of the USB system – this can be verified by checking the machine’s System Profiler:

system profiler ir receiver2

So, to add IR control, the ideal thing to get hold of would be an Apple IR receiver module which has a USB connection.

Luckily just such a device exists!

There may be a number of these, but the one I got was either Apple part number 922-7195 or 922-8355, not sure which: one is from a MacBook 15″, the other from a MacBook Pro; both have an IR receiver input and a USB output, so I daresay both would work equally well in this application.

IR Rec module IMG_0679L

I bought mine here: http://www.powerbookmedic.com/MacBook-Pro-Infrared-board-p-18041.html at a cost of less than £10, including postage from the U.S. – a bargain!

I got the idea for this part of the IR project from this article: http://photos.pottebaum.com/2009/IR.  The aim was to install this module in a new case with a USB lead, thus enabling a Mac with no IR receiver to benefit from the remote, or to use  the remote at a distance or from an angle where a direct line of sight to the computer wasn’t available.

The new case I chose was this one:

IR REC front IMG_1567

It’s a Fisher Price ‘CD Player’.  It doesn’t, in fact, play CDs at all, but I picked it partly because of a definite stylistic connection with the modified Apple remote described above, partly because of its large front ‘window’ – which might allow for a certain degree of repositioning of the IR receiver inside – and partly because it was powered by three AA batteries, somewhat similar to the 5v provided by USB.

IR Rec back IMG_1568

I undid the 6 screws in the back (four of them are already out in the above picture, the two at the top remain), revealing the internal structure.

IR Rec inside IMG_1571

It was very well made, and very difficult to get apart as a matter of fact, as the two large white surfaces you can see were glued together.  It looked like blobs of a sticky adhesive which stretched when pulled, so I was able to prise the two halves apart slightly and cut the glue with a craft knife.

The speaker is visible in the top right-hand corner.  One of the three circuit boards in the unit can be seen at the bottom of the back section; the other two are underneath the two sides of the front section.

Circuit boards IMG_1569

The 8 press switches that can be seen on the tops of the circuit boards are operated by the 4 buttons on the front of the unit.  The switches are in pairs and the two switches in each pair are identical.

I tested each switch in turn and noted their outputs.  They worked by cycling through a number of samples: a short bell-like tune, some spoken phrases (‘Sing with me!’, ‘Oh, yeah!’ and ‘Let’s Boogie!’) and some longer songs with voices and instruments (‘One, two, buckle my shoe’, ‘Itsy-bitsy spider’, ‘Row, row, row the boat’, and some songs that sounded as if they may have been specially written for the unit).  Three of the pairs had a 9-step sequence, one of them a 6-step.

I wasn’t, in this instance, interested in the songs, as I wasn’t intending to circuit bend the device, but I wanted the LEDs to come on when IR input was received.  The best LED display was seen while a song was playing; during the bell tune and the spoken phrases the lights came on only for a short time.  The sequences weren’t the same for each button, and I decided that button three (bottom left)  was the best one to concentrate on, as there was a higher proportion of songs in the sequence compared to short phrases.

Steps in the sequence were initiated simply by a short +V pulse to an appropriate point on the PCB, which should be easy to generate.

*

First of all, however, I needed to connect up the IR receiver module.

Being color-blind, I’m always nervous about connecting up colour-coded wires – especially to a USB plug which would be going into my laptop.  However, the module seemed – to my eyes at least! – to follow the conventional red-white-green-black USB wiring scheme (+5v, Data +, Data -, Ground, in that order), so I snipped off the small 4-way connector it came with and connected the four wires to a short length of multi-core cable.  The other end of the multi-core cable was connected to a USB plug, via a small PCB connector.  There was no PCB: this was just a convenient way of joining together various wires – the four USB wires, power leads from the batteries and some others I’ll explain shortly.

So, the Apple IR receiver module was connected to a USB plug.  I didn’t want the unit to have a long lead trailing out from it, so the lead to the plug was kept very short, and plugged into a small USB hub which I fixed to the battery compartment lid on the back of the unit:

hub IMG_1585

hub 3 IMG_1587

It was an excellent little hub – only £2 or £3 on eBay, and capable of being powered, if required.
Now ready for testing, the unit looked like this:
Back&Front_IMG_1603

The new receiver module can be seen lying in the middle of the front of the unit.  The short USB lead and plug can be seen emerging from the back, and at the bottom of the picture the mini-USB lead goes from the hub to the laptop.  The purpose of the three unused wires in the multi-core cable is explained later on, and is not to do with the Apple receiver.

Checking in the System Profiler, I now saw two IR Receivers instead of one:

System profiler 2510

I experimented simply by covering up one or other of the receivers and making sure, using iRed Lite, that my remotes – especially the new modified one – were able to control various functions in Safari and would print the correct numbers in Text Edit.  The two receivers seemed to work in tandem on the MacBook – it didn’t matter which of the two I covered up, the other would immediately register the button presses and carry out the required function.

*

The vital question was: what would happen if I connected the unit up to a computer that didn’t have a built-in IR capability?

I started with my eMac, which runs the same OS as the MacBook, 10.5.8.  I checked the System Profiler – no mention of an IR receiver; then I plugged the unit in and was gratified to see the IR receiver shown (I needed to close the System Profiler and reopen it to make the new device show up):

eMac before&after IMG_1605

I didn’t have Joystick and Gamepad Tester or iRed Lite installed on the eMac, so I had to content myself with testing the functions the remote normally performs on a Mac – opening and closing Front Row and turning the volume up and down.  Using the new modified remote, I confirmed that it would do this.

I then tried the same procedure on an old G5.  I can’t remember what OS it uses, but I think it’s either 10.5 or 10.6.  Once again, using the System Profiler, I verified that no internal IR receiver showed up at first, but when plugged in the new device was registered:

G5 before and after IMG_1608

The one thing that did appear first of all in the USB section was my iPazzPort.  I’ve described in a past post what this is – a very handy little device, no more than 4 or 5 inches tall, which duplicates the function of the keyboard and trackpad:

iPazzPort_IMG_1607

As can be seen, it connects via USB – not a problem, even on the G5, which only has one USB socket on the front, as I was able to plug it into the hub on the back of the new receiver and use the two devices together.

Once again, the remote worked exactly as intended, proving that IR functionality could be added to a Mac which originally had none.

*

I didn’t immediately reassemble the unit, as there were a couple more things I wanted to do with it.  First of all, as mentioned earlier, I wanted to include a method of making the lights flash when an infrared signal was received from the remote.  As described, this needed something to give a +V pulse when the signal came in.

I didn’t want to interfere with the Apple receiver module, so added a second IR receiver like this:

AX1838

This device, an AX1838, has three leads: two for the power supply, with the third giving an output when it detects an IR input.  It wouldn’t be necessary to interpret the input – which is what the Apple module does – just give an output pulse on receipt of a signal.  Unfortunately, according to the data sheet, the output of the device goes low when IR input is detected, not high, which is what the ‘CD Player’ circuit requires.

I was under the impression that the low level output from the device would be sufficient, when inverted, to operate the switch in the CD Player, but this wasn’t the case.  In the end I looked around at circuits for simple infrared-operated switches, and used an adapted version of this one, using just three components, a BC588 transistor, a 22μF capacitor and a 100k resistor.

Apart from the existing electronics concerned with playing the samples and sequencing the lights, the electronics I added to the device looked like this:

IR Receiver Electrics Revised2

In fact, this is what I intended, but as I didn’t have a 100Ω resistor, I added a 470Ω instead.  I don’t know if this was too large a value, but I’ll find out when I come to use the wii later.

I didn’t bother with a piece of stripboard, I just wired everything up to the three legs of the transistor.  This addition to the circuit seemed to have the desired effect: the output of the transistor is normally kept low; an incoming IR signal is detected by the AX1838 and as the capacitor charges up the multiple signals are smoothed out into one.  The output of the transistor goes high and is boosted to a level sufficient to operate the CD Player switch and turn on the lights, giving a visual indication that an instruction has been received by the Apple IR receiver.

Stiff wires were attached to the two IR detectors, anchored inside the unit, so the detectors could be repositioned within the CD Player front window.

*

Finally, while on the infrared theme, I just had two more things to do  before reassembling the finished unit.

Firstly, I added two infrared LEDs to the front of the unit.  These had nothing to do with the receiver or the flashing lights: they’re a little closer together than the original, but they’re designed to duplicate the function of the wii ‘sensor bar’.

IR LEDs IMG_1609

I’ll be blogging about the wii system later, but the ‘sensor’ bar’ is a most inaptly named device, since it doesn’t ‘sense’ anything at all, but instead provides two points of infrared light which the wii remote controller – or ‘wiimote’ – uses to fix its position.  Being a little closer together than the Nintendo original isn’t a problem – the wiimote might just think it was further away from the sensor bar than it really was.  As I’m not proposing to use my wii controller for playing sports, I don’t anticipate a problem with this.  Further information will appear in my wii posts.

The new infrared device had one more secret, hidden in the carrying handle:

Candles 1 IMG_1612

There are many reports on the internet of wii users who have substituted candles for infrared LEDs when using their wiimote, so I thought I’d guard against battery failure in the unit by adding candle holders – the kind you buy for birthday cakes.  Believe it or not, this does work!

*

Front & Back

After reassembling the unit, and thinking again about the wii remote, I added an extra external item to the USB hub: a tiny Bluetooth dongle.  I found this in Poundland, for £1 (obviously!) and thought for that price it would be worth experimenting with.

22
Oct
13

Fun with the Apple IR Remote, Part 2: Modifications

In the first part of this series of posts, I described the Apple infrared (IR) Remote system and some software which allows you to use the IR signals for controlling apps on the Mac.

In this post I take a closer look at the Remote controller itself, and describe the way I modified mine.

I must say that I’m not familiar with the silver aluminium remote, although I have no reason to believe it’s substantially different on the inside from the original white remote.  This is the one I have experience of.

What’s good about the white remote is also what’s bad about it – it’s very tiny.  This is great if you just want to tuck it away somewhere and not have a bulky TV/DVD player-type remote to lug about, but not so good from the point of view of it easily being overlooked or mislaid.

So, one reason you might want to modify the remote is to make it larger and more suitable for the human hand.

Frankly, the most cunning solution to his problem is the one described here by Brad Moon.  I hope he won’t mind me using his picture:

Remote wood block

Yes, what Brad has done is simply to glue his Apple remote to a hand-sized piece of wood.  Job done!  As he says in his blog post: ‘Too big to lose, too big to slip behind a cushion or slip into a pocket . . . The Apple TV remote hack has been in place for roughly a month.  In that time, the remote has been lost exactly zero times.’

This certainly takes care of the problem of the unit itself being rather small, but to address the problem of the size of the buttons themselves and their awkward layout, the unit has to be taken apart.  At the time of writing, you can still get hold of these white remotes on eBay for about £3, so if you want to try this, there’s no need to sacrifice the one that came with your Mac.

This is how it’s done:

1_IMG_1533

The picture above shows the unit and the tool (or maybe one of the two tools) you need to open the remote unit.  This is a small Philips or crosshead screwdriver.

As well as being used in a moment for taking out screws, the first thing you can do with it is poke the small depression on the right-hand side of the base of the remote unit.  This releases the battery tray, which pops out on a spring:

2_IMG_1534

Next, you have to undo a screw which is right down inside, next to the release button:

3_IMG_1536

Undo the screw and take it out:

4_IMG_1535

The next bit is the most difficult.  On the opposite side – the lower side in these pictures – is the spring which pushes the battery compartment out.  The spring is firmly attached to the bottom of a small piece of plastic, and you have somehow to grab this piece of plastic and pull it out, with the spring on the bottom of it.

The next picture shows what the spring and the plastic piece look like.  You might reach in and grab it with tweezers or narrow long-nosed pliers, but it’s right up against the edge of the case, and hard to get hold of:

6_IMG_1538

If you look at the full-size version of the picture, you can see that the piece of plastic has tags on it, so I was able to poke the screwdriver under a tag and drag the plastic and spring out.

Underneath where the spring was is another small screw.  Unscrew this and take it out:

7_IMG_1539

You can then pull the battery compartment out.  I did this with a pair of narrow pliers, gripping the white release button, which you can see in this photograph.

8_IMG_1540

Then you can push out the remaining parts left inside the case.  I did that by inserting the screwdriver here:

9_IMG_1541

The circuit board, with the springy battery connectors behind, slid out very easily:

10_IMG_1542

You can carefully detach the end  piece from the circuit board, clicking it off the tabs which hold it in place over the end of the board and the IR LED:

11_IMG_1543

This an exploded view of the remote, with all the parts visible:

11B_IMG_1547

Putting it back together, of course, is the reverse of this procedure.  The trickiest part is undoubtedly getting the spring and its plastic top back in.  This video by Andrew Williams, to which I’m greatly indebted: http://www.youtube.com/watch?v=vuP6CH770NM shows a remote being put back together, and explains the direction in which the tabs must face – front and back – for the plastic piece to go back in the correct position.

*

I wasn’t interested in putting it back together again, so I looked more closely at the circuit board:

12&13_IMG_1545&6

You can see in the top part of the picture the infra-red LED and the 6 buttons.  You can also see 4 screws which attach the circuit board the the plastic fitting.

The first thing to do was take off the six silver ‘domes’ which make the contacts when the buttons are pressed, and see what connections they made.  These are often, in my experience, attached together to a transparent sticky sheet which peels off, and so it was in this case.

Remote PCB IMG_1554

As you can see from this photograph – taken after I’d removed the four small screws holding the PCB to the plastic fitting – each button makes a contact between an outer ring and a centre spot.  All the outer rings were connected together, to what looked like +V, while the six centre spots were separate.  What I wanted to do was transplant the board into a larger unit, so I needed to solder seven wires to the board, and connect them to buttons in the new unit.

The larger unit I’d chosen was this one:

vtech_tinytouch_phone

This is a vtech Tiny Touch Phone: it’s powered by two AA batteries – 3v, same as the Apple Remote; has 12 buttons – exactly twice as many as the Remote, which could be handy for dissociating short, long or double presses; and has flashing lights – which is always good.  It also makes sounds, and under normal circumstances I would be looking to ‘bend’ these, but in this instance making noises wasn’t what the project was all about, so I decided I’d remove the sounds completely by taking out the speaker.

The Phone also has a hollow plastic ‘antenna’, which was perfectly placed for installing the IR LED.

aerial

This is what it looked like inside.  In  this picture the large mechanical unit, which looks like the film sprockets in an old 35mm film camera is obscuring the speaker housing.  With the speaker removed there looked as though there’d be plenty of room for the small Apple Remote PCB there.  The wires for the LED could easily pass from there up into the antenna.

Phone inside IMG_1552

The general idea would be to rewire the button connections on the Apple Remote PCB to the Tiny Touch Phone buttons.  The Phone buttons (visible in the first picture above) are, however, hollow, and make connections with a membrane, rather like  QWERTY keyboard, via their edges .

I wanted to leave the membrane intact, to operate the flashing lights, so I decided to add small tactile switches with longish 3.5mm actuators which would be glued in the hollows with the actuators sticking out through a hole in the top of the Tiny Touch buttons.  It was these switches which would actually operate the IR remote.

Gluing these in without gluing them together so they wouldn’t function proved difficult.  Letting superglue anywhere near them – even the gel type which I usually use – could prove fatal, as it has a habit of running everywhere.  In the end I used epoxy, which is stickier and less runny, and tiny pieces of tissue paper soaked in epoxy to keep the switches in place.  The moon and star buttons aren’t hollow, so I stuck tactile switches with short 1mm actuators to the top of them, on the outside, with wires running in through a small hole.

In the end I only connected up the star: it would have been difficult to make the hole in exactly the right place in the moon and route the wires inside without disturbing the membrane too much.  The star operates the ‘Menu’ button, which is less important than the others and doesn’t require more buttons to distinguish types of presses.

Buttons IMG_1550

In the event, all but one of the tactile switches worked after this treatment, which was OK, as there were two new buttons for each button on the original remote, so all functions would still be available.

To modify the new unit, I first removed the speaker and replaced it with a resistor (two 22Ω resistors in parallel, actually, as I had these lying about.  I didn’t have any 8Ω resistors to match the speaker, but 11Ω, I reasoned, was close enough).

This created enough space in the top of the unit for the small Apple remote PCB.

I reinstalled the buttons in their places and connected the tactile switches together.  One side of each switch was connected to +3v, the other sides of the switches were connected together in pairs (except the moon, as explained above).  This made 7 extra wires running down to the bottom of the unit.  The presence of the wires might have an effect on the operation of the TouchPhone’s original buttons, but this wasn’t important as their only function now was to light up LEDs when the remote was operated, a feature which Apple neglected to provide in the original.

Buttons_connector_IMG_1574

As can be  seen in the above picture, there was just about enough room for a 9-way D socket in the base of the unit.  I put this in partly because it would allow for external operation of the 6 remote buttons – perhaps by means of a footswitch – and partly because it provided a handy link point between the tactile switches and the Apple remote PCB.

To attach the remote PCB, wires were connected to the centres of the 6 switch points, and one of the outer rings, which were all connected together on the board.  3v and 0v power cables were connected to the springy metal pieces which formerly connected to the coin-battery in the original remote housing.  These connectors were shortened in order to fit the PCB neatly in the space where the speaker had been.

PCB_LED_IMG_1577

At the same time I detached the infrared LED and put it on the end of a longer lead, so it would reach to the front of the unit when in operation.

At this point everything was connected up, although not back in place, so I made a quick check, using iChat and the laptop camera in the way described before.  I pressed all the buttons in turn, pointed the unit at the camera, and watched for the infrared LED to come on.

When I was satisfied that it did so, I replaced the membrane and the TouchPhone PCB, as this would make pressing and testing the buttons a great deal easier.

*

For the next step I needed a way of thoroughly testing if the remote worked as intended.  I did this by creating a Tester program, using iRedLite.

It takes quite a few steps to create a ‘Layer’ – a set of instructions for each remote button – in iRedLite, but this is how I created a ‘Remote Tester’.

The ‘Menu’ button has special functions in iRedLite, but the other 5 buttons respond to short presses, long presses and double presses, so 15 separate instructions would be required.  What I decided to do was use Text Edit, and simply have it print the numbers 1 – 15, according to which remote button was activated.

Step 1 was to open iRedLite.  You can set it up in various ways in the preferences, but I have it set so it just opens an icon in the menu bar:

1 iredlite menu bar

The first step is to select the Editor from the drop-down menu:

2 Show editor

This brings up the Editor screen.  The top half of the window is a copy of what iRedLite calls the OnScreen Display (OSD).  The bottom half allows you to edit Layers and Buttons, and select the actions the buttons perform.  I began by creating a new Layer for my Text Edit actions:

3 New Layer

Then I entered the details of this Layer:

4 Name new layer

I typed a name for my Layer into the ‘Title’ box, and then made choices about what would happen when the Layer was selected.  I chose not to have the Layer activated when I switched to Text Edit, in case I wanted to type some text while using iRedLite with another application; but I did choose to have Text Edit activated when I switched to this Layer, because the actions all required text to be typed in it.  I have several remotes, so to be certain which remote was being tested, I set it to respond only to a particular one: in this case, the one with the ID No. 214.

Having finished creating the Layer, I clicked on the small arrow in the bottom right-hand corner of the Editor window.  I believe they call this the ‘Expert’ button, but it’s simply for accessing the section where actions are created and organised.

5 Editor window

Clicking this button opens the right-hand side of the Editor.  In here, if you look in the ‘Application’ column and can’t find the application you intend to use the remote with, click the ‘+’ button at the bottom of the column to add it to the list:

6 New Application

Type the application name in the box which appears.  The program will be recognised if its name is written the same as it would appear if you moved your mouse over it in the Dock.  Text Edit is actually written ‘TextEdit’, so that’s what I typed in the box:

7 Type New Application

Next you have to create a ‘Group’ – not for any special reason, I don’t think: it just works that way.  If you create a lot of actions for one particular application, this allows you to put different types of actions together, i.e. Keystrokes in one Group, AppleScripts in another, and so on.

I just wanted keystrokes, so I created a group called ‘Keys’.  Group names are your personal choice.  Once again, I clicked the ‘+’ sign under the ‘Groups’ column, and typed ‘Keys’ in the box which appeared.

8 New Group

Then it was time to create some actions.  Each action is entered individually, so I had to click on the ‘+’ sign at the bottom of the ‘Actions’ column 15 times, name the actions in the boxes which appeared, and specify what was to be done.

They were all more or less the same, and this is an example:

9 Create actions

Click the ‘+’ sign; name the action – again, this is entirely your choice: I just called them ‘1’ to ’15’; type the name of the application, or choose it if it appears in the drop-down list; check the box if you need the application to come to the front – which I did, because I wanted to read what it had printed; and type in what keystroke or keystrokes should be made.

Allocating the actions to the buttons is just a matter of dragging and dropping the action onto the appropriate button, and clicking ‘Assign Action’:

10 Drag and drop

The button will be given the name of the action – in this case ‘1’, which is the name I had given to the first action, which was to print the number 1.

11 Button number 1

You can rename the button, and I did, calling it ‘1/2’.  This is the reason why:

iRedLite shows the pattern of buttons in the way that it does to indicate that the button nearest the centre performs the short press action (which they call ‘Action on click’), while the button on the outside performs the double press action.  In reality, of course, these actions are performed by pressing exactly the same button on the remote, but it makes it clearer to see which number of presses produces which action.

So the ‘short press’ and the ‘double press’ are specified, but the ‘long press’ action (which they call ‘Action when holding’) remains to be allocated.

I decided to add the long press action to the instructions for the inner buttons, so in the example below I selected the appropriate inner button (Action 4, the ‘+’ button on the remote) and the ‘Advanced’ tab.  This allowed me to drag and drop the action I wanted to be performed as the long press action, printing the number ‘5’.

12 Button 4_5

I added a long press action to buttons 1 (the ‘Left’ button on the remote), 4 (the ‘+’ button), 7 (‘Right’), 10 (‘-‘) and 13 (the centre button) and renamed the buttons in iRedLite accordingly (‘1/2’, with ‘3’ being the double press action for that button on the remote; ‘4/5’, with ‘6’ as the double press, and so on).

When I’d finished, the set-up looked like this:

13 Finished

Note the button in the top right-hand corner,  marked ’15’.  There are 12 more places in the grey area of the button window where you can drag and drop actions, 6 on the left and 6 on the right.  If you drag and drop an action somewhere in the grey space, a new button will be created there.  This might come in handy if you had a modified control with differently positioned buttons.  In this case, I used one of the spare places for the double press action associated with the centre button.

Removing buttons, should this be necessary, is one of the functions on the drop-down menu where I chose ‘New Layer’ at the beginning.

I opened Text Edit and pressed all the buttons in order, single press first, then long press, then double press, hoping to see the numbers 1 to 15 displayed.  This what I saw:

14 Text Edit Numbers

The numbers were all printed out in order, so the combinations of short press, long press and double press all worked as predicted – but the long presses produced a continuous stream of outputs, even though I tried to take my finger off the button as quickly as possible.  The exception was the Centre button, which produced a single output of the number ’14’, no matter how long I held the button down.

This behaviour might not be what you require if, instead of printing numbers, you want a single specific action to be performed.  You might find the action repeated many times unless you’re able to take other steps to avoid this.

However, for testing purposes, this was fine, and I had established that the remote should, with iRedLite, be able to distinguish between 15 separate actions, despite only having 6 buttons.

*

The final stage of the project was to try out the new Tiny Touch Apple IR Remote to see if it would function correctly, using the iRedLite TextEdit Tester.

I quickly opened Joystick and Gamepad Tester to check the ID number of the new remote, which was 211.  I then opened iRedLite, went to the correct Layer for my Tester, and changed the remote number to which it would respond from 214 – the remote I had originally use to create the Layer – to 211.

The TouchPhone has a Power switch, but in fact the IR Remote worked even when it was in the ‘off’ position; in the ‘on’ position it worked with added lights.  As before, I pressed each button in turn with a short press, a long press and a double press, checking to see that the correct numbers were printed in Text Edit.

They were, so now it was safe to put the unit back together.  I glued the IR LED into the ‘antenna’:

top IMG_1580

fixed the 9-way socket in place:

bottom IMG_1584

and  wrote the ID number on the back.  Now I had the world’s most colourful Apple IR remote!  It could have been the world’s noisiest, had I not removed the speaker, but I felt this would be gilding the lily – and would probably have been a distraction, given that I had conceived of the remote as being part of a sound-modifying system, not a sound-producing system.

Alternative Remote

I was a little upset as, just as I was putting it back together, I broke the plastic link behind the ‘telephone’ button that mechanically ‘winds the film’ and changes the picture on the screen.  However, this only deprived me of more ways of turning LEDs on, and didn’t in any way affect the IR  controls, so ultimately I was satisfied with my achievement.  I didn’t want to spend more time on it at this stage as I wanted to move onto the next part of the IR project.

[Edit: I’ve since managed to get hold of another Tiny Touch Phone and replace the broken film winder, although I haven’t yet had time to change the tactile switch that got glued together].

For this, see Part 3: Additions.

15
Sep
13

The StyloSound

front_IMG_1497

The idea for the StyloSound came to me when, at about the same time, I acquired two small sound effect devices.  One was a ‘Sound Machine’, a small hand-held unit with 16 push-buttons, the other was a Sound effect kit with PCB, also with 16 different sounds.  I thought it would be a good idea to combine the two things into one unit and use the Stylophone stylus to trigger the sounds; plus I was also working on devices to interact with the ‘Bigfoot’ trigger/sequencer, so I decided to add the capability for the sounds to be triggered by the Bigfoot’s 4-bit binary output.

*

There are several varieties of Sound Machine.  The one I got was the silver ‘SciFi’ version.  This has a number of interesting ‘spacey’ effects, some of which I recognised from Star Wars, Close Encounters and others; some I didn’t.

sound-machine-sci-fi-box2

These Sound Machines aren’t all exactly the same inside, apparently (this site gives a very good first-hand account of looking inside them: http://www.magicmess.co.uk/cb/sm.php)*, but I guess the sounds are all initiated the same way – a +V pulse into the appropriate input of the dedicated chip which stores the samples.

*[Edit: unfortunately, this site is no longer up; I saved some of it, which had this information in it: Bending Sound Machines.pdf].http-:www.magicmess.co.uk:cb:sm.php

Having opened the Sound Machine and taken the PCB out, it was easy to attach a wire to each of the 16 inputs.  These wires went to the middle 16 notes on a Stylophone keyboard, salvaged from a broken instrument – via 16 SPDT switches, as I wanted to be able to choose either the sound from the Sound Machine or the sound from the Sound effect kit individually in each of the 16 positions.  This picture shows how the switches were arranged on the front of the StyloSound:

StyloSound outside in prep IMG_1469

The Stylophone stylus was connected to +V, and the output from the Sound Machine PCB went to the Stylophone speaker, which was much better than the small speaker in the original.

The Sound Machine is powered by three small 1.5v button cells, so it was no problem to use the Stylophone’s own battery compartment, which takes three AA batteries.  With all the switches to the left, the Sound Machine PCB was selected, and it was possible to play all 16 sounds from the Stylophone keyboard.  It was clearer from this than using the original buttons that each sound has to play right through before a new one can be selected.

The next obvious step was to interfere with the playback speed of the sample.  This version of the Sound Machine has only four visible components, two resistors and two capacitors – all tiny SMD (surface-mount) type – with the main chip embedded in its plastic blob.  Using the wetted finger method, I found the resistor responsible for playback speed, which is marked ‘R2’.  I removed it and replaced it with a potentiometer, which slowed down and speeded up the playback.

In this photograph you can see the points at which wires are soldered to the Sound Machine PCB.  In the magnified area you can just about make out the resistor on the left marked ‘R1’, the removed resistor, ‘R2’ (detached but still lying beside the place it was removed from), the wires going to the potentiometer and the two SMD capacitors behind the wires:

SMachine PCB IMG_1473

Unusually in my experience, the chip reacted badly to both too low a resistance and too high, and a 1M potentiometer, my usual first choice, was too big for it, causing it to crash.  In the end, I settled on a 470K potentiometer with 100k trimmers either side.  When the trimmers had been adjusted, this seemed to keep the resistance within acceptable levels.

(Later, I read the website referenced above, and the writer had a different solution to this problem, but I didn’t have time to check it out).

*

The above is all you would need to do to bend a Sound Machine, but the next thing in my case was to unpack the Sound Effect kit, which contained the following components:

Kit unpacked IMG_1471

The two logic chips are a 4066 (quad analog SPST switch), and 4011, (quad 2-input NAND gate); the sound effect chip was on a separate board, inserted, strangely, at right angles to the main board in the slot on the right.  The 4 SPDT switches enable the sound to be selected manually – the input is 4 bit binary – as an alternative to the 4 inputs on the left-hand side of the board.  Output is  through what looked like a small piezo element (the round black component in the bottom left of the picture).

The small board which the sound effect chip itself sits on is one of a range in the 9561 series.  This one has the prefix ‘LX’, but there are others, such  as ‘CK’, ‘CL’, ‘CW’, ‘KD” and others: all have the same general purpose, finding use in alarms, doorbells, and simple toys, making noises such as police sirens, machine guns and so on.  Simple circuits such as this one can be found on the internet utilising very few external components to produce the required sound (generally only one or two in each application):

LX9561

In fact, the kit I bought in an eBay auction only cost about the same as the module itself, and took full advantage of the range of sounds available by using the two switching terminals (F1 and F2) and a more complex array of resistors in place of the single 200k resistor shown in the circuit above.  The full list of sounds available is as follows:

0000: Machine gun voice
0001: Fire truck voice
0010: Ambulance voice
0011: The police car voice
0100: Crickets sound
0101: Alarm
0110: Electronic signal sound
0111: Koh
1000: Insect song
1001: Whistle
1010: Telegraph sound
1011: Bird song
1100: ChongJi gunfire
1101: Car sirens
1110: Bass instruments sound
1111: Racing sound

Some of these interpretations are rather fanciful, but that was no problem as I was more interested in making noise than repeating recognisable sounds.

This chart – for a similar chip in the series – gives some idea of the variations in binary inputs, combinations of selection inputs and resistances that produce different sounds.  If you read Chinese, which I don’t, it probably tells you in the right-hand column what sounds these combinations make.

KD9561 selection chart2

The PCB was robustly constructed and I put it together omitting the four slide switches, as I intended to control it externally, and didn’t attach the piezo sounder, which wasn’t going to be used.

Several of the resistors, when tested, had an effect on the pitch and speed of the sounds – the main job of the 4066 and 4011 is to select different combinations of resistors to affect the sound produced, much as indicated in the chart above – so I picked the likeliest one and replaced it with a 1M potentiometer.  This seemed to do the trick – perhaps taking things slightly too far in the upper direction, so I added a preset in series to keep it from going to its maximum – although it had happily done this without any danger of crashing the chip.

I only had a log potentiometer available, and in the end this was quite fortunate.  I found that connecting it the opposite way round from what would be expected – i.e. turning it clockwise decreased the pitch and speed, rather than increasing it – exploited the logarithmic scale well, making a much slower and smoother transition through the higher pitches and speeds.  I could have bought an ‘anti-log’ pot, but additional time and expense didn’t seem worth it.

This was a timely reminder that a useful part of experimentation would be to compare lin and log pots in particular situations, and reversing the log ones to see what difference this produced. (Reversing the linear ones would, of course, do no good, as they progress evenly through the scale from top to bottom, whichever way round they are).

This part of the circuit (the kit PCB) now looked like this:

Sound Effect Kit circuit 3

The original circuit diagram was provided by the supplier, Chip_Partner_Store, a Chinese company with an eBay shop at http://stores.ebay.com/Chip-Partner-Store.  Places like this – and there are many of them on eBay – are great for browsing through: you can find great deals on bulk buys of common components, as well as somewhat more unusual ones at very reasonable prices, and odd chips and modules like this one, which could always come in handy.

I’ve indicated in the diagram where I added the 1M potentiometer and preset, plus four LEDs, connected, via 470Ω resistors, to the A B C D inputs, the other ends connected to ground.  These were not there for any reason, particularly, except as an indicator of the code being received – and on the principle established with Bigfoot that flashing lights are always good.  I was sceptical as to whether the circuit supplying the four inputs would be able to power these as well as operate the Sound effect module correctly, but it all seemed OK.

The greyed-out section at the output wasn’t used in the final circuit.

Actually, this unit begins sounding repeatedly as soon as power is connected to it, since the default input 0 0 0 0 has an associated output – ‘Machine gun voice’ – and I couldn’t find a way of stopping it, so I also added a power on/off switch to this board, which isn’t shown, in case this feature became annoying.

*

SInce the circuit has four binary inputs, and I wanted to control the unit with the Bigfoot, which has a 4-bit binary output, it would seem logical to connect the Bigfoot output directly to the A B C D inputs.

Unfortunately, this wouldn’t allow the Sound effect module to be operated by the Stylophone keyboard, or the Bigfoot to control the Sound Machine, so additional circuitry was needed to convert the binary input into 16 individual outputs, and then convert that back into binary . . .

. . . Fortunately, the first of those would be a duplicate of part of the Bigfoot circuitry, which I was familiar with, using a 4067 chip.  This part of the circuit looked like this:

StyloSound - 4050_4067_3

The input from the 5-pin DIN socket goes first to a 4050 hex buffer.  Four of the six buffers are used.  The reason for doing this is to exploit an unusual and very useful feature which the 4050 shares with its more common sibling, the 4049.

Both perform a similar function, but the 4049 inverts the input (high level voltage in = low level voltage out, low level voltage in = high level voltage out), and the 4050 doesn’t.

What both of them are able to do is accept an input voltage level higher than the supply voltage, a vital consideration here as the output from Bigfoot is at 9v, whereas the circuitry of the StyloSound is at only 4.5v.  The 4050 is able to acccept the 9v input from Bigfoot and safely reduce it to 4.5v for the other circuits.  9v isn’t a problem for CMOS chips, but the Sound Machine and the Sound effects module are both rated at 4.5 – maybe 5 or 6 maximum – volts.

The four outputs of the 4050 go into the A B C D inputs of the 4067.  Each of the 16 outputs of the 4067 goes to the pole of one of the SPDT switches described earlier.  According to the binary coding on the inputs, one of the 16 outputs of the 4067 is connected to +V, and this signal is sent in the direction either of the Sound Machine when the switch is to the left, or the Sound effect module when it’s to the right.

*

The Sound Machine has 16 separate inputs, so no further circuitry was required: each switch was connected to one of the 16 places on the Sound Machine PCB where there used to be buttons.

For this signal to operate the Sound effect module, however, it needed to be changed back into binary.

Fortunately, this change is not difficult to implement, using a pair of 4532 chips and a 4071.  The 4532 is essentially the opposite of the 4067: it takes individual inputs and converts them to binary.  Each one has only 8 individual inputs and outputs in 3-bit binary, but the datasheet showed this 16-input, 4-bit binary output circuit, which is the one I used:

16 input encoder w pin Nos

The 16 inputs marked ‘From Stylophone Keyboard’ were all connected to ground with 100k resistors so that each one would be at 0v if not receiving a +V signal from the keyboard or the 4067.  The outputs of the 4071 were connected to the Sound effects module where marked A B C D in the earlier diagram.

Here’s how the physical connections are made, and what the chips look like on the board:

StyloSound 4532_4071_3

inside_IMG_1472_2

I’m not entirely sure that the correct order of those 16 inputs is as implied in the datasheet circuit.  Since I had LEDs on the inputs of the Sound effects module – i.e. effectively at the outputs of the 4071, I was able to check the sequence, and I found myself swapping some of them around.  If you’re using this method of converting single outputs to binary, it would be advisable to check this as you go along.  In my case, the wiring to and from the SPST switches was such a bird’s nest, that it became too difficult to work this out.  If it becomes clearer when I use this system in future projects, I’ll make sure to record the correct sequence.

However, when tested with ‘Bigfoot’, the module was triggered accurately, and the LEDs on the input lit up with the correct numbers when the notes were tested with the stylus and keyboard.

*

So now I had two separate sound effect circuits which differed in several ways: the Sound Machine uses samples, which are played back in their entirety, and are particularly effective when slowed down; the Sound effects module produces electronic sounds from oscillators, which can be cut off and replaced at any time by another sound, and lend themselves to being sped up.

Both sections had separate pitch/speed controls; both could be controlled automatically by Bigfoot, or manually via the Stylophone keyboard.

*

I could have stopped there, but I had another idea which I thought could be included.  I believe this is known in the trade as ‘feature creep’ – just adding that one extra implementation, which then turns into two, then three . . . and eventually makes a simple circuit over-complicated.

But I had  just acquired a number of unwanted ‘Voice Recorder’ key rings – 100, in fact! – at a few pence each.  At this price, they weren’t guaranteed to work, but when I tested some, quite a few seemed OK, and they were powered by 3 little coin cells – i.e. 4.5v, the same as the rest of the circuits in the StyloSound, so I thought I could employ a couple of them here.

Here’s what they look like:

outside_inside

There’s a very small microphone, a Record/Play switch, a button to operate whichever of the two functions it’s switched to, and an LED to indicate that it’s recording, as opposed to playing back.  I thought it would be good to be able to record a small (up to 8.2 seconds, it said) burst of sound while the samples or effects were being manipulated, then be able to play it back precisely the same again, a primitive – but undeniably inexpensive – repeat/looping device.

So I added a couple of these, connected to the outputs of the Sound Machine and the Sound effect module.  Small tactile switches glued to the front of the instrument replaced the ‘Record/Play’ switch and button, and I also moved the small LED’s to the front panel as well.

*

Only one thing remained, as far as the circuit was concerned, which was the output stage.  This turned out to be . . . strange.

First of all, I needed to mix together the four outputs: the Sound Machine, the Sound Effects module and the two recording devices, as well as send the Sound Machine and Sound Effects module outputs to the inputs of the recorders.  I planned to do this  with a passive mixer – i.e. just join the outputs together with resistors.

The Sound Machine worked perfectly with the internal speaker, but the Sound Effects module would only work with the other speaker terminal connected to +V rather than 0v: otherwise, it was extremely quiet.  I got round this by taking the output directly from the output of the LX9561 board, as indicated in the circuit diagram above, and bypassing the output transistor.

The outputs of the recorders were much too quiet, too, and the only way I could make them loud enough was to give them a path to +V by means of a very low value resistor (22Ω).  The sound quality of these didn’t quite match that of the Sound Machine and Effects module – partly, no doubt, because of reduced bandwidth in the recorders – but they definitely added a useful function.

In fact, I had intended to add tone and volume controls at this point, but the device refused point-blank to make any sound if anything other than a very low value resistor was put in the output path, I don’t know why.

In the end, I used 22Ω resistors to join the 4 outputs (two in series for the Sound Machine, which was a little louder than the others) and ran this straight to the speaker and output socket.  So, the final stage looked like this:

StyloSound - Output_3

The resistors are all 22Ω, as opposed to some other equally low value, simply because I had a pile of them which were going spare.

So: strange, but when I plugged it into my mixer, it  sounded fine, and the volume could be adjusted there.

*

The only thing left to do was to finish the case.  There was so much internal wiring and circuitry that the case had to be made 2.5″ deeper.  I constructed sides from an offcut piece of white plastic and superglued them in place – not especially neatly, it has to be said – with a little internal bracing.

top_IMG_1498
rside2_IMG_1494
back_IMG_1493*
This is what the StyloSound sounds like, controlled by ‘Bigfoot’:
01
Jun
13

The Taurus

The Taurus wasn’t a major project, but a handy companion piece to the Gemini, an earlier Stylophone modification.

The problem with the Gemini is that it has two voices, output in stereo, but, typical of the Stylophone, it has only the one speaker.  This means that some of its effects are only available via the stereo line out.

As a result of much past experimentation, I have many Stylophone bits left over.  To make the Taurus, which was to be a very simple external amplifier, I used an empty case, some spare grille material, two amplifier circuit boards and two speakers, all from S1 reissue versions of the instrument.

The Stylophone grille isn’t glued down, and can be removed from the inside by pushing out half a dozen lugs which hold it in place.  I did this first, cut a hole in the top of the case for the second speaker – vaguely matching the hole through which the original sounds – and refixed the grille.

The picture shows the second speaker glued in place, and the two amplifier boards connected to a new stereo input socket, the battery box and the speakers:

Taurus Inside DSCF0002

I wasn’t using any of the original keyboard, switch and socket parts, so I glued some spare grille sections inside the switch and socket holes and outside over the hole through which the keyboard is normally accessed.

A small tripod was attached to the base to enable the speakers to be angled for better distribution of the sound.  Decoration consisted of astrological symbols, in the style of the Gemini, and matching black and white bulls, front and back.

Front DSCF0003Reverse DSCF0005

It works well with the Gemini, which has its own volume and mix controls, but is a very basic unit indeed – no volume control, no on/off switch and no external power socket: it uses three AA batteries like the Gemini itself, and could be useful with other instruments needing a slight volume boost and not connected via a line out socket.

Gemini-Taurus DSCF0001

 

[Edit: the Taurus now has a volume control, which I should have put into start with.  This makes it much more practical to use.

Taurus Volume IMG_1512

As it uses a pair of Stylophone amp boards, I’ve done exactly the same as the Stylophone, and put a 10k log potentiometer at the input – in this case a dual, one for each channel].

02
May
13

UCreate Music, Part 2

In my first post on the Radica/Mattel UCreate, I mentioned adding In/Out connectors to enable the UCreate to be operated by external controls – e.g. joysticks – or the UCreate Button to be used to control other devices.

This post describes two of my devices which I modified for this purpose: the StyloSim and the Black Widow.

*

The StyloSim is a two-joystick controller, used for simple flight simulation games.  It has two medium-sized joysticks, which are very nice to operate, but no buttons.  Examining the controls using the [hid] object in PureData suggested that the chip it uses would support the use of buttons, but this function is not implemented.

StyloSim6sm

The essential task, then, with the StyloSim was to add two DB9 connectors, matching the connectors on the UCreate, so the UCreate’s effects could be controlled by the StyloSim, and whatever the StyloSim was used to control (at the moment, just one PureData program I’d written to add volume, filter and panning effects to an audio input) could also be controlled by the UCreate Button.

I checked to see that the ‘high’ and ‘low’ ends of the potentiometers in the StyloSim were both the same: they would have to be connected together to control the UCreate, but would also have to be left in a state where they correctly controlled the StyloSim chip.  They were connected, so I snipped the 6 wires between the circuit board and the potentiometers of the right-hand joystick (which I called ‘VR1′ and’VR2’).

The wires from the potentiometers were connected to the ‘Out’ socket, and the wires from the circuit board were connected to the identical pins of the ‘In socket’.  In this way, whatever else I connected, a DB9 lead connecting these two sockets would allow the StyloSim to function as normal.

In fact, I had another addition to make: the potentiometers would have no effect unless the UCreate ‘Hold’ switch was on.  As with the UCreate itself, I added a 3 way toggle switch, centre off, momentary in one direction, latching in the other, and connected this to the appropriate pins on the DB9 ‘Out’ socket.

Hold & LEDs IMG_1363

These connections were enough to ensure that, with the use of DB9 leads, the StyloSim could control the UCreate effects, and that the UCreate Button  – which had only one joystick – could control at least some of the things the StyloSim could control.

However, the UCreate also now had a ‘Volume Pedal’ output, which just required a potentiometer connected via a 3.5mm stereo socket.  As I had two more potentiometers available in the StyloSim, I connected one of these to a switched socket.  I used ‘VR4’, the up/down potentiometer of the left-hand joystick, as this was set not to return to centre when released, so would be very suitable for setting a volume level and then leaving it.  When nothing was plugged in, the joystick would remain connected to the circuit board inside the StyloSim; when a lead was plugged in, it would control the UCreate volume.

(In practice, unlike the volume pedal, the joystick – because of its limited travel, presumably – didn’t take the volume right down to zero, so was less effective than the pedal, but useful as long as complete silence wasn’t required).

I also made two more modifications, which weren’t strictly necessary, but which were not too difficult and, I felt, enhanced the design.

First of all, I chopped off the USB lead and added a socket instead.  This is only because I find it annoying to have fixed leads hanging off devices – it makes them awkward to carry about and store away.  Sometimes USB leads are small and fiddly, but at least they’re colour-coded.

(There is some variation in exactly which colours are used, however.  There’s supposed to be a convention, but as you can imagine, manufacturers find plenty of opportunity to use colour combinations of their own.  Those who are colour-blind – like me – have to be especially careful, but more often than not you can work out which lead is which.  Looking into a socket from the outside, 1, on the left-hand side, is +5v, and should have a red or orange wire connected to it; 2 is ‘Data -‘, and has a white or sometimes a yellow/gold wire; 3 is ‘Data +’ and has a green or sometimes grey wire; and 4 is Ground, with a Black or sometimes Blue or Brown wire.  I have come across other combinations, unfortunately, of which those using white or yellow for ground are the most annoying.  Often there are 5 wires, with an extra connection – frequently black – for the shield around the cables.

Looking into a plug, 4 is on the left-hand side and 1 is on the right.

I’ve mentioned before that I shouldn’t be using Type A sockets as the output of a device that’s being connected into a Type A socket – on, for example, a computer.  I should be using a Type B or mini USB socket; but this rule is to avoid connecting two devices together that both supply power, which might cause excess currents and start fires, and this isn’t going to happen with the devices I’m using – the StyloSim, for example, receives 5V from the computer, but doesn’t provide power of its own).

Finally, partly as an indicator that the connection with the UCreate had been properly made, partly because flashing lights are always good, I also added blue and red LEDs to the front of the StyloSim, and connected these to the relevant pins on the ‘Out’ socket.  These flash in time with the rhythm of the sounds from the UCreate, when the ‘Hold’ switch is on, so you can tell if the UCreate is ready to receive instructions.

These pictures show the new additions to the circuitry:

Inside IMG_1360

StyloSim rear IMG_1362

and this one shows the StyloSim in operation, controlling the UCreate, with the DB9 and 3.5mm connectors in place, the volume set fairly low, the ‘Hold’ switch on, and the LEDs flashing:

StyloSim in operation IMG_1364

*

Essentially, I did exactly the same to the Black Widow.  The big joystick on the right-hand side was connected to the DB9 ‘Out’ socket, and the ‘throttle’ on the left-hand side to the 3.5mm volume socket.

In this case, however, there were buttons available, so I was able to use the ‘F4’ button on the top of the joystick as a momentary ‘Hold’; for a latching Hold, I added an SPST switch at the bottom of the front panel, plus the two LEDs, which are illuminated when either Hold switch is activated.

Black Widow in operation IMG_1386

And this is the rear of the instrument – not that neat, but it all works:

Black Widow rear IMG_1387

*

As for the UCreate itself, I made three further changes – but these were more additions, rather than modifications:

1.  External power supply. I was pretty certain the UCreate would work with a 5v supply, and was about to use an old mobile phone charger for this purpose; but while I was looking through things I had lying about, I found a better quality one which I’d been given and which was rated at 5.5v, 350mA.  I replaced the connector with a 3.5mm mono plug to match the socket I’d installed in the UCreate, and it seemed to work perfectly, cutting out the battery supply when plugged in, and powering the device.

2.  Switch box.  It occurred to me that there might be occasions when, if I was using the Black Widow and the UCreate at the same time, it might be handy to be able to swap the joysticks quickly from controlling one thing to another, and a way of switching the DB9 leads from one device to the other would be useful.

I was looking into buying a DB9 switch box, which would have been about £5 – £6, but in the end I decided to be stingy and bought three DB9/DB25 adapters for about £4, as I found an unused two-way DB25 switch box amongst my stuff.  I had bought this for an as-yet-unrealised MIDI project: as this will probably remain unrealised for some while, I thought I might as well use it in the meantime.

DB9 to DB25

I did find a diagram on the internet to show how the DB9 pins were, according to the RS232 standard, allocated to pins on the DB25 connector, but it doesn’t really matter, as all 3 connections (in/out, A and B) will be the same.

Switchbox IMG_1389

The Black Widow ‘Out’ is connected to the ‘In/Out’ socket on the switch box; ‘Out A’ is connected back to the Black Widow ‘In’ socket; ‘Out B’ is connected to the ‘In’ socket of the UCreate.

3.  Feedback circuit.  As the UCreate has input and output sockets next to one another on the back, I thought a circuit that connected part of the output signal back into the input, in conjunction with some of the effects – for example, the filter or flanger – could potentially produce some interesting sounds.  Having just finished the modifications described in my first post and put everything back together, I decided to do this externally, so added two 3.5mm splitters to the line in and out, and connected them with a lead containing a volume control:

splitters & volume lead2

This allows some feedback sounds to be added to the linked samples or to sounds at the line or mic in sockets, and the amount can be limited by the volume control.




andymurkin

May 2017
M T W T F S S
« May    
1234567
891011121314
15161718192021
22232425262728
293031  

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