There’s More To MIDI Than Music – How About A Light Show?

MIDI instruments and controllers are fun devices if you want to combine your interest in music and electronics in a single project. Breaking music down into standardized, digital signals can technically turn anything with a button or a sensor into a musical instrument or effect pedal. On the other hand, the receiving end of the MIDI signal is mostly overlooked.

[FuseBerry], a music connoisseur with a background in electronics and computer science, always wanted to build a custom MIDI device, but instead of an instrument, he ended up with a MIDI controlled light show in the shape of an exploded truncated icosahedron ([FuseBerry]’s effort to look up that name shouldn’t go unnoticed). He designed and 3D-printed all the individual geometric shapes, and painstakingly equipped them with LEDs from a WS2818B strip. An Arduino Uno controls those LEDS, and receives the MIDI signals through a regular 5-pin DIN MIDI connector that is attached to the Arduino’s UART interface.

The LEDs are mapped to pre-defined MIDI notes, so whenever one of them is played, and their NoteOn message is received, the LEDs light up accordingly. [FuseBerry] uses his go-to DAW to create the light patterns, but any software / device that can send MIDI messages should do the trick. In the project’s current state, the light pattern needs to be created manually, but with some adjustments to the Arduino code, that could be more automated, something along the lines of this MIDI controlled Christmas light show.

Continue reading “There’s More To MIDI Than Music – How About A Light Show?”

Dumb Down Your Xiaomi Smart Lamp With A Custom Firmware

Undoubtedly, the ESP8266’s biggest selling point is its WiFi capability for a ridiculously low price. Paranoid folks probably await the day its closed-source firmware bits will turn against humanity in a giant botnet, but until then, hobbyists and commercial vendors alike will proceed putting them in their IoT projects and devices. One of those devices is the Yeelight desk lamp that lets you set its color temperature and brightness via mobile app.

[fvollmer] acquired such a lamp, and while he appreciated its design and general concept, he wasn’t happy that it communicates with external servers. So he did the only reasonable thing and wrote his own firmware that resembles the original functionality, but leaves out the WiFi part. After all, the ESP8266 has still a lot to offer in its core essence: a full-blown 32-bit microcontroller with support for the most common, hobbyist-friendly SDKs.

The lamp’s color temperature and brightness are set with a rotary encoder / push button combo switch, and the LEDs themselves are controlled via PWM. All things considered, it’s a rather straightforward endeavour, for which [fvollmer] chose the standalone C SDK. And in the end, it’s not like he’s unreasonably cautious to keep some control over his household items.

Go Big Or Go Home – This Arduino RC Car Can Take You There

Whether we like it or not, eventually the day will come where we have to admit that we outgrew our childhood toys — unless, of course, we tech them up in the name of science. And in some cases we might get away with simply scaling things up to be more fitting for an adult size. [kenmacken] demonstrates how to do both, by building himself a full-size 1:1 RC car. No, we didn’t forget a digit here, he remodeled an actual Honda Civic into a radio controlled car, and documented every step along the way, hoping to inspire and guide others to follow in his footsteps.

To control the Civic with a standard RC transmitter, [kenmacken] equipped it with a high torque servo, some linear actuators, and an electronic power steering module to handle all the mechanical aspects for acceleration, breaking, gear selection, and steering. At the center of it all is a regular, off-the-shelf Arduino Uno. His write-up features plenty of videos demonstrating each single component, and of course, him controlling the car — which you will also find after the break.

[kenmacken]’s ultimate goal is to eventually remove the radio control to build a fully autonomous self-driving car, and you can see some initial experimenting with GPS waypoint driving at the end of his tutorial. We have seen the same concept in a regular RC car before, and we have also seen it taken further using neural networks. Considering his background in computer vision, it will be interesting to find out which path [kenmacken] will go here in the future.

Continue reading “Go Big Or Go Home – This Arduino RC Car Can Take You There”

Portable Guitar Amp – Is That A Linux In Your Pocket?

When it comes to music production and audio engineering, Linux isn’t the most common choice. This isn’t for lack of decent tools or other typical open source usability issues: Ardour as a highly capable, feature-rich digital audio workstation, the JACK Audio Connection Kit for powerful audio routing, and distributions like Ubuntu Studio packing all the essentials nicely together, offer a great starting point as home recording setup. To add variation to your guitar or bass arrangement on top of that, guitarix is a virtual amp that has a wide selection of standard guitar effects. So when [Arnout] felt that his actual guitar amp’s features were too limiting, he decided to build himself a portable, Linux-based amp.

