MIDI + blenders = RockBlend

 

 

About RockBlend

Do you have a hard time finding the motivation to practice your instrument?
Are you looking for a fun way of interacting with music?
Are you a nerd who’s into musical hackery?
If you said yes to any of the above then RockBlend is for you!

RockBlend allows you to use musical instruments to power your blender!

Calling All Hackers / Musicians

If you have a basic working knowledge of PythonMIDI, and circuits
you can configure RockBlend to do so much more! If you are interested in learning more AND/OR setting up RockBlend on your computer then keep reading!

Full disclosure: I haven’t touched this code in about a year, but I wanted to make a blog post about it anyway.

Hardware

Here is a basic system diagram:

Here is a list of the hardware I used (many of these can be interchanged with other devices!)

Note: if you don’t want to spend money on a Power Switch Tail (~$25.00-$30.00) OR
if you’re a circuit wiz who’s looking for a challenge you can follow this Sparkfun tutorial
to build a DIY Controllable Power Outlet using a relay board.

Software

Source Code

GitHub Repo

Tools
  • Python 2.7
  • Python Tkinter
  • Python Pygame

How To Use

Setting up the Arduino and the Power Tail
  • Connect a wire from Arduino’s digital pin 12 to the PowerTail’s + in pin (any Arduino digital pin can
    be used but you must edit the blender.ino sketch if you wish to do that)
  • Connect a second wire from Arduino’s GND pin to the PowerTail’s GND pin
  • Plug in your Arduino to the computer via a serial port to give it power and access
    to serial communication via USB
  • In my GitHub repo you will see a file arduino/blender/blender.ino, upload this to the Arduino
Setting up your MIDI controller

Plug in and power on your keyboard (or any MIDI device capable of playing 12 pitches) to your computer via USB

Starting RockBlend

>> cd src
>> python rockblend.py
If the serial communication between Arduino and RockBlend fails, or if RockBlend is unable to read MIDI messages, an error message will be displayed

Using RockBlend

There are two modes in RockBlend

  • Freestyle
  • Practice

Freestyle Mode allows you to play music in any key you want. RockBlend counts up how many notes
you’ve played every 2 seconds. If you are above a certain threshold (on my version you have to play around
4 notes per second) then the power relay will be turned on and the blender will power on.

Practice Mode checks to make sure you are playing your notes accurately. When you select practice
mode you will be prompted with a drop down menu that allows you to pick a note and a scale. For instance “C# Minor”.
If you are playing 80% of the notes in the proper key, then the blender will power on.

Guide for Developers

Breakdown of File Structure

arduino/blender/blender.ino
the file to upload to your Arduino.

src/rockblend.py
sets up the Python Tkinter GUI thread and initializes
serial and midi communications. This is the main script to run when starting RockBlend.

src/freestyleMode.py
Helper functions that spawn listener threads when the user is in freestyle mode.

src/practiceMode.py
Helper functions that spawn listener threads when the user is in practice mode.

src/scales.py
Helper functions that determine what notes are correct/incorrect when user is in practice mode.

src/serialComm.py
All serial communication functions such as intializing a connection, and writing over the serial connection.

src/midiComm.py
Contains a helper function to initialize a connection with your MIDI device.

 

One thought on “MIDI + blenders = RockBlend

Leave a Reply

Your email address will not be published. Required fields are marked *