Quarter Life Crisis

The world according to Sven-S. Porst

« Good KarmaMainCrazy Networking »

Touchy Tones

1288 words

We live in an increasingly digital world. Phone someone on an ISDN phone and the receiver's phone will ring immediately as you press the last digit - or even immediately if you press a quick-dial button. That's not magic, it's just digital technology. The same is true for digital mobile phones in a way, but their lack of dialling delay is probably compensated by the fact that they have to establish a connection to the wireless network first.

This means that dialling noises are slowly but surely leaving our lives, no more tick-tick-tick-tick-tick from pulse dialling or beep-beep-beep from your touch tones is your communication has gone all digital.

My communication isn't all digital as our phone line at home and that at the office are still soundly analogue. This has the advantage that you can dial numbers by beeping the correct sounds into the line. I used to do that years ago using a desk accessory called – erm – Address Book which had handy 'Dial' buttons next to the phone numbers you stored for a person.

I always wanted this feature in OS X – and I've always wanted it tied into the system's Address Book. Having it in an extra application was out of question as the whole effort of opening that application, finding the number and dialling it – even if it used the data from the system's Address Book, wouldn't be worth the trouble and the waste of either Dock or menu bar real estate.

Luckily, the release of Mac OS X.3 has changed the feasibility of this kind of integration from hack requiring some snooping and skills to documented technique of creating a class supporting a certain protocol – now that's something I can do. (You could actually do this in AppleScript, but I didn't see how this would be easier than Cocoa proper in this case.)

Address Book phone number menu with addition by Touch Tone Checker After surprisingly little time, my tie-in with the Address Book worked – as did the little 'clever' bit that will try to find the international and area codes of a number and adjust them according to your own – adding prefixes if applicable (well, at least that worked for me). All this complete with preferences – the making of which was purely and exercise in using InterfaceBuilder thanks to the new Controller Layer – which I don't completely understand, particularly when it comes to proper interaction with my own classes, but which makes generating (I dare not say 'implementing') preference panels easy.

The only thing missing were the sounds. They caused many problems. My first attempt was to get some sound files from the net and play them. Apart from my mistaken assumptions, implementing this is actually made harder by the fact that Cocoa seems incapable of playing any sound synchronously. Making things work still isn't too hard, though, and gives a better experience – I still found that ironic. Sadly, the samples I found aren't too good (they clip a lot) and this wasn't too great.

There comes plan B, which actually should be plan A because it's much neater. Those touch tones are nothing but the sum of two sine frequencies. This is well documented on the net and has been implemented on many platforms – as well as probably as an exercise in most undergrad engineering courses. The system of using two frequencies looks both simple and like neat engineering as the way they combine, they probably minimise the hardware needed to generate or detect the signals and make the system robust against noise or harmonics.

To make things even better, Steffen had already implemented a class for generating waveforms live for use in Ballerburg, so I didn't need to worry about the technical details but only needed to insert my sines – later even fading in and out of each tone to avoid clicks and there I was – except I wasn't:

Address Book tie in works excellently, as does waveform generation. It' just that holding your phone next to the speaker and dialling the number won't dial that number. Actually, it will rarely and it will dial thing partially at other times but the reasons for this are beyond me. So I did a few FFT's using a very promising beta version of a tool called Audio Explorer just to check that my frequencies are right – by using the extremely sophisticated method of recording whatever my Powerbook plays with its own microphone... and my frequencies seem fine.

FFT of Touch Tone Sound The only thing I observed was that my lower frequency is much quieter than the higher one – unlike the plots I found elsewhere suggest. I am not quite sure why this is the case – I would have thought the little speakers in the Powerbook won't matter too much at frequencies in the 800Hz range. (On the other hand, recording from my stereo playing the tones at a distance, I'll see the opposite effect...)

Anyhow, after rebalancing the respective powers of both frequencies a little, results improved but are sill quite bad. The experience I made on our university phone system and the one Steffen has at his house is that results are much better on those systems than in the proper loop as provided by Deutsche Telekom.

The strange thing is that I used dial-via-speaker in 1994 or so successfully. I worked perfectly then and it doesn't work now – even when launching Classic and trying out the very same old application I used back then. Why is this? I don't know. My theories included the following:

So this is the cause of my recent problems. If you want to try it out and give some feedback, or even contribute more detailed analysis, please download a preliminary version, copy to a Library/Address Book Plug-Ins folder, restart Address Book and observe.

Settings can be reached by holding the Option key while clicking on the phone number's label. The third tab in the settings can be used to tinker with the way numbers are dialled: Check the box to get our homegrown, unclipped dial tones, use the sliders to adjust the durations of tones and pauses between them. The bottom slider can be used to adjust the ratio of the volume of the treble note and the bass note.

I am looking forward to receiving your feedback. I suppose in the best case there's just some stupid mistake I haven't thought of yet.

November 22, 2003, 3:04

Comments

Comment by WT: User icon

Works like a charm through my MacBookPro speakers!

May 7, 2007, 17:38

Comment by sledgy: User icon

all my phone numbers are in international format (+61 2 …) it would be great if i could define my current prefix, which can be used to use no prefix or replace it with a 0.

cheers :)

July 12, 2007, 3:25

Comment by ssp: User icon

sledgy: Try holding the option key when clicking the phone number’s label. This will bring up the preferences windows which has options for just that.

July 12, 2007, 9:07

Comment by uwe: User icon

Just found - and exactly what I’m looking for. Alas - don’t work on 10.6.: The software installs and menu entry are there; preferences can be changed and wok work, but no dial tones at all (louspeaker is on :-). ???

January 31, 2013, 19:30

Comment by ssp: User icon

@uwe: I’m afraid the software stopped working in Mac OS X.6 due to Apple dropping support for the old sound APIs. Unfortunately I never got round to updating the software for the newer versions as I hardly ever need the software these days.

If your Address Book is running as a 64bit application there may be a slight chance that launching it as a 32bit application (there should be a checkbox for that in the Finder’s Information window for the Address Book application) could help.

Can’t believe this software is almost 10 years old now!

January 31, 2013, 19:47

Add your comment

« Good KarmaMainCrazy Networking »

Comments on

Photos

Categories

Me

This page

Out & About

pinboard Links

♪♬♪

Received data seems to be invalid. The wanted file does probably not exist or the guys at last.fm changed something.

People

Ego-Linking