7 ms·
Show HN: Alzheimer's Buddy: Use Flashing Light and Sound at 40Hz
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 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.
- atmanactive 3y agoInteresting, 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.
- eigenvalue 3y agoYes 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.
- macrolime 3y agoSo 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?
- eigenvalue 3y agoNot sure actually, I’m always a bit uncertain about what the behavior should be with respect to audio playback and silent mode on iPhones.
- moconnor 3y agoI think it’s only the 15 pro that has 120Hz refresh rate and the rest are at 60Hz?
- giantg2 3y agoOh 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.
- eigenvalue 3y agoInteresting 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.
- fstokesman 3y agoIf 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).
- ladams 3y agoFrequencies 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.
- eigenvalue 3y agoOf 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.
- aunetx 3y agoYou 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!
- rallyforthesun 3y ago[flagged]
- spydum 3y agoInteresting 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..
- mmastrac 3y agoCool 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.
- zackkatz 3y agoWow, this is intense! Think twice before sampling it if you have any sensitivity to flashing lights. Might seem obvious, but apparently needs saying!
- dghughes 3y agoI think your point just re-enforces the concept that light has a powerful effect on peoples brains.
- monkey_monkey 3y agoJust 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)
- serf 3y agoyeah that happened here too. Was it an LG?
- monkey_monkey 3y agoYes! It's an LG Ultra HD running at 2560x1440 @ 60Hz
- seydor 3y agoSame with an LG running at 2560x1080 Now what is causing it?
- serf 3y agoSame 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.
- monkey_monkey 3y agoYup, I turned it off, disconnected it from my Mac and left it for a minute, then rebooted. All seems fine now.
- mensetmanusman 3y agoCapacitors needed to relax...
- t0mek 3y agoSame with Dell P3223QE.
- TimMeade 3y agoi 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
- smusamashah 3y agoraw.githack.com [1] can be used to view the html without cloning it. [1]: https://rawcdn.githack.com/Dicklesworthstone/anti_alzheimers_flasher/3bc2fea8651c3af2fe2d35066d17d46353e97693/index.html https://rawcdn.githack.com/Dicklesworthstone/anti_alzheimers...
- eigenvalue 3y agoAh, that’s a good hack. But won’t work if you want to use a custom domain except with a redirect.
- cubeanie 3y agoOne of the things I've personally enjoyed using on and off in the mornings, in this 40hz space, is: https://mynoise.net/NoiseMachines/forty40HzBrainwaveGenerator.php https://mynoise.net/NoiseMachines/forty40HzBrainwaveGenerato... Mynosie generally has a lot of neat noise generators in this brainhacking space
- cbondurant 3y agoI 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.
- myth_drannon 3y agoLight 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.
- throwaway4aday 3y agoCould you just buy a cheap signal generator and hook it up to some LEDs and headphones to make a hardware version of this?
- eigenvalue 3y agoYes you could. But the only thing I saw online that’s ready to buy like this was over $100!
- throwaway4aday 3y agoyikes! 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.
- smusamashah 3y agoReminds 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.
- deleted 3y ago[deleted]
- roflmaostc 3y agoI'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)
- roflmaostc 3y agoSee this slow mo video taken with my phone: https://anonymfile.com/n7yX/vid-20240126151605.mp4 https://anonymfile.com/n7yX/vid-20240126151605.mp4
- hersko 3y agoWhat type of monitor is it?
- roflmaostc 3y agoDell Monitor – P2722H. A common LED LCD It's not even a year old.
- pmayrgundter 3y agoI'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
- roflmaostc 3y ago[flagged]
- adv0r 3y agoSame here! I went to github and see that we are not alone
- matei88 3y agofound that something like this fixes it https://youtu.be/t6jlhqNxRYk?feature=shared&t=8468 https://youtu.be/t6jlhqNxRYk?feature=shared&t=8468 just play it in full screen for a few seconds
- 3y ago
- larschdk 3y agoThe 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.
- deleted 3y ago[deleted]
- nubinetwork 3y agoCan 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.
- geoffry 3y agoYou 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.
- tgv 3y agoFirst: 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.
- joshspankit 3y agoTonality 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.
- adv0r 3y agoWarning: 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.
- personalityson 3y agoI 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
- roflmaostc 3y agoFor 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.
- deleted 3y ago[deleted]
- eigenvalue 3y agoJeez, 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.
- eigenvalue 3y agoPeople 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.
- dghughes 3y agoYeah 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.
- exceptione 3y agoThe sound is mono instead of stereo, is that on purpose?
- SideburnsOfDoom 3y ago"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.
- Workaccount2 3y agoGiven 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.
- joshspankit 3y agoAs well, a cheap Dayton transducer may be a reliable entry point for producing the 40Hz
- mcapodici 3y agoDoes 50hz work? If so, just use an incandescent light bulb?
- bobdvb 3y agoShouldn'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.
- methou 3y agoPeople usually put a seizure warning for flickering stimuli, for a reason.
- KomoD 3y agoYou mean like in the HN title and red text on the site saying "WARNING"..?
- canadiantim 3y agoFriendly reminder that Alzheimer's may entirely be driven by Candida yeast. If you know anyone diagnosed with Alzheimer's I strongly recommend doing an Organic Acids Test for d-arabinitol specifically to see if it's high. If it is, candida could be the cause (not of all Alzheimer's, but some cases where d-arabinitol is high).
- keepamovin 3y agoI like it. It's like synthetic forced form of meditation via a driving signal. Cool. Be nice to pair with a biofeedback headset.
- swayvil 3y agoLike one of those 1920s blubber-shaking machines, except for your awareness.
- keepamovin 3y agoHahaha! Cool! :) Very creative analogy :)
- avgcorrection 3y agoBuddy. That makes it sound like doing this thing worsens the disease.
- swayvil 3y agoI'm just going to leave this here https://vimeo.com/313049496 https://vimeo.com/313049496
- flir 3y agoThis is funny. Just this week, I've been thinking about simulating a Dreamachine[1] in software. Isn't the obvious solution to your timing problem to distribute it as a video file instead? To be played on 120Hz-capable hardware, obviously. [1] https://en.wikipedia.org/wiki/Dreamachine https://en.wikipedia.org/wiki/Dreamachine
- mdrzn 3y agoTried on two different PC with different monitors, zero burn in. Could the difference be that I'm in EU with different electrical currents then the US, if it has to do with flickering and hertz?