logoalt Hacker News

JohnMakinyesterday at 4:00 PM3 repliesview on HN

I was born with something not quite like perfect pitch, but when something is even slightly off tune it caused physical discomfort for me.

My cs department had a cool project class where you built what was basically a raspberry pi with a microcontroller by hand, and you had to use the dumb speaker and controller to make your own music firmware to produce notes. the challenge involved, was basically, the processor’s clock wasnt fine grained enough to produce perfect notes. I wanted to make a simon says toy but the notes were off. I approached my professor with my problem and he said I could cheat the processor clock in a clever way to get what i wanted and it was such a “oh wow computers are magic” to me, i got the notes i wanted. disappointingly the TA grader wasnt that impressed but that proff ended up offering me a job before I graduated.


Replies

RealityVoidyesterday at 4:09 PM

Do say more! What was the problem with the clock, more exactly? I believe you, I've had issues caused by clock skew and CAN bus for example, when you have a small error that is amplified on beach bit enough time, errors add up and you eventually get out of synch.

But in the case if sound, I would have expected the skew to be less of a problem. Also surprised how the orof instantly know. It took me a while to figure out. How did you fix it? Cool story!

show 1 reply
PaulDavisThe1styesterday at 6:28 PM

> I was born with something not quite like perfect pitch, but when something is even slightly off tune it caused physical discomfort for me.

Define off tune? 12 TET? Just intonation? Bohlen-Pierce (56 TET) ?

The "in tune" notes are as much a function of culture as physics.

PaulDavisThe1styesterday at 6:31 PM

I've been doing audio software for 25-30 years. I have no idea what sort of synthesis you'd be doing where the processor clock played any roll at all. Waveform synthesis is normally done in buffers (8 to 8192 samples), and the "clocking" to convert the sample stream into an analog waveform is done by the audio interface/DAC, not the CPU. If you were basically implementing a DAC, then yes, the clock would matter a lot ... is/was that the issue?

show 2 replies