Sweet Streams Are Made Of These: Creating Music On The Command Line

There are countless ways to create music. In the simplest form, it won’t even require any equipment, as evidenced by beatboxing or a capella. If we move to the computer, it’s pretty much the same situation: audio programming languages have been around for as long as general-purpose high-level languages, and sound synthesis software along with them. And just as with physical equipment, none of that is particularly necessary thanks to sed. Yes, the sed, the good old stream editor, as [laserbat] shows in her music generating script.

Providing both a minified and fully commented version of Bach’s Prelude 1 in C major as example, [laserbat] uses a string representation of the sheet music as the script’s starting point, along with a look-up table of each transformed note’s wavelength. From here, she generates fixed length PCM square wave signals of each of the notes, to be piped as-is to the sound card via ALSA’s aplay or SoX’s play. To keep things simple enough, she stays within the region of printable characters here, using space and tilde as low and high values respectively, providing highest possible volume at the same time this way.

The concept itself is of course nothing new, it’s how .au and .wav files work, as well as these little C lines. And while the fixed note duration takes away some of the smoothness in [laserbat]’s version, adding variable duration might just be a hint too much for a sed implementation, although we’ve certainly seen some more complex scripts in the past.

[via r/programming]

Patterned Plywood Makes For Attractive Speakers

In the matter of audio, we’re well past the reign of the home hi-fi and the boombox. If you’re not listening on headphones or directly on your phone, you’ve got a brick-sized Bluetooth speaker pumping out the tunes. Still a fan of the old-school, [Amanda Ghassaei] built some bookshelf speakers with a hip aesthetic.

First, the speaker enclosures were designed in WinISD, a software package specifically made for the task. For given woofers and tweeters, it helps get the enclosure and port sizes in the correct range for good sound. Panels were then fabricated out of plywood to make the enclosures. The plywood was cut and reformed several times to make the panels, using the pattern from the multiple plies to create the zig-zag look. Audio wise, a class D amplifier takes in line-level signals, before pumping them out to a woofer and tweeter through a custom designed crossover network.

It’s a tidy build, and we’d love to experiment ourselves with the fancy patterned plywood technique. Getting your enclosure design right can make a big difference to sound quality, as we’ve seen before. Video after the break.

Continue reading “Patterned Plywood Makes For Attractive Speakers”

A Tin Can Phone, But With Magnets

The tin can phone is a staple of longitudinal wave demonstrations wherein a human voice vibrates the bottom of a soup can, and compression waves travel along a string to reproduce the speaker in another can at the other end. All the parts in this electrical demonstration are different, but the concept is the same.

Speakers are sound transducers that turn electrical impulses into air vibrations, but they generate electricity when their coil vibrates. Copper wires carry those impulses from one cup to another. We haven’t heard of anyone making a tin can phone amplifier, but the strictly passive route wasn’t working, so an op-amp does some messy boosting. The link and video demonstrate the parts and purposes inside these sound transducers in an approachable way. Each component is constructed in sequence so you can understand what is happening and make sense of the results.

Can someone make a tin can amplifier transformer? We’d like to see that. In another twist of dual-purpose electronics, did you know that LEDs can sense light?

Continue reading “A Tin Can Phone, But With Magnets”

Adora-BLE Synth Wails Without Wires

Isn’t this the cutest little synth you ever saw? The matching sparkly half-stack amp really makes it, visually speaking. But the most interesting part? There’s not a wire in sight, ’cause [Blitz City DIY]’s futuristic rig sends the bleep boops over Bluetooth LE.

Hardware-wise, both the synth and the amp are fairly simple. Underneath each of those cute little printed keys is one of those clicky momentaries that usually come with bright button caps in primary colors — the keys themselves just press-fit over the tops. All twelve ebonies and ivories are connected up to an Adafruit Feather, which communicates over Bluetooth LE to a CircuitPlayground Bluefruit (CPB) in the amp. Each time a note is played on the synth, its corresponding color circles comet-like around the CPB’s NeoPixels, which shine through the amp’s speaker grille.

The super interesting part is that all the hard work is happening in the code. Both boards have the same array of colors in rainbow order, and the CPB has an array of tone frequencies that match up one for one with the colors. For every note played, the CPB looks up the color, swirls it, and plays the note. If you want to build one, this project is wide open — [Blitz City DIY] even made a learn guide with all the dirty details. Be sure to check out the demo and extended walk-through after the break.

