Enginursday: The TeensyBoom

via SparkFun Electronics Blog Posts

If you read my last Enginursday post, you saw that I’ve been tinkering with Teensy Audio. I’d like to take this opportunity to unveil a what I’ve been working on since then.

The design files for the whole thing are on GitHub. I’ll admit that I’ve been working quickly, and the repo is somewhat roughshod. This very post is an attempt to document the underlying design!

Hardware Architecture

The hardware is fairly simple. The heart of it is a Teensy 3.2 with the Audio adapter. The buttons and LEDs are attached to the processor via the SPI bus, using daisy-chained shift registers. Every otherwise unused ADC channel has a potentiometer on it, for a total of sixteen.

alt text

The enclosure is a combination of technologies. The control panels are made from laser-cut acrylic, while the wooden ends were milled with a Shapeoko.

DSP Architecture

The signal processing in TeenyBoom is built out of Teensy Audio modules. They further break down into modules already present in the Teensy Audio libraries, and new ones that were written specifically for this project.

alt text

TeensyBoom Voice Architecture

A lot of the “plumbing” is from the Audio library - the filters, white noise source, multipliers and mixers.

Most of the drum-specific tone generation was written for this project based on analog circuit emulation. All of the sound is generated mathematically, and doesn’t involve any prerecorded tones.

The bass drum and tom-tom are two instances of the “simple drum” module. The snare drum is a related module that allows white noise to be added in. The hi-hat, cowbell and cymbal share a central module, the Clatter Generator, with design informed by the TR808 cymbal analysis paper by Werner, Abel and Smith. (There’s also a related bass drum paper, but I didn’t discover it until after selecting a different implementation).

alt text

Mapping of controls to voice parameters.

Control over the sound parameters is done with the processor ADC. It reads the potentiometers and updates the corresponding values in the synthesis modules.

Firmware

When I started this project, I had a number of requirements for the software. The basic composition and playback scheme is borrowed from the Roland TR series, with a few additions and improvements.

  • I wanted to be able to do most operations without stopping playback. The user can switch between pattern selection and editing without stopping, so compositions can be built up on the fly. The only operations that can’t be performed while playing are those that would be destructive to smooth playback, like reading and writing patterns from the SD card, or completely erasing patterns.
  • There is a “voice mute” mode that allows individual instruments to be turned off so the user can make variations of a pattern on the fly.
  • I borrowed the “pattern chaining” feature from the X0Xb0x. It’s an easy way to make patters that are longer than sixteen steps.

The application is written as an Arduino sketch. To keep things organized, it follows a variant of the “Model-View-Controller” design pattern.

alt text

The View is how the system represents data to the user. The LEDs on the control panel are an obvious aspect of this, but they’re only a small part of the system. Since the sound generation also delivers information to the user, and is more important and complex, I count it as part of the View.

The Model contains the data in the system. In this case, it is a data structure that represents the Pattern being played.

The Controller gathers input - it’s how the user interacts with the model (eventually pushing information back to the view). The user presses the buttons and twists knobs to generate input, which are interpreted into changes in the model and view.

It can be hard to rigidly apply MVC to an embedded system, because the underlying concepts don’t always translate (for instance: because they share an SPI bus, my controller input and view output are tightly linked). Still, there is significant value in dividing the work into sensible portions, and partitioning the system into a set of smaller modules. It keeps things organized, making extending and debugging the system easier.

It’s easier to determine why an LED is mistakenly stuck on if the LED update code is in an identifiable area!

Large Firmware Projects in Arduino

This is the most ambitious project I’ve ever written in Arduino. I’ve stumbled on a couple of issues related to organizing and managing the project.

The biggest issue is relatively simple: the Arduino IDE gets cumbersome if you’ve got too many files in the project. Once the tab-bar across the top of the Arduino IDE is full, it doesn’t handle additional files gracefully. The solution was to create an additional library for the DSP classes. As the signal processing code reaches maturity, it gets moved into the library, where it doesn’t crowd the IDE.

The Punch List

