Cracking The Spotify Code

If you’ve used Spotify, you might have noticed a handy little code that it can generate that looks like a series of bars of different heights. If you’re like [Peter Boone], such an encoding will pique your curiosity, and you might set out to figure out how they work.

Spotify offers a little picture that, when scanned, opens almost anything searchable with Spotify. Several lines are centered on the Spotify logo with eight different heights, storing information in octal. Many visual encoding schemes encode some URI (Uniform Resource Identifier) that provides a unique identifier for that specific song, album, or artist when decoded. Since many URIs on Spotify are pretty long (one example being spotify :show:3NRV0mhZa8xeRT0EyLPaIp which clocks in at 218 bits), some mechanism is needed to compress the URIs down to something more manageable. Enter the media reference, a short sequence encoding a specific URI, generally under 40 bits. The reference is just a lookup in a database that Spotify maintains, so it requires a network connection to resolve. The actual encoding scheme from media reference to the values in the bars is quite complex involving CRC, convolution, and puncturing. The CRC allows the program to check for correct decoding, and the convolution enables the program to have a small number of read errors while still having an accurate result. Puncturing is just removing bits to reduce the numbers encoded, relying on convolution to fill in the holes.

[Peter] explains it all in his write-up helpfully and understandably. The creator of the Spotify codes stopped by in the comments to offer some valuable pointers, including pointing out there is a second mode where the lines aren’t centered, allowing it to store double the bits. [Peter] has a python package on Github with all the needed code for you to start decoding. Maybe you can incorporate a Spotify code scanner into your custom Spotify playing mini computer.

Adding Optical Audio To The Raspberry Pi With One Chip

In the home theater space most people would tell you the age of optical audio, known officially as TOSLINK, is over. While at one time they were the standard for surround sound systems, the fiber cables with their glowing red tips have now been largely supplanted by the all-in-one capabilities of HDMI on new TVs and audio receivers. But of course, that doesn’t mean all that TOSLINK-compatible hardware that’s in the field simply disappears.

If you’re looking to connect a Raspberry Pi to the optical port of your AV system, [Nick Sayer] has you covered. His “TOSLINK Transceiver Hat” utilizes a WM8804 chip from Cirrus Logic to go from the Pi’s I2S audio output to S/PDIF. From there the signal goes directly into the TOSLINK input and output modules, which have the appropriate fiber optic hardware and drivers built-in. All you have to do from a software standpoint is enable a boot overlay intended for a digital-to-analog converter (DAC) from HiFiBerry.

Continue reading “Adding Optical Audio To The Raspberry Pi With One Chip”

My Major Is Gaming…

Times have changed. You can now take a university class in writing games. In fact, YOU can now take a university class about writing games because [Dave Churchill] of Memorial University has put all 22 of his lectures up for your enjoyment. [Dr. Churchill] isn’t planning on releasing the assignment files, but you can still get a lot from watching the videos. Apparently, the classes were also live streamed on Twitch.

The games build on SFML so the resulting games can be portable. The library abstracts input, graphics, sound, and networking.

Continue reading “My Major Is Gaming…”

Guitar Pickguard Adds MIDI Capabilities

For a standard that has been in use since the 1980s, MIDI is still one of the most dominant forces on the musical scene even today. It’s fast, flexible, and offers a standard recognized industry-wide over many different types of electronic instruments. Even things which aren’t instruments can be turned into musical devices like the infamous banana keyboard via the magic of MIDI, and it also allows augmentation of standard instruments with other capabilities like this guitar with a MIDI interface built into the pick guard.

[Ezra] is the creator of this unique musical instrument which adds quite a few capabilities to his guitar. The setup is fairly straightforward: twelve wires run to the pick guard which are set up as capacitive sensors and correspond with a note on the chromatic scale. Instead of using touchpads, using wires allows him to bend away the “notes” that he doesn’t need for any particular piece of music. The wires are tied back to an Adafruit Feather 32u4 microcontroller behind the neck of the guitar which also has a few selectors for changing the way that the device creates tones. He can set the interface to emit single notes or continuously play notes, change the style, can change their octave, and plenty of other features as well.

