Digital Harmonica

Hi .. So I'm attempting to make a digital harmonica, nothing too fancy just the usual ten hole diatonic with possibly an octave change an vibrato.

This would need something like twenty inputs for the note selections and probably some more for the octave and vibrato.

I'm a newbie or at least really basic level. So my question is which model should I work with. The digi harmonica will probably use midi via pro tools via arduino or what have ye. My concerns are around latency and input amount.

Somewhere along the way there will be a breath sensor for expression so this will also need input.

The idea is to use the breath sensor over the full range (key of c) notes for expression much like a keyboard breath sensor.

Another consideration is the size of the arduino model. Idealy it would be good to keep the build as close to the harmonica size, but if it means sacrifice to prevent latency then so be it.

I'm looking at available options regards sensors and so far the hall effect seems to be favourite, the difficulty is trying to make one chamber operate both inhale and exhale. Whatever the sensor it will probably be digital and not an analogue input.

Any ideas or guidance would be appreciated and thanks for reading.

Hi, richikennedy,

the sensors would have to be analog? Is it important to really play it, as an instrument or is the general purpose an input device to write scores?

Hi Kevin77 , thanks for the response.

The intention is to play the harmonica. The outlook is to have no sound come from the digital design but for this to trigger notes in a midi system. So in effect more like a controller in the shape of a harmonica.

I can relate to your thoughts upon analogue input but I have come across some considerations with this.

I'm trying to replicate exhale and inhale in the same chamber, similar to the actions of a harmonica. This is then affected by which sensor I use. The outlook just now is to have a sensor at either end of the chamber, one sensor could capture an event of blowing and the opposite sensor could capture the sucking. (in case your unfamiliar with harmonica notation, the exhale note produces a different note from the inhale).

So say for instance I used microphone sensors which feed out into the analogue inputs of Arduino, both microphones would pick up a level of the input air sound. I reckon it would be difficult to distinguish which would be inhale and which would be exhale, so to use the microphones as a trigger may not work. Alongside this the microphones on the surrounding chambers will also pick up the sound (although I think this could be thresh holded in the code )

Bear in mind 20 notes -would that be 20 mics x £5. (Although this is not a major issue but can other sensors present a better effect.)

Durability - Saliva damage, electrical cut out

At the moment I'm looking to see if it can be done and any working progress will be a bonus.

I thought if I could somehow trigger the sensors this would trigger the midi data and sound stored in pro-tools database would play in accordance to associated trigger.

If I used something which was as simple as on/off this could switch the note on and off and I could use the breath sensor to provide duration of note.

An idea just now is the hall event sensor, if I blow a magnet towards the sensor it will switch the state to on and by stopping the blow (magnet aided with a spring) the magnet falls away from the hall event sensor which will switch the state to off.

The state on can trigger a note on and the state off can trigger a note off.

So at the moment i'm thinking it should be a digital input.

How do you view this with the further information I have given Kevin77, also are you familiar with any process which uses two sensors in the same chamber to trigger two separate notes.

It is going to be quite a challenge!

What if you would use a tiny motor. You could then print a housing around those motors. If you attach a some kind of rotor to that DC motor, you could measure a voltage and maybe even a current. If so you could both measure direction of airflow AND speed.

Not sure if that’s the way forward, cant imagine getting a motor in the chambers… i’m looking to exhale and inhale and use the power of my breath to move something back and forward which will trigger the sensors on either end of the chamber (where the mouth holes are).

But thanks for your suggestion

If you want strange sounds from a harmonica a dsp attached to a microphone might be easier..

regards

Allan

Thanks for the input allanhurst

I am trying to build a digital harmonica, i.e. I would be using a built model as a controller that resembles the harmonica shape. I would inhale and exhale into the model. The model would not produce sound but instead sensors will be triggered inside the model. The triggers will send data for midi.

The main thing is to keep the harmonica shape and reproduce sound from another source

Cheers though

Then this is very much a mechanical /acoustics problem - not a microcontroller one.

Not sure I can contribute much...l

regards

Allan

Actually Kevin77 that sounds lie a good idea… after mulling it over it might be the ticket, do you know of a small fan to fit that motor and stay within 1cm