[Arnout] built the amp around an Orange Pi Zero with an expansion board providing USB ports and an audio-out connector, and powers it with a regular USB power bank to ensure easy portability. A cheap USB audio interface compensates the lacking audio-in option, and his wireless headphones avoid too much cable chaos while playing. The amp could theoretically be controlled via a MIDI pedalboard, but [Arnout] chose to use guitarix’s JSON API via its built-in Python web interface instead. With the Orange Pi set up as WiFi hotspot, he can then use his mobile phone to change the effect settings.

One major shortcoming of software-based audio processing is signal latency, and depending on your ear, even a few milliseconds can be disturbingly noticeable. To keep the latency at a minimum, [Arnout] chose to set up his Orange Pi to use the Linux real-time kernel. Others have chosen a more low-level approach in the past, and it is safe to assume that this won’t be the last time someone connects a single-board computer to an instrument. We surely hope so at least.

Unionize Your Variables – An Introduction To Advanced Data Types In C

Programming C without variables is like, well, programming C without variables. They are so essential to the language that it doesn’t even require an analogy here. We can declare and use them as wildly as we please, but it often makes sense to have a little bit more structure, and combine data that belongs together in a common collection. Arrays are a good start to bundle data of the same type, especially when there is no specific meaning of the array’s index other than the value’s position, but as soon as you want a more meaningful association of each value, arrays will become limiting. And they’re useless if you want to combine different data types together. Luckily, C provides us with proper alternatives out of the box.

This write-up will introduce structures and unions in C, how to declare and use them, and how unions can be (ab)used as an alternative approach for pointer and bitwise operations.

Continue reading “Unionize Your Variables – An Introduction To Advanced Data Types In C”

Pulling Music Out Of Thin Air With A Raspberry Pi

Pianos are great instruments, but being rather heavy and requiring a fair amount of space they are certainly not known for their convenience. Sure, there are more portable varieties available, but they rarely resemble the elegance and classiness of a grand piano. One option is of course to build a downscaled version yourself — and since you’re already customizing the instrument, why stop at the way you play it. [2fishy] didn’t stop there either and ended up with a wooden, space friendly, light controlled piano housing a Raspberry Pi.

Inspired by the concept of a laser harp, [2fishy] followed the same principle but chose a simpler and safer alternative by using LEDs instead. For each playable tone, a LED is mounted opposite a light dependent resistor, creating an array of switches that is then connected to the Raspberry Pi’s GPIO pins. A Python script is handling the rest, polling the GPIO states and — with a little help from pygame, triggering MIDI playback whenever the light stream is interrupted.

There are enough LED/LDR pairs to play one full octave and have some additional control inputs for menu and octave shifting. This concept will naturally require some adjustments to your playing — you can get an idea of it in the demonstration video after the break. And if this design is still not the right size for you, or if you prefer to play in total darkness, this similar MIDI instrument using ultrasonic distance sensors could be of interest.

Continue reading “Pulling Music Out Of Thin Air With A Raspberry Pi”

Stepping Up Your Python Printf Debugging Game

Debuggers come in all shapes and sizes, offering a variety of options to track down your software problems and inspecting internal states at any given time. Yet some developers have a hard time breaking the habit of simply adding print statements into their code instead, performing manual work their tools could do for them. We say, to each their own — the best tools won’t be of much help if they are out of your comfort zone or work against your natural flow. Sometimes, a retrospective analysis using your custom-tailored debug output is just what you need to tackle an issue.

If the last part sounds familiar and your language of choice happens to be Python, [Alex Hall] created the Bird’s Eye Python debugger that records every expression inside a function and displays them interactively in a web browser. Every result, both partial and completed, and every value can then be inspected at any point inside each individual function call, turning this debugger into an educational tool along the way.

With a little bit of tweaking, the web interface can be made remote accessible, and for example, analyze code running on a Raspberry Pi. However, taking it further and using Bird’s Eye with MicroPython or CircuitPython would require more than just a little bit of tweaking, assuming there will be enough memory for it. Although it wouldn’t be first time that someone got creative and ran Python on a memory limited microcontroller.