Sound By Monday 周一发声

作者: 安迪·赫茨菲尔德 日期: 1982年9月 人物: 伯勒尔·史密斯、安迪·赫茨菲尔德、史蒂夫·乔布斯 主题: 硬件设计、软件设计、管理、技术 概要: 关于苹果第一代Macintosh的开发以及制造它的人的轶事: 史蒂夫威胁要删除 Mac 的声音功能 , 周一发声 Sound By Monday

When Burrell changed the Macintosh computer’s sound system in August 1982, one big improvement was the sound-making ability. Because of the extra calculations on the IBM chip, Burrell could make four sounds at the same time, using special sound tables. This was too expensive without the special chip, but he kept the basic idea of making sounds using bits and bytes, and a special way to convert digital to analog sound.

1982 年 8 月,伯勒尔更换了麦金塔电脑的音响系统,其中一大改进就是发声能力。由于 IBM 芯片上的额外计算,伯勒尔可以使用特殊的声音表同时发出四种声音。如果没有特殊的芯片,这太昂贵了,但他保留了使用位和字节制作声音的基本思想,以及将数字声音转换为模拟声音的特殊方法。

Burrell thought that the Mac could still work with four voices at the same time, just like he had originally planned. But instead of using special hardware, we would use software to do most of the work. So he told Steve that he would make sure the new version would sound great, with a four-voice synthesizer. Steve agreed to spend an extra dollar to get a better amplifier, to match the improved sound quality.

Burrell 认为 Mac 仍然可以同时支持四种声音,就像他最初计划的那样。但我们不会使用特殊的硬件,而是使用软件来完成大部分工作。所以他告诉史蒂夫,他将确保新版本带有四声部合成器,听起来很棒。史蒂夫同意多花一美元购买更好的放大器,以匹配改进的音质。

In the summer of 1982, there were many important tasks that needed to be done. One of the main things was to make the Mac Toolbox good enough for programmers to start creating apps. Meanwhile, someone named Burrell kept asking me to write a sound driver, especially for his favorite “four voice engine”. However, I didn’t have time to finish it within a few weeks.

1982年夏天,有许多重要的任务需要完成。主要的事情之一是让 Mac Toolbox 足够好,以便程序员开始创建应用程序。与此同时,一个名叫 Burrell 的人一直要求我编写一个声音驱动程序,特别是为他最喜欢的“四语音引擎”。然而,我没有时间在几周内完成它。

Steve Jobs was eager to find out about our new sound feature. He didn’t want to wait any longer, so he took Burrell and me to talk privately on a Friday afternoon.

史蒂夫·乔布斯渴望了解我们的新声音功能。他不想再等了,所以周五下午他带着伯勒尔和我私下交谈。

“Did you tell me that the new sound would be really good?” he asked Burrell. “If I don’t think the prototype sounds good by Monday morning, we will take away the amplifier.”

“你有没有告诉我新的声音会很好听?”他问伯勒尔。 “如果到周一早上我认为原型听起来不太好,我们就会拿走放大器。”

He looked at me and said, “You’ve had enough time to get the music sound right. I want to hear excellent sound on Monday, or else there will be trouble.” Then he walked away, leaving Burrell and me to think about what to do.

他看着我说:“你已经有足够的时间让音乐听起来正确了。我想在周一听到美妙的声音,否则就会有麻烦。”然后他走开了,留下伯勒尔和我思考该怎么办。

“I don’t think he’s telling the truth”, I said to Burrell. “But what if he really means it?”

“我认为他没有说实话”,我对伯勒尔说。 “但如果他真的这么想呢?”

Burrell didn’t look very upset, actually he looked a bit happy. I think he was happy that Steve was asking questions about the sound because he wanted me to work on the sound routines as soon as possible. He even said he would buy me food all weekend if I stayed at Apple to finish the sound.

伯勒尔看起来并没有很沮丧,实际上他看起来有点高兴。我认为他很高兴史蒂夫询问有关声音的问题,因为他希望我尽快研究声音例程。他甚至说,如果我留在苹果完成声音,他整个周末都会给我买食物。

I had already written a simple test program that made a basic square wave sound, which wasn’t perfect, but it showed that the hardware was working and helped me figure out how to control it. My boss, Burrell, wanted me to start working on the four-voice synthesizer right away. He was worried that it wouldn’t even work, so I needed to get started on it ASAP.

我已经编写了一个简单的测试程序,可以发出基本的方波声音,这并不完美,但它表明硬件正在工作,并帮助我弄清楚如何控制它。我的老板伯勒尔希望我立即开始研究四声部合成器。他担心这根本行不通,所以我需要尽快开始。

Burrell’s new design was very smart. The computer, Macintosh, was already getting data from memory to show pictures on the screen. It shared the available data between the screen and the computer’s processor, just like the Apple II. However, every 44 millionths of a second, there was a short time between screen updates when no picture data was needed. So, Burrell used that time to get data for the sound. This gave us a way to play sounds with a rate of 22,000 times per second. This means we can hear sounds with frequencies up to 11,000 times per second, which is not bad.

伯勒尔的新设计非常聪明。计算机(Macintosh)已经从内存中获取数据以在屏幕上显示图片。它在屏幕和计算机处理器之间共享可用数据,就像 Apple II 一样。然而,每隔百万分之 44 秒,屏幕更新之间就会有一小段时间不需要图像数据。因此,伯勒尔利用这段时间来获取声音数据。这为我们提供了一种以每秒 22,000 次的速度播放声音的方法。这意味着我们每秒可以听到频率高达 11,000 次的声音,这已经很不错了。

