Posts | Comments

Planet Arduino

Archive for the ‘audio’ Category

The equipment used in professional radio and TV studios is both extremely high quality and very expensive indeed, and thus out of the reach of an experimenter. Happily as studios are refurbished there’s a steady supply of second-hand equipment which can be surprisingly cheap, but as [Nathan] found out with a Quartz audio router, comes with no control software. What’s to be done with what’s essentially a piece of junk? Remove its brain and replace it with one that can be controlled, of course!

On the PCB alongside a bank of switch matrices is an FPGA which does the heavy lifting. That’s “heavy” in a limited sense, because all it does is handle the chip select lines for the matrices and write data to their registers. This is a task that can be handled by a microcontroller, so in goes an Arduino Nano, which along with a few other board modifications delivers a serial-controlled studio router.

The interesting part for us in this project comes from a look at the date codes on the board, they’re from the early 2000s. This is (roughly) contemporary with the ATmega chip on the Arduino, so we’re curious as to why the designers saw fit to use an FPGA when the microcontrollers of the day were clearly up to the task for much less outlay. We suspect a touch of millennium-era price inflation, but we can’t be sure.

Meanwhile, old broadcast kit has featured here before.

You don’t have two ears by accident. [Stoppi] has a great post about this, along with a video you can see below. (The text is in German, but that’s what translation is for.) The point to having two ears is that you receive audio information from slightly different angles and distances in each ear and your amazing brain can deduce a lot of spatial information from that data.

For the Arduino demonstration, cheap microphone boards take the place of your ears. A servo motor points to the direction of sound. This would be a good gimmick for a Halloween prop or a noise-sensitive security camera.

Math-wise, if you know the speed of sound, the distance between the sensors, and a few other pieces of data, you wind up with a fairly simple trigonometry problem. In non-math terms, it is easy to get a feel for why this works. If the sound hits both microphones at once, it must be coming from straight ahead. If it hits the left microphone first, it must be closer to that microphone and vice versa. If the sound were right in line with both microphones but closer to the left, the time delay would be exactly due to the speed of sound over the distance between the sensors. If the time is less than that, the sound must be somewhere in between.

The microphone modules have both analog outputs and digital outputs. The digital output triggers if the sound level exceeds a limit set by a potentiometer. By using these modules, the circuit is trivial. Just an Arudino, the two modules, and the servo motor.

Now imagine that you wanted all this spatial detail to come through your headphones. Recording binaural audio is a thing. You can 3D print a virtual head if you are interested. We’ve seen projects for this several times.

We all love seeing data represented in pretty ways — whether it’s necessary or not. Take VU meters for example. They’re a super useful tool for audio editors to balance signals, but they also look really cool, even if you’re only listening to music. Who didn’t use a Winamp skin with a built-in VU meter back in the day? Even after the demise of everyone’s favorite media player, we still see these great graphs popping up all over the place.

Most recently, we’ve seen VU meters circle back around to have a bit of a retro vibe in this awesome Arduino-controlled LCD VU meter built by [mircemk]. Based on the KTAudio VU Meter project, it features an ultra-wide LCD, audio input, and volume knob, all tidily wrapped up in a case whose color scheme that can only conjure images of the famed Altair 8800, or an old Tektronix oscilloscope. The LCD itself is fairly responsive — but you can judge for yourself in the video below. The signature fading that so commonly accompanies screen refreshes on LCDs such as this one really adds to the retro effect.

You may just need one of these displays on your desk — after all, while you may not need to know how loud each audio channel is, don’t you at least want the information available? Just in case. Bar graph display a bit too modern-looking for you? Well then you should check out [mircemk]’s OLED version that displays dual analog meters.

We’ve all been there: after assessing a problem and thinking about a solution, we immediately rush to pursue the first that comes to mind, only to later find that there was a vastly simpler alternative. Thankfully, developing an obscure solution, though sometimes frustrating at the time, does tend to make a good Hackaday post. This time it was [David Wehr] and AudioSerial: a simple way of outputting raw serial data over the audio port of an Android phone. Though [David] could have easily used USB OTG for this project, many microcontrollers don’t have the USB-to-TTL capabilities of his Arduino – so this wasn’t entirely in vain.

At first, it seemed like a simple task: any respectable phone’s DAC should have a sample rate of at least 44.1kHz. [David] used Oboe, a high performance C++ library for Android audio apps, to create the required waveform. The 8-bit data chunks he sent can only make up 256 unique messages, so he pre-generated them. However, the DAC tried to be clever and do some interpolation with the signal – great for audio, not so much for digital waveforms. You can see the warped signal in blue compared to what it should be in orange. To fix this, an op-amp comparator was used to clean up the signal, as well as boosting it to the required voltage.

Prefer your Arduino connections wireless? Check out this smartphone-controlled periodic table of elements, or this wireless robotic hand.

Effects pedals: for some an object of overwhelming addiction, but for many, an opportunity to hack. Anyone who plays guitar (or buys presents for someone who does) knows of the infinite choice of pedals available. There are so many pedals because nailing the tone you hear in your head is an addictive quest, an itch that must be scratched. Rising to meet this challenge are a generation of programmable pedals that can tweak effects in clever ways.

With this in mind, [ElectroSmash] are back at it with another open source offering: the pedalSHIELD MEGA. Aimed at musicians and hackers who want to learn more about audio, DSP and programming, this is an open-hardware/open-software shield for the Arduino MEGA which transforms it into an effects pedal.

