Lofipi Keeps The Chill Beats Coming

These days, many people love having some lo-fi beats on when they chill and study. This has led to a cottage industry dedicated to producing said beats, and the format continues to grow in popularity. [Nicholas Sherlock] decided to build a custom audio device solely for the delivery of these comfortable tunes.

As seen on Reddit, the build relies on a Raspberry Pi 3B, paired with an X400 audio amplifier board and hooked up to a nicely-sized mid-range speaker. The hardware is assembled inside a case printed out of wood-effect PLA filament, giving it a nice old-school home audio aesthetic. As a bonus, the layer lines line up in such a way as to boost the woodgrain effect. Plug it in, and you will be immediately rewarded with lo-fi beats from boot.

Originally, the system ran a port of the code from lofigenerator.com, which algorithmically creates lo-fi beats from scratch. However, [Nicholas] could not in good conscience share the ported code, and has retooled the system to stream YouTube playlists using command line media player mpv instead. It’s set to stream typical lo-fi playlists, though could be repurposed to target anything on the platform.

It’s a nice build that really suits the lo-fi beats ideal. When you’re trying to study or focus, you don’t want to be mucking around with a YouTube tab open serving as a distraction. Instead, you can simply flick on the Lofipi, and vibe out.

The Raspberry Pi’s cheap price and great internet and media capabilities make it very popular for builds like these. They go some way to recreating the idea of receiving a broadcast, rather than forcing us into choice as per today’s modern on-demand media paradigm. If you’ve got thoughts on this, drop them in the comments, and if you’ve got your own great projects, do drop us a line.

21 thoughts on “Lofipi Keeps The Chill Beats Coming

    1. The lofigenerator website runs 3 times slower than realtime on the Pi 3B, so it can’t be used to play on there directly. It demands quite beefy single-core performance since it only runs in a single thread.

      I had to make substantial changes to their code to port it over to run on Node instead (using the web-audio-js backend that emulates the Web Audio standard in pure JS). This way I could render 4 songs in parallel using 4 Node worker threads, and so render faster than realtime on the Pi.

      But the code behind lofigenerator.com is not open source, so I cannot share those changes with the world.

      BTW there are no YouTube adverts when using the lofipi, since it uses youtube-dl as a backend to pull out the real video URLs.

      1. At first I tought the lofigenerator.com author was against free music, but it seems they aren’t. There is no specified license for the code itself, and it seems you could just reach them out to get a free license from them.

        1. When they first introduced the site they sounded like they didn’t want to open source it:

          https://www.reddit.com/r/webdev/comments/sqstoh/i_made_a_site_that_generates_lofi_hiphop/hwpofr6

          I don’t blame them, I think monetising it through a phone app could be a good earner for them.

          Also I’m not sure that the instrument sample banks that the app ships with have a license that allows redistribution in their unmodified forms, I think those would be unusual terms.

      2. For one thing, it doesn’t work in my browser. I have a special profile that doesn’t block anything, has no extensions, allows autoplay, and allows all cookies but it still won’t play. I guess the author doesn’t test with Firefox.

    1. I picked a huge fan size so that this isn’t a problem. It’s essentially silent even if you run it at 50% speed to keep a 4 core workload down to 60 degrees C.

      When streaming from YouTube the CPU usage is low enough that the fan should stay stopped all the time. If not, it’s definitely silent at the 20% minimum fan speed I’ve got set, the thing barely spins at that speed.

      1. you might want to consider an esp32 in a next build, low power so no real heat to get rid of, fast boot, no risk of sdcard corruption and you could just play an mp3 stream or perhaps run that github code locally.

  1. I tried something like this back in late 2016, but I couldn’t get the amp isolated enough. Was a static and interference machine. Is there a video of this working?

  2. This gave me the idea of doing something similar, an acrilic cube populated with a RPi zero looping japanese ambient (offline files) and running on batteries. Portable peace.

    1. Yep, I didn’t do any acoustic design. I thought I’d just get it working and see how it sounds before I bothered to learn about that. For a lo-fi background noise generator it’s fine, but with some better engineering it could actually be a good speaker.

      I think sealing it up will require some rearrangement of components, and will probably increase the external dimensions. I’d like to keep that big fan in there which takes up a lot of volume.

      1. If you can seal the speaker enclosure (or even make a ported one without fan), I think your bass response should improve dramatically. Look at powered speakers and subwoofers. They use plate mounted amplifiers for the back of the box. At reasonable power levels, the metal plate cools the amplifier components with the ambient air, so no fan is needed. You might be ok just mounting the amp to the back of the enclosure.

        Nice looking 3D printed enclosure and cool project.

Leave a Reply to Nicholas SherlockCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.