Don't you have access to a 3d printer?
Look for a FABLAB in your neighbourhood and print it?

I would not try to detect the motion of air. Pressure is much easier to sense. You will still get a measure of the force/speed and you only need one sensor to detect both positive and negative pressure.

A row of sensors such as MPXH6250A6U could probably fit on a single circuit board and line up with holes in the harmonica 'mouthpiece'. They may be a little big, so stagger them or find a smaller sensor.

The size of the Arduino is an issue. The smallest possible Arduino (without putting the chip directly on your own PCB) is the Pro Mini. Extra hardware is required to upload a program onto the Mini. A Micro or a Teensy would also be suitable. Then you need to fit the MIDI interface circuitry - this should not be too had to fit the required optocouplers on the PCB. You may even be able to fit the standard DIN plug on one end of the harmonica but it's probably better to have a short-ish cable with the connector on the end.

The big problem is that a MIDI sound generator is a note based device and it is not designed to simulate real sounds like a harmonica or any other wind instrument. I have a Yamaha WX11 wind controller. This has a breath sensor as well as keys. The problem is that the values from the breath sensor determine the note on velocity, fair enough you might think, but this means that once a note is triggered by holding down the keys any change in breath strength does not change the volume of the note being sounded.

I have made a patch so that the note on is sent at full volume and then the breath values have an overall control of the volume, so it can change as you continue to blow. However the snag with this is that timbre of an instrument changes depending on how hard you blow and so a lot of the quality of the sound is lost if every note is just full on but not so loud.

I think you will have similar problems with your project. Also how are you going to change the MIDI sound for an exhale? What MIDI messages will you use.

Not only is this mechanically a very difficult project but when you get it right it might not sound any good if you don't consider fully the sound aspect. This is a candidate for sound modeling synthesis but that requires a more powerful processor like the Teensy 3.6 and a lot of complex maths.

Thanks for chipping in your views all:

First I'd like to raise further awareness that at this stage I am going to test out as many possibilities as I can. I am a newbie and I will make lots of mistakes and sometimes I don't completely understand where your ideas are coming from. I do however go away and think all the suggestions over.

I have a friend who maintains it cant be done and I think otherwise. So any help is much appreciated and ill keep plodding away.

So Kevin77 to answer yours - no basically I don't have that but I will look around and thanks for the signpost. I looked at those tiny motors, the site led to a stepper motor (but I think you meant to guide me to a DC tiny motor). I'm going to keep testing with this to see if its workable. My concern is the fan would need to stop as soon as the note ends. So some resistance may be needed to prevent the fan freewheeling, so it stops instantly when you stop blowing or sucking air.

Would 1 dc motor register both forward and reverse motions?

I will have to create a model to house the sensors or motors. While doing this I thought I could build an air cavity unit which would be connected to the air pressure sensor. So in effect as you blow and turn the dc motor fan this sends the voltage which triggers an on state;( midi is triggered- so note on and note selected as written in code) meanwhile as you are breathing into the chamber the airflow carries through to the air cavity where the air pressure sensor detects a change which triggers midi cc expression. (Trial and error though).

Hi MorganS and thanks

I think you are thinking as I initially set out. I have tried two breath sensors and came to realise that the PSI is a major concern. Initially I tried the MPX5010P and nearly popped a vessel trying to get a reaction from the sensor. I ended up using the MPXV4006GP as this had a lower PSI response. This sensor is a good size and would suit. The problem is though it costs about £12 per unit. Initially I thought I would need 20 to cover every note but I could be wrong there. With that in mind I opted to maybe just use it as an expression or note duration.
You say extra hardware is needed to upload (what are you meaning by this) initially I upload from computer onto arduino using the usb as I have an arduino uno. Anything else there I should consider.

I liked the idea of the Teensy as well due to its size and I read (Gordophone breathsensor on internet) used this in his project recommending its use for midi applications as has midi over usb support.

Previously I had tried the arduino built into the harmonica model and I used thermistors to trigger the midi (usb to computer to midi yoke into protools to trigger midi notes). This worked by producing sound although the note only switched off when the thermistor cooled (crazy idea but a good lesson).

Anyway thanks for suggestions some good stuff I can mull over there

