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

96 points by eigenvalue ↗ HN
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.

84 comments

[ 3.2 ms ] story [ 146 ms ] thread
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?
Not sure actually, I’m always a bit uncertain about what the behavior should be with respect to audio playback and silent mode on iPhones.
I think it’s only the 15 pro that has 120Hz refresh rate and the rest are at 60Hz?
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.

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.
If you can only capture 60FPS, you cannot accurate measure a signal of 40Hz, since it is below the Nyquist frequency. (I know you mentioned the slow-mo camera which probably does have the bandwidth).
Of course, you’re right about the Nyquist frequency (how could I forget the Nyquist-Shannon Sampling Theorem!). But I looked it up and the iPhone 15 slow motion mode can do up to 240 fps which is enough to easily measure it super accurately with a short sample.
You technically can measure over the nyquist frequency, for example here if you measure 80Hz with your 60Hz camera, you can be sure that either you really did the math wrong with the intended 40Hz, or it is actually the nyquist shadow frequency of your 40Hz oscillation!
Frequencies beyond the Nyquist limit alias back to resolved modes. So a combination of the camera plus a human eye to check that the flashing is “fast” (i.e. above the Nyquist limit) should be enough to verify the frequency.
Interesting that is also a trigger for seizures - which I believe is based in the same justification for this therapy. So at least on those grounds there is "something" there..
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.

Whether it's RAF or CSS, this would only reliably work on a 120hz display (or anything else higher than 80hz and divisible by 40.)
Just higher than 80Hz should be enough via Nyquist's theorem, or no?
Wow, this is intense!

Think twice before sampling it if you have any sensitivity to flashing lights. Might seem obvious, but apparently needs saying!

I think your point just re-enforces the concept that light has a powerful effect on peoples brains.
Just a warning - running this for a few seconds has left my secondary display with an ongoing flicker which seems to be improving after 10 minutes and a reboot.