One of the goals of this project was to increase a guitar player’s versatility when doing live performances, and we would have to agree that this gives a musician a much wider range of abilities without otherwise needing a lot of complex or expensive equipment on stage. We’ve seen a few other MIDI-based builds focused on live performances lately, too, like this one which allows a band to stay in sync with each other.

Continue reading “Guitar Pickguard Adds MIDI Capabilities”

Cardboard Vs. Laser Shootout: A Tale Of Speed And Power Settings

You probably already know that cardboard is versatile, but that goes far beyond the corrugated stuff. There are many types of cardboard out there, some of which you may not even be aware of. In the video after the break, [Eric Strebel] goes through them all and pits each one against his 50 W water-cooled laser with air assist, making a nice reference for himself in the process.

The point of this shootout is to find the optimum speed and power settings for each of these materials using a free power versus speed file. [Eric] almost always runs the thing somewhere between 10% and 50% power, so that’s the range represented here. He’s looking for two things: the settings that leave the least amount of kerf (make the thinnest cut line) and make the cleanest cuts without producing a lot of residue.

[Eric] divided his contestants into three weight classes, the heavyweights being butter board, chip board, mat board, and illustration board All of these are thicker than 1mm. On the middleweight roster, you have railroad board, 4-ply Bristol board, and stencil board, and all of these are under 1mm thickness. Finally, we have the lightweights — yupo paper and 300 series Bristol board, both of which are less than ½ mm thick.

To test their model-making capabilities, [Eric] made a cube out of each material. Once the glue is dry, he peels off the painter’s tape and goes through the various pros and cons of them all. Be sure to check it out after the break.

Of course, you don’t have to hit up the art store to have fun with cardboard — just visit your recycling bin and mix up some cardboard pulp for sculpting and molding.

Continue reading “Cardboard Vs. Laser Shootout: A Tale Of Speed And Power Settings”

A home-made colorimeter

Classic Colorimeter Clone Calibrates Cuvettes’ Contents

For anyone dabbling in home chemistry, having access to accurate measurement equipment can mean the difference between success and failure. But with many instruments expensive and hard to find, what’s a home chemist to do? Build their own equipment, naturally. [Abizar] went ahead and built himself a colorimeter out of wood and spare electronic components.

A colorimeter (in a chemistry context) is an instrument that determines the concentration of a solution by measuring how much light of a certain wavelength is absorbed. [Abizar]’s design was inspired by the classic Klett-Summerson colorimeter from the 1950s, which uses a light bulb and color filters to select a wavelength, plus a photoresistor to measure the amount of light absorbed by the sample. Of course, a more modern solution would be to use LEDs of various colors, which is exactly what [Abizar] did, although he did give it a retro touch by using an analog meter as the readout device.

The body of the colorimeter is made from laser-cut pieces of wood, which form a rigid enclosure when stacked together. The color wheel holds eleven different LEDs and is made with a clever ratchet mechanism to keep it aligned to the cuvette, as well as a sliding contact to drive current into the selected LED. All parts are painted black to prevent stray reflections inside the instrument, but also make it look cool enough to fit in any evil genius’s lab. In the video embedded below, [Abizar] demonstrates the instrument and shows how it was put together.

While we haven’t seen anyone make their own colorimeter before, we have seen DIY spectrophotometers (which measure the entire absorption spectrum of a solution) and even building blocks to make a complete biochemistry lab.

Continue reading “Classic Colorimeter Clone Calibrates Cuvettes’ Contents”

Twin jet engines mounted on tank treads

Big Wind Is The Meanest Firefighting Tank You Ever Saw

As the Iraqi army retreated at the end of the first Gulf War, they took the term “scorched Earth policy” quite literally. Kuwaiti oil wells were set alight en masse, creating towering infernos that blackened the sky.

As it turns out, extinguishing a burning oil well is no easy feat. In the face of this environmental disaster, however, a firefighting team from Hungary made a name for themselves out on the desert sands, astride a jet-engined tank named Big Wind.

Continue reading “Big Wind Is The Meanest Firefighting Tank You Ever Saw”