The hardware consists of an analog input stage which amplifies and filters the incoming signal before passing it to the Arduino, as well as an output stage which does the DAC-ing from the Arduino’s PWM outputs, and some more filtering/amplifying. Two 8-bit PWM outputs are used simultaneously to make pseudo 16-bit resolution — a technique you can read more about in their handy forum guide.

The list of effects currently implemented covers all the basics you’d expect, and provides a good starting point for writing custom effects. Perhaps a library for some of the commonly used config/operations would be useful? Naturally, there are some computational constraints when using an Arduino for DSP, though it’s up to you whether this is a frustrating fact, or an opportunity to write some nicely optimised code.

[ElectroSmash] don’t just do pedals either: here’s their open source guitar amp.

DriveInSpeakersOpener-8 copyEver used a drive-in movie speaker? Build your own and listen to your tunes in retro style.

Read more on MAKE

The post Revive Old Drive-In Speakers with a Modern LED Twist appeared first on Make: DIY Projects and Ideas for Makers.

A stock Arduino isn’t really known for its hi-fi audio generating abilities. For “serious” audio like sample playback, people usually add a shield with hardware to do the heavy lifting. Short of that, many projects limit themselves to constant-volume square waves, which is musically uninspiring, but it’s easy.

[Connor]’s volume-control scheme for the Arduino bridges the gap. He starts off with the tone library that makes those boring square waves, and adds dynamic volume control. The difference is easy to hear: in nature almost no sounds start and end instantaneously. Hit a gong and it rings, all the while getting quieter. That’s what [Connor]’s code lets you do with your Arduino and very little extra work on your part.

The code that accompanies the demo video (which is embedded below) is a good place to start playing around. The Gameboy/Mario sound, for instance, is as simple as playing two tones, and making the second one fade out. Nonetheless, it sounds great.

Behind the scenes, it uses Timer 0 at maximum speed to create the “analog” values (via PWM and the analogWrite() command) and Timer 1 to create the audio-rate square waves. That’s it, really, but that’s enough. A lot of beloved classic arcade games didn’t do much more.

While you can do significantly fancier things (like sample playback) with the same hardware, the volume-envelope-square-wave approach is easy to write code for. And if all you want is some simple, robotic-sounding sound effects for your robot, we really like this approach.

The HackadayPrize2016 is Sponsored by:

Filed under: Arduino Hacks, digital audio hacks, The Hackaday Prize

It’s just a little past Halloween, but Adafruit’s talking dog collar, modeled after the movie Up, is still a nice fusion between crafting and hacking.

One reason that Adafruit is so popular is that every time they sell us something, they give us some of the worlds best tutorials and libraries for free. For this project they’re using their Bluetooth LE board and their Audio FX board with a few more mundane vitamins to construct the collar. We’re sure the enterprising hacker could find alternatives if they so choose.

The collar is made of leather and 3D printed props. They went with alkaline batteries rather than lithium, to keep their doggy companion a little safer. All the electronics are hidden under the various props and the wiring is routed behind the belt. To control the app, the different sound bytes are mapped to buttons on their Bluetooth-to-serial phone app.

It’s a good starter tutorial, and the concept applied differently would definitely be good for at least one good prank on a coworker or friend.

 


Filed under: Arduino Hacks

[Captain Credible] is a chiptune music artist. He wanted to release an EP, but a regular old em-pee-three was too lame for him, so he made a tiny board with a coin cell, an ATtiny85, and a 3.5mm socket on it.

Rather than just writing some code to generate the tones for a pre-composed song, his “Dead Cats” EP generates the music itself. Using the arduino-tiny library, which adds the tone() function to the ATtiny, he has the chip pick its own time signature, key, subdivisions, and tempo. The melody and drum beat is randomly generated into an array. In addition to that, there are some code “one-liners” which insert unique sounds. After that the code just loops through the music.

If you don’t like the song, simply unplug the audio cable and plug it back in. The 3.5mm jack he chose has a built-in micro-switch, so the board is only powered up if someone is listening. If you’d like to see the circuit diagram, purchase the EP, or take a look at the code, all of that is available on his site.


Filed under: Arduino Hacks, musical hacks

ns1

We’ve been playing with NS1 Nanosynth in the last few weeks, when it first appeared under our radars on the Christmas’ Gift Guides (while going sold out in few days, after Synthopia blessed it with this interesting review).  It’s a hackable and customizable analog synthesizer coupled with an Arduino Micro platform.

Personally, it was one of my first steps into modular synthesizers. Nice sounds, easy approach. Peter Kirn is perfectly picturing this amazing compromise here!

Synths: they’re fun to tweak and play. Modulars: they’re fun to patch. Arduinos: they’re fun to hack. Small things: they’re fun to carry around.

But how to track patches? How to share sounds with friends? I was playing mainly with my son, and managed to print out a paper sketch depicting all the different pinout of the synth. I wasn’t satisfied with that, I needed more!

I started writing Sound Machines, about new patches, more sounds. It turned out I made a Fritzing part out of the Nanonsynth, and we started sharing each other patches. This repository holds them, and this is a short review of the best. Enjoy!

 

Here you can listen to the envelope Generator (ADSR) in action:

 

Want to add your very own sounds? You can either add it to their repository or comment here!



  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook