Spherical Range Detector

SAM_1725Hi all! It’s been a while – but I’ve been busy with a few more midi projects. With this year’s Manchester Mini Maker Faire approaching, I decided to begin making more devices that will be fun to use, visually as well as physically.

This project started when I saw these stainless steel spheres for sale in a local shop – they may not be something I’d put in the garden, but I was sure there was a way to make them into an interesting MIDI device.

After a little research into capacitive sensing (there’s excellent explanations here and here) I decided to make a device that would detect proximity and send MIDI CC messages accordingly. After a short struggle getting the CapSense library to work on the Arduino Due or Olimexino, I decided to write my own code for sensing the capacitance, which was surprisingly easy and I would recommend that you have a go as a learning exercise. Some schematics & pseudocode:

That’s all it is! Most of the work is done by the code.

-Start a microsecond timer

-Set the Send Pin to HIGH

-While the Receive Pin is LOW, increment the timer

The timer will take longer and longer as capacitance increases. It’s a very narrow margin though, as the longest timer values I get are on the scale of 4 milliseconds or less. You should also be aware that there’s a lot of noise going on, especially at the threshold of detection. The little Olimexino is completely devoted to averaging out and rescaling the very messy signal we get, and the response is still far from predictable.

Capacitive sensors like these are also notoriously fussy about their surroundings; for example, the exact position of the sphere on my desk in the video is about the only place I’ve tried yet where I can get a useful range of 6-10 inches. Move it anywhere else nearby and it drops to 2 inches or less.

That’s enough introduction. Here’s some video!In this video, the detected range controls a resonant filter effect on an audio track – this is one of the simplest (but most fun) applications I’ve tried.

In the above video a threshold value has been set, above which a midi message will be triggered. This is combined with a delay effect controlled by the detected range.

As usual, get in touch at chrisballprojects@gmail.com if you want help with making your own. That said, there are many arduino tutorials devoted to this subject, so just google “Arduino Capacitive Sensor”.

Posted in MIDI Projects | Leave a comment

Weird CC Converter in Processing

I’ve been working with MIDI and processing recently, but this week I’ve been taking a look specifically at CC messages. These are used to send control information, usually for audio effects.

I came up with a little sketch in processing that converts CC messages that describe physical properties of a system to an output that describes positions of points when affected by those conditions. A video will explain all that a lot more clearly (perhaps):

So, to explain in a little more detail, you can send 7 different CC messages that control various aspects of the physics of the environment – they’re listed on the faders at the bottom of the video.

The output is simply the X and Y positions of the 4 points – 8 messages in total, that you can assign to whatever you like in your DAW software. It’s an interesting way to explore lots of different effects at once, although the output is (not surprisingly) fairly abstract and hard to predict. But I like that kind of thing.

Another video below.

Posted in MIDI Projects | Leave a comment

MIDI Visualisations in Processing