While it’s in good enough shape to demonstrate, projects like this tend to grow organically: dream up a feature, implement it, repeat until finished.

  • Based on my previous success with FreeRTOS, I was hoping to carve the application into a set of FreeRTOS threads. In a casual attempt, it didn’t appear that FreeRTOS and the Audio library coexist – I’m guessing they both use the same timer IRQ. As it stands, timing and tasking in the application are pretty crude, counting milliseconds and triggering tasks.
  • The hardware block diagram above omits anything related to a power supply. The whole thing has just been powered from the USB port on the development PC.
  • There’s no provision for per-voice volume control – the knobs have been allocated to other functions. I’ve been considering how to address this. One way would be to add an analog multiplexer and some more potentiometers, but building hardware takes more resources than writing software, so a clever software solution is more likely.

As I said above, it has its own GitHub repository. You’re welcome to clone & mutate as you see fit!

comments | comment feed

Internet of Voice Challenge with Amazon and hackster.io

via Raspberry Pi

Many of you have been using the Raspberry Pi as a platform for internet of things (IoT) hacking. With wired and wireless communication on board, Raspberry Pi 3 is a great platform for connecting the network, and network-accessible services, to the real world.

Where we're going, we don't need roads

Where we’re going, we don’t need roads

Voice recognition can add a whole new dimension to IoT projects. We recently showed you how to connect your Raspberry Pi to Amazon’s Alexa Voice Service to build your very own homebrew clone of the Echo voice appliance. Now, in partnership with Amazon and hackster.io, we’re giving you a chance to win Echo kit and Amazon gift vouchers by developing your own “internet of voice” projects with the Raspberry Pi.

I've still got the greatest enthusiasm and confidence in the mission

I’ve still got the greatest enthusiasm and confidence in the mission

Prizes will be awarded in two categories: best use of the Alexa Skills Kit as an integral part of the project, and best use of the Alexa Voice Service. The top prizes in each category are worth $1900, and the contest runs until the start of August. Head to hackster.io for more information, and good luck!

The post Internet of Voice Challenge with Amazon and hackster.io appeared first on Raspberry Pi.

Cosmic Bitcasting is a wearable radiation detector

via Arduino Blog

1_img3021-11low

Cosmic Bitcasting is a digital art and science project emerging from the idea of connecting the human body with the cosmos by creating a wearable device with embedded light, sound and vibration that will provide sensory information on the invisible cosmic radiation that surrounds us. This open-source project actually works by detecting secondary muons generated by cosmic rays hitting the Earth’s atmosphere that pass through the body.

Artist Afroditi Psarra and experimental physicist Cécile Lapoire worked together to develop a prototype of the wearable cosmic ray detector during a one-month residency at Etopia in Zaragoza, and is currently on display at the Etopia-Center for Art and Technology in Zaragoza as part of the exhibition REVERBERADAS.

img3553

Cosmic Bitcasting is comprised of an Arduino Lilypad, High Flex 3981 7×1 fach Kupfer blank conductive thread from Karl Grimm, Pure Copper Polyester Taffeta Fabric by Less EMF, white SMD LEDs, a coin cell vibration motor, and an IRL3103 MOSFET with a 100 Ohm resistor to drive the motor.

Intrigued? Take a look at the video below and read the diary of the residency to learn more!

 

Maker Faire Rome Call for Makers: Deadline June 30, 2016!

via Arduino Blog

600x400_en-1

A big thanks to everyone who already submitted their projects, performances, and workshops for Maker Faire Rome. However, due to such an incredible demand, the  Call for Makers submission deadline has been extended to Thursday, June 30th. That means you have one more week to send your applications to participate in the 4th edition of Europe’s biggest innovation event, held October 14-16,2016 at Fiera di Roma.

Want to join us in celebrating Maker culture this fall? With more than 100,000 square meters of exhibition space available, submit yours now!

Prizes and contests
All the projects selected within the Call for Makers are automatically eligible for the following prizes and contests if they match the requirements specified in each regulation.

CoderDojo Coolest Projects 2016

via Raspberry Pi

This weekend Philip and I went to Dublin to attend CoderDojo Coolest Projects. We got to meet hundreds of brilliant young digital makers and amazing volunteers.

YoungCoolestProjectAwards

CoderDojo Coolest Projects: a free tech event for the world’s youngest innovators, creators and entrepreneurs

As the event kicked off the news broke that Tim Peake had landed safely back on Earth, which meant Philip had to make some last minute changes to his presentation…

