Live data from Hacker News

Show HN: Alzheimer's Buddy: Use Flashing Light and Sound at 40Hz

alzheimersbuddy.com

1–10 of 85 posts

Show HN: Alzheimer's Buddy: Use Flashing Light and Sound at 40Hz

#1
I recently learned about some fascinating research done at MIT for potentially treating Alzheimer’s using light and sound stimulation at 40 hertz. Nothing has been proven yet, but it seemed compelling to me, especially given the safety and simplicity of the treatment (i.e., no drugs, no electrodes, just looking at light and hearing sounds).

I wanted to try it myself, but was surprised how hard it was to find something free and easy to use to generate such pulses. Which is odd because I remember some freeware DOS program I tried back in the 90s which did all this kind of stuff (anyone know what I’m talking about? Google fails me…).

So anyway, I made this tool in a couple hours and put it up as a public service so that older people can try this treatment now without waiting years for FDA trials to finish and without getting a diagnosis and expensive piece of medical equipment. The code is available here:

https://github.com/Dicklesworthstone/anti_alzheimers_flasher

As an aside, I first tried making this in Rust, but gave up after finding it incredibly annoying to deal with the wgpu library with its ever changing and breaking API. This was a surprise because I generally find working in Rust to be quite pleasant.

In contrast, doing it in JS was a total breeze, and I was impressed how well canvas and webaudio works nowadays. It also makes it easy to add documentation right there on the page, to distribute it, and to get it working on mobile phones automatically. Web development is pretty awesome!

The best part is that, because I made it as a single html file on GitHub, I was able to deploy it without even setting up Nginx on a machine somewhere— I just used Cloudflare Pages and the whole thing took a couple minutes (getting the domain from Cloudflare made things even easier since they automatically handled everything with the certificate).

I realize that there are limitations in using a computer screen for precise flashing given hardware refresh rates. I’d certainly welcome any PRs if people have ideas about how to improve it or make it more efficient without breaking it on mobile. I tried to do the flashing in a way that can be easily hardware accelerated in modern browsers. The hardest part was getting rid of the disconcerting popping artifacts when starting and stopping the low frequency audio, but I resolved it by ramping up and down the volume beforehand.

Show HN: Alzheimer's Buddy: Use Flashing Light and Sound at 40Hz
alzheimersbuddy.com

Re: Show HN: Alzheimer's Buddy: Use Flashing Light and Sound at 40Hz

#2
Interesting, thank you for this. I'm curious, if we assume that majority of screens are at 60Hz refresh rate, how does 40Hz flashing actually outputs in real life. For a 120Hz screen, yes, it's obvious, just skip two frames and fire at every third, but for 60Hz... I wonder.

Re: Show HN: Alzheimer's Buddy: Use Flashing Light and Sound at 40Hz

#3
Oh my, Rust vs JS. It's almost guaranteed there will be more comments about that than the actual treatment.

That's awesome that you created something free. You might want to add a standard license to your disclaimer for better liability protection (something that already stands up in case law).

Do you have any verification or adjustment mechanism to ensure the correct frequency across hardware variations? I assume this would be hard to do, but would be interesting if you were able to have something like that.

Re: Show HN: Alzheimer's Buddy: Use Flashing Light and Sound at 40Hz

#5

Interesting, thank you for this. I'm curious, if we assume that majority of screens are at 60Hz refresh rate, how does 40Hz flashing actually outputs in real life. For a 120Hz screen, yes, it's obvious, just skip two frames and fire at every third, but for 60Hz... I wonder.

Yes that’s the thing I most worry about, surely it causes some aliasing and a “beat pattern” (how could it not?). The question is whether that matters much in practice. It seems to work quite well on an iPhone in a dark room with the brightness turned up— just close your eyes and put the phone near your eyes. And don’t forget to turn off silent mode to hear the audio! That one case covers so many users.

Re: Show HN: Alzheimer's Buddy: Use Flashing Light and Sound at 40Hz

#6
post #3

Oh my, Rust vs JS. It's almost guaranteed there will be more comments about that than the actual treatment. That's awesome that you created something free. You might want to add a standard license to your disclaimer for better liability protection (something that already stands up in case law). Do you have any verification or adjustment mechanism to ensure the correct frequency across hardware variations? I assume th…

Interesting idea. An iPhone camera now can record 60 frames per second (and much more in slow motion mode), so it seems like it wouldn’t be that hard to make something that can verify the frequency with a pretty high degree of accuracy.

Re: Show HN: Alzheimer's Buddy: Use Flashing Light and Sound at 40Hz

#7

Interesting, thank you for this. I'm curious, if we assume that majority of screens are at 60Hz refresh rate, how does 40Hz flashing actually outputs in real life. For a 120Hz screen, yes, it's obvious, just skip two frames and fire at every third, but for 60Hz... I wonder.

Yes that’s the thing I most worry about, surely it causes some aliasing and a “beat pattern” (how could it not?). The question is whether that matters much in practice. It seems to work quite well on an iPhone in a dark room with the brightness turned up— just close your eyes and put the phone near your eyes. And don’t forget to turn off silent mode to hear the audio! That one case covers so many users.

So that's why it wasn't working. Videos and everything else will except incoming calls works in silent mode just by turning the volume up. Why is this an exception?

Re: Show HN: Alzheimer's Buddy: Use Flashing Light and Sound at 40Hz

#8

Interesting, thank you for this. I'm curious, if we assume that majority of screens are at 60Hz refresh rate, how does 40Hz flashing actually outputs in real life. For a 120Hz screen, yes, it's obvious, just skip two frames and fire at every third, but for 60Hz... I wonder.

Yes that’s the thing I most worry about, surely it causes some aliasing and a “beat pattern” (how could it not?). The question is whether that matters much in practice. It seems to work quite well on an iPhone in a dark room with the brightness turned up— just close your eyes and put the phone near your eyes. And don’t forget to turn off silent mode to hear the audio! That one case covers so many users.

I think it’s only the 15 pro that has 120Hz refresh rate and the rest are at 60Hz?

Re: Show HN: Alzheimer's Buddy: Use Flashing Light and Sound at 40Hz

#10
Cool concept and project.

I don't know if browsers are capable of doing the flash reliably. I tried it out (non-epileptic and curious), and you can see that it's not a reliable 40Hz flash on either Chrome or Firefox.

I haven't looked to see what technique you are using for the timing, but there's quite a bit of jitter.

EDIT: it's using requestAnimationFrame.

Rather than using that, have you tried using CSS keyframes? They may have a more privileged timer, and they'll be immune to GC.

Post reply on HN