The sound driver was able to make sounds while the computer was doing something else. It did this by getting control at a specific moment (every 16 milliseconds). This moment was called the vertical blanking interval. The computer needed to generate all the sound data for the next 16 milliseconds, which worked out to 44 thousandths of a second for every small sample of sound. If it took 22 thousandths of a second to do each sample, it would use up half of the computer’s power.

声音驱动程序能够在计算机执行其他操作时发出声音。它通过在特定时刻(每 16 毫秒)获得控制权来实现这一点。这一刻称为垂直消隐间隔。计算机需要生成接下来 16 毫秒的所有声音数据,计算出每个小声音样本需要千分之 44 秒。如果每个样本花费千分之 22 秒,则将消耗计算机一半的电量。

It didn’t take long to write a program that makes a simple sound. It could work with two voices, but it was too slow to work with four voices. This made the sound sound funny and made everything else move very slowly. Then my friend Burrell looked at my program and saw that I was using some important parts of the computer while calculating the sound.

没花多少时间就写了一个发出简单声音的程序。它可以使用两个声音,但使用四个声音时速度太慢。这使得声音听起来很有趣,并且让其他一切都移动得非常缓慢。然后我的朋友伯勒尔查看了我的程序,发现我在计算声音时使用了计算机的一些重要部分。

“Do you really think you can reach the main memory? No, it’s impossible. To be successful, you need to focus on the small parts of the computer’s memory, called registers!”

“你真的认为你能到达主内存吗?不,这是不可能的。要成功,你需要专注于计算机内存的小部分,称为寄存器!”

“Registers” are special places on the computer chip where things actually happen. It was 4 times faster to use these registers than the rest of the memory, which was stored in separate chips. The problem was that there were only 16 of these special places, but we needed more. For each sound, we needed to store some important information like the sound’s frequency, the location on the sound, how loud it was, and some extra details. Unfortunately, we didn’t have enough special places to store all this information for all the sounds we needed.

“寄存器”是计算机芯片上实际发生事情的特殊位置。使用这些寄存器的速度比存储在单独芯片中的其余存储器快 4 倍。问题是这些特殊的地方只有 16 个,但我们需要更多。对于每种声音,我们需要存储一些重要信息,例如声音的频率、声音的位置、声音的大小以及一些额外的细节。不幸的是,我们没有足够的特殊位置来存储我们需要的所有声音的所有信息。

I was able to rewrite some code without affecting the main computer memory. But I could only make three voices because I ran out of space to store the information. Burrell, the person I was working with, was not satisfied with this result. It was already late on a Saturday evening and I wanted to go home, but Burrell thought we had to finish the fourth voice before going home. He was worried that if we didn’t finish it, we would never get it done.

我能够在不影响主计算机内存的情况下重写一些代码。但我只能发出三种声音,因为我没有足够的空间来存储信息。与我一起工作的伯勒尔对这个结果并不满意。周六晚上已经很晚了,我想回家,但伯勒尔认为我们必须完成第四个声音才能回家。他担心如果我们不完成它,我们就永远无法完成它。

At last, I was able to use a fact to help us. The computer’s registers were 32 bits long, and we were only using 16 bits for some of them. This meant we could use some of the registers to store two different values. It took about 22 millionths of a second to calculate each sample. This meant we were using half of the computer’s power to handle four voices at the fastest rate. We had the basic four-voice feature, but we needed a good demo to show it off. We went home to sleep at midnight and agreed to come back at noon the next day to work on the demo.

最后,我能够用一个事实来帮助我们。计算机的寄存器是 32 位长,而我们只使用了其中一些寄存器的 16 位。这意味着我们可以使用一些寄存器来存储两个不同的值。计算每个样本大约需要百万分之 22 秒。这意味着我们使用了计算机一半的能力以最快的速度处理四种声音。我们有基本的四声部功能,但我们需要一个好的演示来展示它。我们半夜回家睡觉,并约定第二天中午回来进行演示。

The next day, we made a demo called “SoundLab”. It allowed users to control the pitch and shape of four different sound voices. Users could draw a sound wave with their mouse, and use a scrollbar to change the pitch of each voice. The sounds didn’t sound like music because they didn’t have the right rhythm and movement. However, users could create very strange and spooky sounds. We thought it was impressive. It was also fun to connect a special machine called an oscilloscope to the sound output and then draw a sound wave with the mouse and see it on the oscilloscope screen.

第二天,我们做了一个名为“SoundLab”的演示。它允许用户控制四种不同声音的音调和形状。用户可以用鼠标绘制声波,并使用滚动条来改变每个声音的音调。这些声音听起来不像音乐,因为它们没有正确的节奏和动作。然而,用户可能会发出非常奇怪和怪异的声音。我们认为这令人印象深刻。将一种称为示波器的特殊机器连接到声音输出,然后用鼠标绘制声波并在示波器屏幕上看到它也很有趣。

When Steve visited us on Monday, he was happy to see that our new computer could make four different sounds at the same time. He was also impressed that he could use a mouse to edit the sound and see the changes on a special screen. However, I don’t think he was completely happy, because he was looking for high-quality music. Our computer has a lot of potential for sound, but it would take a long time and a lot of work from other companies to make it achieve its full potential.

当史蒂夫周一拜访我们时,他很高兴看到我们的新计算机可以同时发出四种不同的声音。令他印象深刻的是,他可以使用鼠标编辑声音并在特殊屏幕上看到变化。然而,我不认为他完全快乐,因为他在寻找高品质的音乐。我们的计算机在声音方面具有很大的潜力,但需要很长时间以及其他公司的大量工作才能使其充分发挥潜力。
目录