Ben Nuttall on Twitter

“Who knows who this is?” “It’s Tim Peake” “Where is he?” “In space” “No – he’s back on Earth!”pic.twitter.com/elfNXcAwsX

As we walked around the venue we grew more and more impressed by the projects on show. We asked each exhibiting group to talk us through their project, and were genuinely impressed by both the projects and their presentation. The first area we perused was the Scratch projects – games, animations, quizzes and more. I’m not the most accomplished Scratch programmer so I was very impressed with what we were shown.

When we moved on to a room of physical computing projects, we met Iseult Mangan, Ireland’s first Raspberry Pi Certified Educator:

Philip Colligan on Twitter

I met Ireland’s first ever @Raspberry_Pi certified educator @IseultManganpic.twitter.com/9RbLANKZdX

One of Iseult’s students, Aoibheann, showed us a website she’d made all about Raspberry Pi:

Philip Colligan on Twitter

This 9 year old Coder wrote her own @Raspberry_Pi website: http://dontpasstheraspberryjam.weebly.com/ – check it out!pic.twitter.com/TagshFWt2k

I even bumped into Tim Peake a few times…

Ben Nuttall on Twitter

@astro_timpeake sure gets aboutpic.twitter.com/4oS1tFgvQu

The Coolest of Projects

Here are some of my favourite projects.

First up, a home-made 3D holographic display. The picture does it no justice, but look close (or click to embiggen) and you’ll see the Scratch cat, which was spinning around as part of a longer animation. The girl who made it said she put it together out of an old CD case. Very cool indeed!

Scratch cat hologram

Scratch cat hologram

Plenty of great robots…

IMG_3999 IMG_4000 IMG_3997 IMG_3985 IMG_3995 IMG_3970

We arrived at a beautiful Pi-powered retro gaming console, and spoke to the maker’s Dad. He was excited for his son to be able to show his project to people from the Raspberry Pi Foundation and asked if we could stick around to wait for him to return. Here he is:

IMG_4047

When I mentioned one of my favourite Mega Drive games, he loaded it up for me to play:

IMG_4051

It took me about 15 years to complete this game – I was playing it before he was born!

This was really impressive: these two girls had made a Wii remote-pcontrolled hovercraft with a Raspberry Pi:

IMG_4039

Ben Nuttall’s post on Vine

Watch Ben Nuttall’s Vine taken on 18 June 2016. It has 0 likes. The entertainment network where videos and personalities get really big, really fast. Download Vine to watch videos, remixes and trends before they blow up.

I met DJ Dhruv, who demonstrated his livecoding skills in Sonic Pi, and gave a very professional presentation involving a number of handshakes:

Ben Nuttall on Twitter

DJ Dhruv is livecoding in @sonic_pi and teaching us about the history of the amen break. @samaaron you’d love thispic.twitter.com/tSrn0CTQzP

Pi-vision: a way to help blind people find their way around…

IMG_3986

Probably my favourite of all, this group created a 3D Minecraft Pi booth using mirrors. They showed me their Python code which ran simultaneously on two Pis, while one played music in Sonic Pi, with cross-application communication between Python and Sonic Pi to coordinate timings. A Herculean effort achieving a wonderful effect.

IMG_3990

IMG_3991

How can you get involved?

If you want to join us in giving more young people the opportunity to learn programming skills, learn to make things with computers, and generally hack things that didn’t need hacking, there are plenty of ways you can get involved. You can:

  • Set up a Raspberry Jam in your area, or volunteer to help out at one near you
  • Start a Code Club at a local primary school, or another venue like a library or community centre
  • Set up a CoderDojo, or offer to help at one near you

Also, I should point out we have an job opening for a senior programme manager. We’re looking for someone with experience running large programmes for young people. If that’s you, be sure to check it out!

Job opening: Senior Programme Manager at Raspberry Pi Foundation

As part of the Raspberry Pi Foundation’s mission to put the power of computing and digital making into the hands of people all over the world, we want to make these skills more relevant and accessible.

It’s kind of a thing to end blog posts with a GIF, so here’s mine:

SecuriTay on Twitter

Machine learningpic.twitter.com/c3sIJPd3PS

The post CoderDojo Coolest Projects 2016 appeared first on Raspberry Pi.