[edit to add] 10 minutes later - the flicker has gone (or I can't perceive it)

yeah that happened here too. Was it an LG?
Yes! It's an LG Ultra HD running at 2560x1440 @ 60Hz
Same with an LG running at 2560x1080

Now what is causing it?

Same monitor here. Damn strange. I'd experiment more if I didn't need to work with it. Keeping the monitor off for awhile seemed to help , but a quick off/on didn't.
Yup, I turned it off, disconnected it from my Mac and left it for a minute, then rebooted. All seems fine now.
Same with Dell P3223QE.
Same here, on a Dell P2421DC (2560 x 1440 @60 Hz). It is especially noticeable on darker colors (grey or black backgrounds).
Same on my Dell. What seems to stop it is turning off HDR and back on again (using the monitor's OSD menu)
i have to say this intrigues me. Anyone who has dealt with alzheimers or dementia in relatives would be.

I wonder how hard it would be to output to a 4k video stream and atmos or something and then play on hi end home theaters?

tim

I feel like it would be more ethically responsible for this site to put the warning it has at the top of the screen instead of the bottom. For no other reason than to be as clear as possible that this is an unproven but plausible treatment strategy.
Light Therapy ( Low Level Laser Therapy (LLLT) and others) for brain-related disorders has been here for decades. I speny a lot of time looking at the research on it and have a mixed opinion on it. But many desperate families believe in the magic of it.
Could you just buy a cheap signal generator and hook it up to some LEDs and headphones to make a hardware version of this?
Yes you could. But the only thing I saw online that’s ready to buy like this was over $100!
yikes! a cheapo generator on Amazon is like $10 and you can probably get them for less on AliExpress. Not sure if you'd have to amplify the signal for either LEDs or headphones but I imagine you'd want some kind of volume control for the headphones. Total cost could be $30 or less and would make a fun weekend project even for electronics noobs like me.
Reminds of audio visual hallucination experiment someone shared here where you put on a headphone which plays white noise, and screen similarly flashes different colors but after a while the noise starts to sound like voices and color flashes change into shapes for you.
(comment deleted)
I'm not sure what just happened but this webpage literally damaged my monitor.

There is now some flickering over the whole screen (it's not my mind, I filmed and checked my mind with another screen)

What type of monitor is it?
Dell Monitor – P2722H. A common LED LCD

It's not even a year old.

I've been having problems with my Mac M1 laptop display (4 years old), and this kicked them back in.

But to be clear: display was already having issues and i have a service appointment to get it replaced

Same here!

I went to github and see that we are not alone

Given that people recommend pages like this to try fixing stuck bad pixels, makes sense that it could also break them.
The code effectively flashes the monitor at 30 Hz on any 60 Hz monitor (the time delta will always be 16.66 ms or more). I have tried this before and noticed a lasting effect on the monitor that was visible after stopping the flashing. Just a warning. I thought I had damaged the screen.
(comment deleted)
Can I just listen to more Bass Mekanik instead? 40hz isn't that low, my sub cuts out around 25 unless I pump crazy amounts of power into it to keep up the SPL.
You can also generate a video file that does the same thing and play it back locally on a high refresh rate device (iPad Pro). Unfortunately, don't expect it to actually do anything.
First: in mice, raised on a doxycycline-containing diet.

Second: if I've understood correctly, there's no idea about what causes Alzheimer, which would reduce the significance of finding reduced levels of tau.

Third: there was physical vibration at 40Hz. This cannot be reproduced with headphones or earplugs, let alone a computer speaker. The experiment used a 12 inch sub-woofer (at undocumented levels, but I assume that the levels for humans must exceed those for mice). 40Hz might not even be suitable for humans if the effect stems from oscillations in the physical brain matter rather than electrical.

Four: the number of subjects per condition is very low, and the variance is high. The individual data points can be seen on the graphs, and don't give me much confidence. E.g., 2 mice in the grid hang condition failed immediately, but the other 2 performed in the lower range of the other group. Don't get your hopes up.

Tonality is a more ancient part of us than linguistics. As we get better and better sound simulations + measuring tools, I think this type of science is going to get a lot more interesting.
Warning: This just fucked my 2k$ 4k LG display. I ran the website 15 minutes ago and quickly closed it after 15 seconds. My screen is still flickering in the portion of the screen where it used to be the webpage. I rebooted. Still happening

FML please put a big disclaimer.

I have the same, but a thought crossed my mind that it somehow stimulates your vision so that you start seeing the flickering which is always there
For me, I can exclude this. I only notice it on the now broken screen, four other screens are fine (where I did not run it).

Also my slow-mo phone video confirms it.

(comment deleted)
Jeez, I'm really sorry, I hadn't thought of that. It worked fine on all my screens without any issue (I tried it on 3 different ones). I just added a warning about this. Sorry again, I hope your screen recovers.
People are saying that that if you turn it off (maybe even unplug it) for 10 minutes, it goes away. Hopefully that's the case for you.
Yeah I'd say unplug for sure it's amazing how many things can be solved by just unplugging something and letting any charge dissipate.

That was my go to trick when I was a slot tech at a casino. The old $50K/each slot machines often went crazy with errors some due to EEPROM "chip creep" other errors possibly static. So I just unplugged and waited ten minutes or so.

If it's anything like my something something UltraGear LG monitor, disconnecting power for two minutes or so might help.

I had severe ghosting in the shape of YouTube's home page and disconnecting it solved the issue.

Apparently the type of panel they use tends to do stuff like that.

What is going on? Burn-in is understandable but “the content on my screen flickered” should not be a breaking edge case.
It did the same thing to my monitor, which is NOT the program's fault. That's terrible hardware/hardware design if software can break it forever, especially if a webpage can do it... Someone could be so malicious with that.

My monitor has a built-in "LCD conditioning" thing, which just slowly flips through various solid color screens. That "fixed" it. I suspect a YouTube video doing the same would also work.

I had a weird app do this to my screen, and a 4K YouTube video of just that appeared to fix it fairly quickly.
The sound is mono instead of stereo, is that on purpose?
"Flashing Light and Sound at 40Hz helps Alzheimer’s" is an extra-ordinary claim.

The research that might support the claim would be interesting, more so that Javascript that breaks LG monitors.

Although that's interesting for totally different reasons.

Given the problems people are having with their monitors, and the inherent issues with timing on a 60hz screen and timing on a enormous mass of abstraction...

Using a microcontroller with a DAC and a LED array seems particularly well suited for this, while still being firmly a beginner level project.

As well, a cheap Dayton transducer may be a reliable entry point for producing the 40Hz
Does 50hz work? If so, just use an incandescent light bulb?
Shouldn't really need a DAC, just use the PWM output. Any $5 microcontroller should be able to do this with some reliability. Heck, the PiPico has programmable IO which could do this without the processor. Or hey, a 555 timer with the right resistors and capacitors would do the same thing.