More in the market for making a computer keyboard? Just grab the nearest ESP32.

Continue reading “Adora-BLE Synth Wails Without Wires”

A 3D-Printed Bass Guitar

A visit to the hardware hacking area of the recent Hacker Hotel hacker camp in the Netherlands would bring plenty of interesting pieces of hardware to delight the eye. Among them though was one to delight the ear, and on hearing it we asked whether its creator could put it online so we could share it with you. [XDr4g0nX]’s bass guitar is 3D printed, and while it still contains some non-3D-printed parts it’s still a very effective musical instrument.

This is not the first model he’s produced, he told us, an earlier guitar was entirely 3D-printed but proved not to be rigid enough. Tuning such an instrument merely resulted in its bowing out of shape and becoming unplayable as well as out of tune. This one has hefty steel bars for rigidity, though it uses a Yamaha neck rather than 3D-printing the whole instrument.  The main body of the instrument has to be printed in multiple parts and epoxied together, which he’s done without some of the ugly seams that sometimes disfigure prints of this nature.

Having heard it, we’d be hard pressed to tell it wasn’t a more traditional guitar, but then again since people have made guitars from all kinds of scrap it’s not the first home build we’ve encountered.

Self-Playing Kalimba V2 Thanks To Readers Like You

Would you like to know the great thing about this community we have here? All the spitballing that goes on every day in the comments, the IO chat rooms, and in the discussion threads of thousands of projects. One of our favorite things about the Hackaday universe is that we help each other out, and because of that, our collective curiosity pushes so many designs forward.

[Gurpreet] knows what we’re talking about. He’s back with version two of his self-playing kalimba, driven as strongly as ever by the dulcet tones of the Avatar theme. Now the robo-kalimba is rocking two full octaves, and thanks to your comments and suggestions, has relocated the servos where they can’t be picked up by the soundboard.

We gasped when we saw the new mechanism — a total of 15 rack and pinion linear actuators that make the kalimba look like a tiny mechanical pipe organ. Now the servos float, fixed into a three-part frame that straddles the sound box. [Gurpreet] melted servo horns to down to their hubs rather than trying to print something that fits the servos’ sockets.

Thumb your way past the break to check out the build video. [Gurpreet] doesn’t shy away from showing what went wrong and how he fixed it, or from sharing the 3D printering sanity checks along the way that kept him going.

Plucking kalimba tines is a difficult problem to solve because they’re stiff, but with timbre sensitive to many degrees of pressure. A slightly easier alternative? Make a toy player piano.

Continue reading “Self-Playing Kalimba V2 Thanks To Readers Like You”

Introducing The XFM2: A New FM Synthesizer Board

[René Ceballos] contacted us about the new XFM2 FM synthesizer board, successor to the XFM that we covered on Hackaday last year. In addition to changing FPGAs from a Spartan 6 to an Artix-7 35, the DAC was also upgraded from 16 to 24 bits. Since the project is based around two easily available boards for the FPGA and DAC functionality, it is something that should be easy for anyone to recreate.https://images.squarespace-cdn.com/content/v1/5d2c7309e3281e0001ef5655/1580208742008-DDG6FHLVST9DTOU5YDV7/ke17ZwdGBToddI8pDm48kIzPiMR3_Rs2gge4hyoameUUqsxRUqqbr1mOJYKfIPR7LoDQ9mXPOjoJoqy81S2I8N_N4V1vUb5AoIIIbLZhVYxCRW4BPu10St3TBAUQYVKc8LXFP3nIOov1DiYlxUpn2kjauiJB9jSbs9pkYnnzvQkOGqqUmgmVAUPjW85v7F78/xfm2.PNG?format=1500w

The project consists of a lower board that features the opto-isolated MIDI-input port, a 24LC1025 EEPROM, and a few passives, on top of which are mounted the Adafruit UDA1334A-based I2S decoder board and a Digilent Cmod A7-35T, containing the Xilinx XC7A35T-1CPG236C Artix-7 FPGA. [René] has made a schematic and BOM available on the XFM2 page. Total part cost should be about $99.

A user manual, installation guide, and the binaries that have to be loaded into the FPGA – using the provided instructions – are all made available. Unfortunately no HDL source is provided, but that shouldn’t take away from the fun of assembling an FM synthesizer board like this.

[René ] said that based on the feedback to the XFM project, he is now working on a visual user interface for the board. Once this is all working and depending on the feedback from XFM2 users, he may decide to start a crowdfunding campaign.