Off Topic : MIDI to CV converter for Breath Controller

Hello people there…

I have a breath controller made by Murat, in Turkey…

A very good device, even if you might prefer some TEControl (seems to be excellent) or other brands…

It outputs CC2 (Breath), CC7 (expression), after touch, trhough a MIDI din plug… I would like it to be converted to control voltage.
SO what I need is a (possibly cheap and not too big in size) module which would extract CC2 values and convert it into variable 0-5V output…
Of course, when no new CC2 is sent, the module should stay stable on the last CC2 he received…
The module would have a DIN MIDI input, a power input, and a 0-5V analog output…
If it also re-route MIDI messages to an USB plug, well that would be a non neglectable bonus, but that’s not truly necessary for me…

Any suggestion is more than welcome…
Have a nice day…
Thierry

This can be done with a micro-controller like Arduino/Teensy/PIC. I would choose a Teensy (because of the onboard USB interface). MIDI input with a 6N138 opto-coupler and voltage out with a simple transistor driver - or an OpAmp?

But - I think - you won’t build it by yourself?

Regards, Holger

Why would I not ? Once someone tells me how to do it, and elaborates the code, why not ?

Do I need an USB interface ? I’m not against it, if the MIDI IN messages can also be sent to USB, that’s a plus… But I can also live without…

This is the right attitude :grin:

I cannot tell… Without USB I would choose an Arduino (Uno or Nano). And a MIDI shield (Sparkfun or china compatible). The Uno has 5V, so with a simple driver (transistor, two resistors) you should have your hardware.

With USB my favorite micro-controller is the Teensy… but he has only 3.3V output… should be no problem with the right transistor circuit for theoutput pin…

Regards, Holger

This should do almost everything you ask, maybe with a little tweaking to code and output amps :slight_smile:

1 Like

Thanx a lot @Axeman
I had found this page, but was not sure how adapted it would be…
The thing is, I don’t know how they extract any CC and make it a CV…
I see that it will convert NOTE ON, NOTE OFF, into trigger, gate, velocity and 1V/oct outpuits…
There is a Control output, but where is there any switch or encoder or selector to decide that the selected control is Breath Controller or Mod Wheel or whatever ?
Is it written inside the code ?

Ultimately you pick up a specific CC and apply it with a vague element of steering based on the MIDI definitions. . .
But in truth it’s just an un-enforced agreement.

It’s actually REALLY flexible … :smiley:

Oh… I should have indicated that my knowledge in programming is limited to a few Basic instructions, which I remember from the 1980s…
Alors merci @wyleu, mais j’ai strictement rien pigé…

By in large it’s not particularly hard but you do need to identify EXACTLY what problem you are trying to solve. I could twitter on about Test Driven Development ( You write a set of tests to defined the problem and then once you have written the tests and they all fail you start writing the code until they all pass and then you stop), but I wont :smiley:

Python (IMHO) is pretty easy. Librarys like Jack where you don’t have to worry about irritations like memory handling simply mean you get some stuff in, examine it. muck around with it then send it on somewhere else is largely the sort of thing we are doing all the time . . . Zynthian just tries to be as light as possible and lets the linux audio components Jack & ALSA do the actual work . . .

A good place to start is actually reading the zynthian code itself…
zythian-ui/zynthian_gui.py round about line 683 … for instance does most of the early GUI stuff and it’s surprising how quickly reading about short, bold and long pushes will teach you, both how the zynth does it, and a little bit of python.

The process of modifying code and contributing to the master repository is a bit more involved but express a desire to learn it and Im sure we will help.

But the basic element is define EXACTLY what you would like to do ( diagrams, code snippets, metaphor or simile , contemporary dance performance, you know the kind of thing …)

I understand nothing…
Except that I know what I want to do ; I want to blow into my Breath Controller, and I want a module which converts CC2 messages into a variable 0-5V voltage, so I can input it in a CV input…
Contemporary dance performance is not my taste that much, and I’m sure I would be bad at it…

2 Likes

Apologies.

No worry… pas grave… je m’en remettrai… I will survive…
:wink:

Here is a list of MIDI to CV converters with varying complexity. Some allow selection of CC. If you want to build your own then you could use a ATtiny85 like this:


(Image stolen from above site which links to an obsolete site.)

The principle is that the ATtiny85 (or any other microcontroller) decodes MIDI on its input and uses PWM of output pins which are then integrated by the simple RC low-pass filter to give a control voltage. This image has USB interface but it could equally be interfaced with MIDI. This does of course require some understanding of electronics and coding of which you confess to have none :wink: . This would be a nice little project for someone with, I don’t know, 6 months spare time… If only I didn’t have to work so hard through my confinement :frowning: .

Thanx a lot… This sounds nice… Except that, I confirm, I will not be able to develop the software for it…
But what you say about PWM and filter is interesting because Murat (who builds the MRT Breath Coontroller) told me
You cannot make using arduino because PWM output is not good for the anolog output.
You don’t mind if I send him your answer ?

It is true that PWM on Arduino may be too coarse to give useful CV. PWM is effectively a 1-bit DAC. As a rule of thumb, each doubling of sample rate doubles the signal to noise ration (SNR). For CV we may want a full scale 0…10V to be respresented by CC values 0…127 which is fairly easy to do with PWM at a few KHz but if we want to vary the voltage with higher resolution, e.g. CC values 0…8191 may require higher sample rate. This may be possible with a faster processor (than Arduino). It is a trade off between resolution, slew-rate, noise, etc.

Of course, what we are talking about is a bit daft - we are taking an inherent analogue signal (breath pressure / noise), converting it to an analogue electrical signal, converting to digital MIDI signal, then converting back to an analogue electrical signal. It would be easier to use a breath controller that puts out a voltage which would be fairly simple to build.

1 Like

I think you are totally right on that point… Converting an already converted signal will generate loss… and maybe, also latency…
Better work on the analog side, before the signal is converted to MIDI…
I will abandon the midi converter idea…
Thanx for your help…

In my TODO list is the task of developing the software for the Zynaptik circuit, that includes room for these optional features:

  • 16 digital I/O ports (extra MCP23017) => Gate
  • 4/8 analog inputs (up to 2 x ADS1115 modules) => CV-in
  • 4/8 analog outputs (up to 2 x MCP4728 modules) => CV-out

Perhaps it’s time to do it … :wink:

Regards,

3 Likes

Pehaps it’s time I finish building my Zynthian…

1 Like

I sat on my kit for three months before I got a soldering iron on it. I’m sure that low bar can be beaten :laughing:

@Baggypants I souldered everything the very same day when it arrived… or the next day, maybe… Or the next week-end…
I even plugged the wires to the screen and the sound card, when I received them…
And then I left everything as is…
I don’t even know if I installed the software…

2 Likes