Grumpy_Mike thanks I can totally relate to that regards the sound performance. This is going to be a major issue which ill have to look further into. Ive seen some sights which have harmonica sounds triggered by midi and theyre not too bad sounding. There is a lot of trial and error for me and I don't have the answers but ill chip away at it. Ive still to figure out how to produce polyphony allowing a chord to be played. I liked your idea with the breath control having an overall control. I'm not at that stage just now although it probably should be planned out to give direction. Ill have a look at that teensy 3.6 as well. I think my concern was the amount of pins for either analogue or digital (still need to sort out the way forward)

All great viewpoints thanks much

MorganS:
The size of the Arduino is an issue. The smallest possible Arduino (without putting the chip directly on your own PCB) is the Pro Mini. Extra hardware is required to upload a program onto the Mini. A Micro or a Teensy would also be suitable. Then you need to fit the MIDI interface circuitry - this should not be too had to fit the required optocouplers on the PCB. You may even be able to fit the standard DIN plug on one end of the harmonica but it's probably better to have a short-ish cable with the connector on the end.

I don't know if I would put the arduino and the midi interface on the harmonica... It is going to be cumbersome enough as it is... I would use a wire to pass the sensor data to my arduino and make a larger box with the micro controller, the Midi, maybe a battery etc etc.

Grumpy_Mike:
Also how are you going to change the MIDI sound for an exhale? What MIDI messages will you use.

The exhale would end previous note and start a new note. Inhale and exhale produce different notes... So I think that should not be too hard.

Converting breath to a note with pitch bend, volume and Velocity, that is going to be very hard... So as you said, Mike it is going to be a challenging build.. But not impossible (Depending on how professional you want it to sound)

P.s. : Sorry for the link, I meant DC motors indeed. (polarity will change of the voltage if the direction of air flow changes)

The exhale would end previous note and start a new note. Inhale and exhale produce different notes... So I think that should not be too hard.

But the two sounds have different tambura, so you have to change the instrument. I don't see too many exhale harmonica sounds in a MIDI GM palette.

Edit
Just been googling and came across the Jamboxx controller. There is also a DIY harmonica concepts video using pressure sensors that look interesting.

richikennedy:
I have a friend who maintains it cant be done and I think otherwise. So any help is much appreciated and ill keep plodding away.

I think it can be done although there will be some limitations like Mike said - MIDI can't easily capture all of the expression possible with a wind instrument.

Would 1 dc motor register both forward and reverse motions?

DC motors are very poor generators. You would likely get millivolts or microvolts out of this proposed turbine system.

I think you are thinking as I initially set out. I have tried two breath sensors and came to realise that the PSI is a major concern. Initially I tried the MPX5010P and nearly popped a vessel trying to get a reaction from the sensor. I ended up using the MPXV4006GP as this had a lower PSI response. This sensor is a good size and would suit. The problem is though it costs about £12 per unit. Initially I thought I would need 20 to cover every note but I could be wrong there. With that in mind I opted to maybe just use it as an expression or note duration.

I am surprised you couldn't see much output from the 5010. But there are other sensors which give more sensitivity. Unfortunately they do cost about that much each, so this is not a very cheap project.

You say extra hardware is needed to upload (what are you meaning by this) initially I upload from computer onto arduino using the usb as I have an arduino uno. Anything else there I should consider.

If you're trying to make it the same size as a regular harmonica then the UNO is much too large. The Pro Mini (unlike almost every other Arduino) needs an FTDI cable to be able to upload a new program.

Previously I had tried the arduino built into the harmonica model and I used thermistors to trigger the midi (usb to computer to midi yoke into protools to trigger midi notes). This worked by producing sound although the note only switched off when the thermistor cooled (crazy idea but a good lesson).

Two thermistors in series makes a great breath sensor. The one that is 'upwind' gets cooled more than the downwind one. This kind of thing is used in glider variometers where the flow rates being measured are millilitres per minute.

The Teensy 3.6 is a good idea but I would not put something that large on board the harmonica. Just focus on getting the MIDI data out of the harmonica. Then you can build something else that turns MIDI into sounds or you can use a conventional MIDI synth as the output device.