
PC Speaker To Eleven - atomlib
https://habr.com/en/post/439192/
======
userbinator
The most amazing thing I've heard done with a PC speaker is in the last part
of this equally amazing demo (starts at 6:37 --- the parts before have more
"normal" beeper music):
[https://www.youtube.com/watch?v=yHXx3orN35Y](https://www.youtube.com/watch?v=yHXx3orN35Y)

Explanation here: [https://www.reenigne.org/blog/8088-pc-speaker-mod-player-
how...](https://www.reenigne.org/blog/8088-pc-speaker-mod-player-how-its-
done/)

~~~
fhood
Holy shit. I've never heard anything even remotely like that from a pc
speaker. How the hell did they accomplish that on a 1981 pc?!?!

~~~
AstralStorm
Disabling interrupts and eating all available CPU in handcoded assembly.

386 can do it with no tricks. And you even have some spare horsepower to
dither for improved quality.

------
whywhywhywhy
Although the engineering behind getting a good sound out of the PC speaker is
fascinating. Still wishing the PC standard from the get go had included sound
as a first class citizen.

I think this decision back then still ripples through the machines today and
sound never truly feels like an integral part of the machine on Windows
(Realtek audio driver) and you'll never have the feeling of a built in boot
sound on your machine which felt so good on Macs till it was disabled
recently.

It's not like computers didn't have good sound back then either compare the
Lotus III example [0] from the article with the same on the Amiga hardware
from around the same time [1]

[0]:
[https://www.youtube.com/watch?v=72vZ1asBIXQ](https://www.youtube.com/watch?v=72vZ1asBIXQ)

[1]:
[https://www.youtube.com/watch?v=CgGSBoivBIY](https://www.youtube.com/watch?v=CgGSBoivBIY)

~~~
ajmurmann
"[...]a built in boot sound on your machine which felt so good on Macs[...]"

Ever since I got my first iBook in college I've had mainly negative
associations with that sound. Too frequently you'd open the thing in the
middle of a lecture with 100+ people in the room and the sound starts
blasting. The only solution I found was plugging in headphones so that the
sound would go there instead.

~~~
Mister_Snuggles
As I recall, if you muted the sound before shutting down it would stay muted
and not play the startup sound. My Mac experience starts at the white iBook G3
running OSX 10.2 though, so it could be that this behaviour is a new thing.

I now have a 13" TouchBar MacBook Pro and it makes a sound when I plug the
charger in no matter what I do to the volume settings. When I have it muted
and open I can actually see it unmute the sound so that it can make the
charger sound then mute it again when it's done.

~~~
glhaynes
Just fyi: I believe (but haven't gotten to try it myself) that this command
will turn off the power chime when you plug in a USB-C charger.

    
    
      defaults write com.apple.PowerChime ChimeOnAllHardware -bool false;killall PowerChime

~~~
Mister_Snuggles
I haven't tried this yet, but based on some quick searching it might need some
tweaks[0]. This is a pretty easy change to make, so I'll try it out later.

[0] [https://apple.stackexchange.com/questions/282752/turning-
pow...](https://apple.stackexchange.com/questions/282752/turning-power-chime-
off/309947#309947)

------
diydsp
There is a niche of 1-bit music using such creative techniques. See also:

1\. Mister Beep, from Poland.
[http://freemusicarchive.org/music/Mister_Beep/](http://freemusicarchive.org/music/Mister_Beep/)

2\. Tristan Perich, from NYC.
[https://www.1bitsymphony.com/](https://www.1bitsymphony.com/)

3\. Noah Vawter, 1-bit Groovebox:
[https://web.archive.org/web/20090212172253/http://web.media....](https://web.archive.org/web/20090212172253/http://web.media.mit.edu/~nvawter/projects/1bit/index.html)

~~~
AstralStorm
Just like with hit points, one is all you need. Just enough lives. ;) Or in
this case, high enough and stable enough frequency.

------
micheljansen
I remember playing a Golf game called World Class Leaderboard on my 386 and
being absolutely amazed by the sound coming out of my PC speaker. It used
RealSound to play the sounds of birds on the title screen and realistic golf
sound effects and voices during gameplay:

[https://www.youtube.com/watch?v=21a_bbajmjQ](https://www.youtube.com/watch?v=21a_bbajmjQ)

~~~
rleigh
And the original Links
([https://www.youtube.com/watch?v=G5TPAxMfpbQ](https://www.youtube.com/watch?v=G5TPAxMfpbQ))
from the same company. Really nice use of the PC speaker in the intro, as well
as the game.

------
mrunkel
Ahh the good old days. I remember writing a program in 6502 assembler that
could record and playback a digital sample, all using the speaker on the Apple
][+. I'm not sure if I also connected a microphone or if I just yelled at the
speaker.

I believe the max I could record was about 7 seconds before I ran out of
memory. But it worked and I was happy and proud. :)

I remember being amazed how i'd spent so many hours coding something that
executed in such a short amount of time.

~~~
morkfromork
There was an Apple ][ program in an issue of Nibble Magazine that could sample
audio from the cassette port, save to disk and play.

------
Synaesthesia
Awesome he made his own VSTi available which we can use to make chip tunes
plus impulse responses of tiny speakers to give it a realistic sound, and
released it all for free!

------
dekhn
to learn assembly I wrote a "PC speaker clicker" that just strobed the click
register and had a small timing loop to play A440.

A person in the room spoke up when I played it- "that's not A440, it's off
slightly. Oh, and I have perfect pitch- it's about 439".

I had a small bug in my timing routine that made the pitch slightly lower,
which I fixed.

~~~
ttul
I sang in a children’s choir growing up. There were several kids with perfect
pitch over the years. It’s an incredible skill; they really do get the pitch
exactly right - even better than the piano.

~~~
jacquesm
Makes you wonder what the difference is, genetically speaking. The one set of
genes codes for a crystal oscillator and the other for resistors and
capacitors or the biological equivalent.

~~~
dekhn
This is a really interesting area of research. I've been following roughly
since the time I wrote the code I described above (at UCSF, a medical research
institution). At the time, my genetics professor (Nelson Friemer) theorized it
was primarily genetic
([https://www.sciencedaily.com/releases/2009/07/090702170209.h...](https://www.sciencedaily.com/releases/2009/07/090702170209.htm))
and even found some genetic associations.

I don't think that's really super-important. For example, when he heard that
perfect pitch was frequently found in children of musicians, his conclusion is
that it was inherited genetically. I think, instead, children of musicians are
exposed to pitches and their labels (notes) very early, during neural
plasticity, and develop the mental associations, probably with some assist
from genetics.

The biophysics of audition are pretty interesting; see
[http://dailynexus.com/2017-08-24/hearing-a-biophysical-
and-n...](http://dailynexus.com/2017-08-24/hearing-a-biophysical-and-
neurological-enigma/)

[https://en.wikipedia.org/wiki/Hair_cell](https://en.wikipedia.org/wiki/Hair_cell)

One could imagine any number of genetic changes that could affect the ability
of the physical system (these parts) as well as the neural parts to do this,
but personally I think this is much more learned behavior, not genetically
dominated.

~~~
jacquesm
The big question is: what is the reference?

~~~
dekhn
reference to what? There is a collect of hair cells that vibrate in response
to various pitches. When presented with enough training examples, the brain
makes the association between those vibrations, and labels provided by others
(that's where the pitch/note mapping comes from). For individual frequencies,
I think most people with perfect pitch spend some time with pianos and tuning
fork and eventually get a "feel" for what delta 1hz around 440 sounds like.

~~~
JoeAltmaier
Explain my four-year-old hearing chords played on a piano by the teacher, and
able to tell the notes that made up the chord. First 3-notes, 4, 5, 6 and he
was still able to do it.

Sure the labels are learned. But the ability to hear all that is spread out
over a bell-curve. The whole class could tell 1 note, 1/3 could tell 2, then 2
kids could tell 3, then just 1.

~~~
dekhn
yes, and? I don't have perfect pitch, but with extensive training I have
limited relative pitch. It's an acquired skill like anything else, and young
kids exposed to music pick it up faster- with a distribution, like everything
else.

~~~
JoeAltmaier
Oh, and he has perfect pitch. Can tune stringed instruments without a
reference, was employed to do so for some summers.

It was something he could do, from a very young age. Not apparently learned.
Not learned by most of his cohort at music school, so I'm guessing most likely
something born with.

If there is a distribution, then we have to task to explain that. Reasonable
to call it genetic? Why not?

~~~
dekhn
I don't know what you mean by "not apparently learned". Even with genetically
inherited perfect pitch, the skill has to be "learned" (IE, presented with
note labels). Nobody has the ability- without training- to tell you the
frequency of a note. Genetic (in this case) doesn't mean "born with the
ability", it means "predisposed towards greater ability after training").

Personally, I'd start with the strong observations like "People whose first
language is tonal are more likely to have perfect pitch", while people whose
ancestors spoke tonal languages, but were raised with a first language that
isn't tonal, are less likely (and vice versa). That says to me "environmental
differences" are as strong as genetic.

All of this is covered in extensive (and relatively accurate) detail on the
wikipedia page. if you want to argue with me further, I suggest getting a PhD
in the field, or at least extensive experience with molecular biology,
genetics, biophysics, experimental design, and scientific philosophy, as all
those are necessary prerequisites for discussing complex traits that have both
genetic and environmental components.

~~~
jacquesm
That is really not an OK answer.

The idea that there is an 'absolute' involved indicates a reference of sorts,
that is what makes it absolute. Labelling notes will distribute them along a
bell curve and the dead center of that bell curve may or may not be the exact
note. People with absolute pitch are able to do this _exactly_ and that is
what makes it interesting, that implies a reference to some standard,
presumably one that they have internally. A tuning fork is such a standard, as
are other mechanical oscillators with a high degree of repeatability.

~~~
dekhn
There are numerous problems with your response; I suggest reading up on the
actual biophysical experiments done with people with absolute pitch to get a
better idea on the details of what absolute pitch means.

It's not exactly; most people with AP can do, at best, note labelling. A much
smaller group can identify pitches (frequencies) but then only with 1hz
resolution around 440.

I don't mean to imply in these discussions that I'm an expert on absolute
pitch- but I have a PhD in biophysics and we covered signal transduction in
our classes.

I think sitting around speculating that there's some absolute pitch reference
in people's head that works better because of genetic mutations is probably
not the right path to go down. Because (almost) everybody has those pitch
references (hair cells) and they're almost all equally functional (some
mutations probably lead to slightly better or worse response).

I don't really follow all the parts about the bell curve other than to say
most physical phenomena like this exhibit distributions that resemble
gaussians, but that isn't really an indicator of the mechanism.

------
justtopost
This is cool, but doesent even seem to mention the ScreamTracker pc speaker
hack. Maybe it was done the same way, but it was able to output about 8khz
bandwidth, 1 bit rendered and anti-aliased from 8 or 16 bit sound samples to
the pc speaker. It worked so well I still have tape recordings I made with a
hacked up rca plug attached. The paralell port adapters sounded better, but
had their own neat lofi sound. About the best you could do without a sound
card, which were stupid expensive back then. It was a far cry from the
'musical' beeping I was used to.

~~~
httpsterio
Is this the same used in the 8088 mph demo productions end credits?

[https://youtube.com/watch?v=yHXx3orN35Y](https://youtube.com/watch?v=yHXx3orN35Y)

~~~
magicalhippo
Reminded me of Mean Streets, with it's RealSound[1] voices
[https://youtu.be/WJ4rYt8v--4?t=153](https://youtu.be/WJ4rYt8v--4?t=153)

Was amazed when I heard it for the first time.

[1]:
[https://en.wikipedia.org/wiki/RealSound](https://en.wikipedia.org/wiki/RealSound)

~~~
gorb314
I agree, even as a young kid with no idea how make the speaker even go beep (I
was young, ok?) hearing the music/speech coming from Mean Streets was amazing.
Everything else up to that point was just beeping and blipping... IIRC the
volume was very low though.

------
DougN7
What always amazes me is this could have been done back in the day if someone
had had the vision and belief that it was possible. Understandable that they
didn’t because it’s so far beyond the then current level of expectation.

So that makes me wonder what could be done with what we have now if we only
had the vision and belief that it was possible? What will someone demo if 50
years on an “ancient” Windows 10 PC or iPad?

~~~
grkvlt
I'm not 100% sure that's true - for example, today we have hugely improved
development environments, IDEs, source control, collaboration tools,
simulators, debuggers, documentation (particularly in terms of easily
available and instant access to low level details and also searchability) and
so on, which (probably?) make it easier to produce code, and perform tasks
that would have been impossible or intractable back then...

~~~
DougN7
Yes, the environment definitely makes it easier and more feasible.

Still, what if we have Star Trek-like transporter building blocks today but
just can’t see it yet?

------
rchaud
Damn this takes me back. I'm 10 years old and my 'gaming setup' is my mom's
386 work computer. No sound card, so I played and completed games like Doom I,
Chip's Challenge (built-in w/ Win 3.1 I believe) and Allan Border's Cricket
with those beeps and boops.

------
dekhn
I had a cracked game on my Apple IIe which included a side program (included
by the cracker) that played 3-channel beethoven sonata.