I’ve been working on a few MIDI-based programs in Processing recently, a couple of which are MIDI visualisers. These are programs that create a visual display based on the output from a midi file (similar to those seen at: http://www.musanim.com/). The visualiser will use the pitch, velocity and duration of midi notes to create the display. I’ve uploaded a video to youtube, but due to some problems getting videos out of processing, the quality is rather low – I hope you can discern what’s going on (edit: I’ve invested in fraps and improved the video).

So what have I used the MIDI pitch and velocity for?

Firstly, I’ve used colour to highlight harmonic relationships between notes (those unfamiliar with music theory may want to skip this bit). I’ve worked on the principle that the perfect 5th is the most consonant interval, and assigned colours to notes being played based on the relationships in the diagram below.

Circle of Fifths, with RGB colour wheel

Circle of Fifths, with RGB colour wheel

So, we can see that the notes most consonant with C are F and G, which will have the most similar colours. Also, the least consonant interval (i.e. a tritone, or the “devil’s interval”) between C and F# also has the most jarring colour difference.

The velocity of each midi note was then assigned to the speed at which the arcs move, as well as the transparency of each arc (i.e. quiet notes are slow and barely visible, and loud notes are fast and bright) .The final length of each arc is decided by a mix of how loudly a note was played combined with how long it was held on for.

Practically, I used a piece of DAW software to play the midi file, and routed this through the excellent midi yoke (http://www.midiox.com/) to a processing sketch using the rwmidi library (http://ruinwesen.com/support-files/rwmidi/documentation/RWMidi.html). I’ve used the processing video library to capture frames, but as mentioned, there are some significant problems if you wish to sync this output with an audio file (especially if your processing sketch is even remotely complex). I’m looking into using some screen capture software instead, such as fraps.

If you’re interested in this sort of thing, feel free to contact me for the original processing sketch – the video doesn’t really do it justice.

Edit: I’ve included a new midi visualisation below.

Posted in MIDI Projects | Tagged , , , , , , , | Leave a comment

Laser Harp MkIII

Hi everyone! It’s been a while (as I promised). The third prototype Laser Harp is now complete!

Long exposure, with beams highlighted by a sheet of white paper

Long exposure, with beams highlighted by a sheet of white paper

The main changes are:

-It’s bigger (20% larger)

-More buttons! I’ve used one of these (https://www.sparkfun.com/products/8033). Mostly these are used to control key changes, but the bottom row send MIDI control change messages

-LCD display to show key & scale (http://www.coolcomponents.co.uk/catalog/16×2-display-p-944.html)

-Improved velocity detection

-Improved calibration function (badly calibrated triggers display on the lcd)

-Olimexino STM32 instead of Arduino Uno (https://www.olimex.com/Products/Duino/STM32/OLIMEXINO-STM32/)

MDF construction

MDF construction

The frame is an mdf construction (shown above), with a final finish of matte black paint, about 6 coats over as many days.

I’ve included a few more images of construction below:

LEDs installed on button board

LEDs installed on button board

Button board with translucent rubber cover

Button board with translucent rubber cover

All in one piece

All in one piece

The control panel

The control panel

There’s also a video on youtube, if you’d like to see it in action:

This one will shortly be given to Lostrites (http://www.myspace.com/lostrites), for a kind of beta evaluation – they will use it for a while and get back to me with any changes they’d like to make (added scales, functions, potentiometers etc.). I’d like to thank them for financing this project (and their patience).

As usual, if this is of particular interest to you, just get in touch and I’ll be happy to supply more information about how this was made (code, schematics, etc.).

I’ve yet to become any good at playing it, but hopefully we’ll get some video of it being used for musical performance before too long.

Posted in MIDI Projects | Tagged , , , , , , , , , , , , , , , , | 3 Comments

Arduino Meetup

Any recent visitors to my blog might have noticed that it is lacking in recent posts. I want to reassure you that I haven’t lost momentum – just in blogging. I’m not in the habit of recording everything that I do,  although it’s probably a habit I should adopt. In the last few months I’ve made a reubens tube (short-lived – don’t use plastic pipe) and a midi-controlled air siren. Both have unfortunately been demolished to make way for other projects, and I didn’t even think to keep any record of either.

However, I have been working on something that will be here to stay. Back in September a band called Lostrites got in touch with me and asked if I’d be interested in making them a laser harp, either to use on stage or to keep around their studio as a novelty. I was, so I’ve been putting a lot of my spare time recently into putting something a bit more special than my earlier attempts. It’s not finished – but it is (finally) shaping up well.

I’ll be at the Manchester Madlab tomorrow evening presenting the instruments I had at the maker faire earlier this year. You can find out more here. I’ll also be bringing along the newest laser harp, which will unfortunately be for display only. Plenty of little things to fix before it’s useable.

Thanks go to James Medd (www.jamesmedd.co.uk) and Mike Stephens (www.bitbytebit.co.uk) for inviting me along to speak – it’s not something I have a lot of experience of, but you can at least expect to have any questions you might have about my instruments answered, as well as having a go!

Posted in Events, Laser Harp | Tagged , , , , , , | Leave a comment

Magic 8 Box

So, among the items I purchased recently from Cool Components was this Red 16×2 LCD Display. I haven’t made anything for a couple of weeks, so I boshed out a Magic 8 Box (or a digital version of the Magic 8 Ball).

Magic 8 Box

Magic 8 Box

This thing contains all 20 original answers from the original Magic 8 Ball, and I’ve added 10 of my own. Its function is pretty straightforward – you just push the button for an answer to your yes/no question. I was pleased to be able to house it all inside the box that the LCD arrived in from cool components.

I’m using an Arduino powered by a 9V battery (although you might notice I’m using USB power above). This is a great beginner’s project, so if you want a copy of the code and a crudely drawn schematic, just contact me.

I’m going to be taking this apart soon, as I intend to use the LCD display in the next version of the laser harp, which will include (hopefully): slightly more responsive note detection (Although it’s already nearly perfect), a paint job, a MIDI reset, a display for showing scale and fundamental note, and maybe even a MIDI setup option, so you can add your own scales to the library via a MIDI in port.

Posted in Arduino Projects | Tagged , , , , , , | 1 Comment

The Maple

So I recently purchased a few things from Cool Components, one of which was the Leaflabs Maple.

Leaflabs Maple

Leaflabs Maple

This is a development board that is very similar to the Arduino – in fact, one of its aims is to be as similar to the Arduino as possible, while giving a chunk of extra processing power, memory and loads of extra inputs, all on a smaller board! At the Maple’s heart is a 32-bit ARM microprocessor, the same type already used in hundreds of different portable devices. Maple also has its own IDE that is so similar in function and use to the Arduino’s that you can directly copy code between them, and unless you’ve used any chip-specific commands your code will be fine (I’ve tried this, and it worked perfectly). The only drawback I’ve found is that the Maple’s power handling is a little less sturdy than the Arduino’s and I’ll have to be a little more careful to avoid frying it.

I intend to use this board in the next iteration of the tap detector – the increased memory and processing speed is exactly what I need to work out all those FFT’s more accurately, and with less delay.

Posted in Gear | Tagged , , , , , , | Leave a comment

Manchester Mini Maker Faire

So, I’ve spent the last two days showing the three midi inputs I’ve made to the general public, and the good news is that two of them are durable and flexible enough to be used for this. The tap detector didn’t fare so well, there being a little too much ambient noise to put it to use. However, I do have plans to improve it and build in noise cancelling algorithms.

I also met and saw a number of other great and talented exhibitors:

James Medd – An artist, maker and musician – www.jamesmedd.co.uk

Iain Sharp – Beautiful little custom synths and cycle pong! – www.lushprojects.com

Rodrigo Constanzo – Innovative electronic musician – www.rodrigoconstanzo.com

The Manchester Hackspace (HAC MAN) – a bunch of electronics geniuses – hacman.org.uk

The Manchester Girl Geeks – Especially Amy Mather for her Arduino Volcano – manchester.girlgeekdinners.com

Also, check out the work of Susan Thomason! http://blipblipi.co.uk/

Apologies to those not included here – I was impressed by every stall at the maker faire and will certainly be attending events like this again. I also intend to join the Manchester hackspace when I have a free Wednesday evening!

Posted in Events | Leave a comment

Laser Harp MkII Video

As promised, I’ve recorded a couple of videos of two of my musical devices in use. Enjoy!

Posted in Laser Harp, MIDI Projects | 6 Comments

Another Midi Gizmo – Continued

So, the above device (Arduino powered again) is intended to detect (via a microphone) different kinds of taps on a surface, and convert them into midi messages. It’s intended use is for laying down Midi drum tracks quickly and easily, without the need for expensive V-kits or drum pads. However, there are few problems with it at the moment – it works, but not too well. It may only be about 95% accurate at detecting the difference between two different instantaneous sounds, and that gets worse the more sounds you add to it’s memory. I think the concept is good, but it may need to be realised on something more powerful than an Arduino! I will be bringing it along to the MOSI mini maker fair this week, so if you want to have a go, come on down.

Posted in Arduino Projects, MIDI Projects | Tagged , , , , , , , , , | 3 Comments