Creating a HAL 9000 voice for Mac OS X

Summary: Notes on my efforts to create a "HAL 9000" voice on my Mac OS X computer.

I've been doing a lot of work with the Mac OS X "text to speech" and "speech to text" system lately, so in my spare time I've been trying to see if I can create a HAL 9000 voice for Mac OS X (i.e., the "HAL" voice from the movie "2001: A Space Odyssey"). (Looking on Google, some people refer to it as "HAL 2001" voice.)

I haven't been able to come too close yet myself, but I thought I'd share my work here in case you want to try creating your own HAL 9000 voice for your Mac OS X system.

Trying to create a HAL 9000 voice for Mac OS X Snow Leopard

First, my apologies, but I just learned the source code below won't work on Mac OS X 10.5 (Leopard). There are big differences in the capabilities of the AppleScript "say" command between the two platforms, and 10.5 ("Leopard") doesn't let you even come close.

To try to create your own HAL voice on Mac 10.6, just follow these steps:

  1. Open the Mac OS X Script Editor application.
    1. On Mac OS X 10.6 (Snow Leopard), click Applications, Utilities, and then Script Editor.
  2. Enter the AppleScript source code shown below.
  3. Press the Play button. Once you get it working, adjust the voice (Bruce, Alex, etc.), speaking rate, modulation, and pitch as desired.

Here's the source code for my HAL 9000 for Mac OS X test application:

#
# trying to come close to the HAL 9000 voice from 2001, A Space Odyssey
# alvin alexander, devdaily.com
#

#
# (1) this attempt uses the "Bruce" voice
#
say "I'm sorry Dave. I'm afraid I can't do that." using
    "Bruce" speaking rate 138
    modulation 18
    pitch 41

#
# (2) the "Alex" voice on Mac OS X 10.6 may be better
#
#say "I'm sorry Dave. I'm afraid I can't do that." using
#    "Alex" speaking rate 136
#    modulation 20
#    pitch 38

Note: The AppleScript Script Editor drives me crazy (I don't think it's a very good editing environment), and if you have problems with the source code shown above, either put all the source code on one line, or use my tip to break long AppleScript source code lines into multiple lines.

If you want to try other voices in this program, see my "list of Mac OS X text to speech voices" article.

Mac HAL 9000 voice options

As mentioned, to try creating your own Mac HAL 9000 voice, you can alter these parameters in this script:

  • using [name of a voice]
  • speaking rate [number]
  • modulation [number]
  • pitch [number]

As noted in the AppleScript comments, the "Alex" voice on Mac OS X "Snow Leopard" is really excellent. It's a great improvement over the voices available in Leopard, and I use it from time to time to get my Mac to read web pages to me.

Here's a short list of the AppleScript "say" command parameters you can modify to try to create your own Mac HAL 2001/9000 voice. (Note that there are other "say" command options available, but they aren't relevant to modifying the voice.)

say [text] : the text to speak, which can include intonation characters. ("Good morning Dave")

using [text] : the voice to speak with. (Default is the system voice.)

speaking rate [number] : the rate of speech in words per minute. Average human speech occurs at a rate of 180 to 220 words per minute. (Default depends on the voice used. If “using” is not given, the system speaking rate is the default.)

pitch [number] : the base pitch frequency, a real number from 0 to 127. Values correspond to MIDI note values, where 60 is equal to middle C. Typical pitches range from around 30 to 40 for a low-pitched male voice to perhaps 55 to 65 for a high-pitched child’s voice.

modulation [number] : the pitch modulation, a real number from 0 to 127. A value of 0 corresponds to a monotone in which all speech is at the base speech pitch. Given a pitch value of 46, a modulation of 2 means the widest range of pitches would be 44 to 48. volume [number] : the volume, a real number from 0 to 1 (default is the system volume).

All of these arguments are optional, except for the initial "say text" command itself.

HAL 9000 voice for Mac OS X - summary

If you come closer to creating a HAL 9000 voice for Mac OS X than I have, please let me know in the Comments section below. I've tried several different combinations, and the two shown in the source code above come the closest to the HAL voice I remember from "2001: A Space Odyssey". And again, here's a link to more information on the Mac OS X "text to speech" and "speech to text" software.