Polyphonic MIDI to CV Conversion

From circuitbending to homebrew stompboxes & synths, keep the DIY spirit alive!

Moderators: Kent, luketeaford, Joe.

Post Reply
User avatar
Chris Willocks
Common Wiggler
Posts: 181
Joined: Mon Dec 09, 2019 1:09 pm
Location: England
Contact:

Polyphonic MIDI to CV Conversion

Post by Chris Willocks » Sat Jan 16, 2021 8:08 pm

Can anyone offer any help with polyphonic MIDI to CV conversion? It's been the missing link in my knowledge up to now and for some reason I can't get my head around what is actually going on in terms of the software side of it i.e. how to write a suitable program that serves this purpose.

I have Hal Chamberlain's Musical Applications of Microprocessors, which has a few pages on this, however it is still going over my head.

Ideally, I just want to understand how to program a simple PIC-based polyphonic MIDI to CV converter circuit that offers the standard CVs such as velocity, pitchbend etc. My knowledge of programming has basically gone to nothing since my university days about 11 years ago.

I think my knowledge is fine when it comes to the hardware e.g. DACs etc. It's just when it comes to programming. That's the missing part I think.

Tom Wiltshire from Electric Druid has kindly been helping me hugely with the design of the Poly-8 MIDI to CV Converter that I've yet to release, which I very much appreciate. But I feel like I should at least gain a decent level of understanding of how everything works properly, as I don't particularly want to burden Tom at the moment. It's just mainly for future reference i.e. if I ever need to build any new modules.

Thanks,
Chris

User avatar
guest
Super Deluxe Wiggler
Posts: 5636
Joined: Mon Aug 19, 2013 11:49 am

Re: Polyphonic MIDI to CV Conversion

Post by guest » Sat Jan 16, 2021 10:24 pm

i might be able to help. are you looking for more info on the inidividual tasks the code does to achieve the overall goal, or more low level details on how to actually code up those tasks?
openmusiclabs.com

User avatar
Chris Willocks
Common Wiggler
Posts: 181
Joined: Mon Dec 09, 2019 1:09 pm
Location: England
Contact:

Re: Polyphonic MIDI to CV Conversion

Post by Chris Willocks » Sun Jan 17, 2021 7:31 am

guest wrote:
Sat Jan 16, 2021 10:24 pm
i might be able to help. are you looking for more info on the inidividual tasks the code does to achieve the overall goal, or more low level details on how to actually code up those tasks?
Hi guest, I'm just looking at understanding it from the ground up; so how to write the program from the start. The hardware configuration is just a simple PIC controller with some DACs and op amps.

Thanks.

User avatar
guest
Super Deluxe Wiggler
Posts: 5636
Joined: Mon Aug 19, 2013 11:49 am

Re: Polyphonic MIDI to CV Conversion

Post by guest » Sun Jan 17, 2021 8:09 am

do you already know general midi handling code, and just need the polyphonic aspect?
openmusiclabs.com

User avatar
Chris Willocks
Common Wiggler
Posts: 181
Joined: Mon Dec 09, 2019 1:09 pm
Location: England
Contact:

Re: Polyphonic MIDI to CV Conversion

Post by Chris Willocks » Sun Jan 17, 2021 3:00 pm

guest wrote:
Sun Jan 17, 2021 8:09 am
do you already know general midi handling code, and just need the polyphonic aspect?
To be honest, I don't have experience with MIDI handling code. It's something I need to learn.

User avatar
guest
Super Deluxe Wiggler
Posts: 5636
Joined: Mon Aug 19, 2013 11:49 am

Re: Polyphonic MIDI to CV Conversion

Post by guest » Mon Jan 18, 2021 3:18 am

ok, that would be the place to start. to handle midi, you need to use the serial port, which isnt too bad. are you intending to use libraries, or do you want to write your own functions? will this be in C? it would be good to get a platform to start testing on, so build up a microcontroller with midi interface, and maybe some leds for outputs at the moment. midi will go to the USART RX pin.
openmusiclabs.com

User avatar
Altitude909
Super Deluxe Wiggler
Posts: 3636
Joined: Wed Aug 24, 2011 5:13 pm
Location: Meesheegan

Re: Polyphonic MIDI to CV Conversion

Post by Altitude909 » Mon Jan 18, 2021 6:58 am

Might want to look through the yarns code how and see how she implemented it.
https://mutable-instruments.net/modules/yarns/

User avatar
KSS
Super Deluxe Wiggler
Posts: 4875
Joined: Mon Jan 25, 2016 7:28 am

Re: Polyphonic MIDI to CV Conversion

Post by KSS » Mon Jan 18, 2021 11:12 am

I was also going to suggest a deep dive into Emilie's open source Mutable Instruments code. The pre-Euror rack synths especially. Ambika? was-is polyphonic. Anushri?

User avatar
Chris Willocks
Common Wiggler
Posts: 181
Joined: Mon Dec 09, 2019 1:09 pm
Location: England
Contact:

Re: Polyphonic MIDI to CV Conversion

Post by Chris Willocks » Mon Jan 18, 2021 4:10 pm

Okay, thanks for the suggestions everyone.

I'll take a look at the source files. I guess it's a matter of learning C and MIDI code etc. and then trying it out with a testing platform.

User avatar
guest
Super Deluxe Wiggler
Posts: 5636
Joined: Mon Aug 19, 2013 11:49 am

Re: Polyphonic MIDI to CV Conversion

Post by guest » Tue Jan 19, 2021 1:44 am

yeah, i find the best way to learn this stuff is to have a project to work on. pick a platform that youre familiar with, or that has good online support (forums, etc), and then start with one small part of the project and get that working. then build up the next small bit, etc.
openmusiclabs.com

User avatar
analogmonster
Common Wiggler
Posts: 66
Joined: Wed Jun 26, 2013 6:12 am
Location: Matrix thread Germany
Contact:

Re: Polyphonic MIDI to CV Conversion

Post by analogmonster » Tue Jan 19, 2021 3:34 am

guest wrote:
Tue Jan 19, 2021 1:44 am
yeah, i find the best way to learn this stuff is to have a project to work on. pick a platform that youre familiar with, or that has good online support (forums, etc), and then start with one small part of the project and get that working. then build up the next small bit, etc.
Exactly. My opinion is, that each and every problem can be solved systematically. I started all my microcontroller projects - well, with a microcontroller. I developed an 8 channel polyphonic MIDI2CVGATE module for my Formant Modular:

ucvm_gesamt.jpg
ucvm_gesamt.jpg (46.17 KiB) Viewed 225 times

I finally renamed the project to UCVM (Universal Control Voltage Module), as microcontroller based projcts have the charme to be able to theoretically provide infinite functionality because of being programmed. First it was designed as a 8 voice polyphonic MIDI2CVGATE module, then I added a MIDI monitor functionality, then I added a CVGATE2MIDI function, etc, see also my project site.

The point is, I first built the microcontroller circuit and nothing else, and my software started with setting a bit sequence on some output pins of the controller, nothing more. I added more and more hardware, and more and more software step by step, each being tested on its own, and I learned a lot just by doing.

I started writing the software in Atmel Assembler, what was no problem as I went forward systematically in small steps, and I kept assembler. You see it is a quite primitive code which has grown with the increasing functionality of the module.

And yes, it was a lot of fun 8-)

User avatar
Chris Willocks
Common Wiggler
Posts: 181
Joined: Mon Dec 09, 2019 1:09 pm
Location: England
Contact:

Re: Polyphonic MIDI to CV Conversion

Post by Chris Willocks » Tue Jan 19, 2021 11:54 am

analogmonster wrote:
Tue Jan 19, 2021 3:34 am
guest wrote:
Tue Jan 19, 2021 1:44 am
yeah, i find the best way to learn this stuff is to have a project to work on. pick a platform that youre familiar with, or that has good online support (forums, etc), and then start with one small part of the project and get that working. then build up the next small bit, etc.
Exactly. My opinion is, that each and every problem can be solved systematically. I started all my microcontroller projects - well, with a microcontroller. I developed an 8 channel polyphonic MIDI2CVGATE module for my Formant Modular:


ucvm_gesamt.jpg


I finally renamed the project to UCVM (Universal Control Voltage Module), as microcontroller based projcts have the charme to be able to theoretically provide infinite functionality because of being programmed. First it was designed as a 8 voice polyphonic MIDI2CVGATE module, then I added a MIDI monitor functionality, then I added a CVGATE2MIDI function, etc, see also my project site.

The point is, I first built the microcontroller circuit and nothing else, and my software started with setting a bit sequence on some output pins of the controller, nothing more. I added more and more hardware, and more and more software step by step, each being tested on its own, and I learned a lot just by doing.

I started writing the software in Atmel Assembler, what was no problem as I went forward systematically in small steps, and I kept assembler. You see it is a quite primitive code which has grown with the increasing functionality of the module.

And yes, it was a lot of fun 8-)
Cool, thanks everyone. I'll give it a go. Now is the time to learn something new anyway, with all this lockdown time we're having. I've always been okay most of the time with designing and understanding analog circuits, with having a physics background, but learning how to program microcontrollers will take things to the next level.

These modules look great also. Definitely something to aspire to. I'll check out your website.

Thanks,
Chris

User avatar
Chris Willocks
Common Wiggler
Posts: 181
Joined: Mon Dec 09, 2019 1:09 pm
Location: England
Contact:

Re: Polyphonic MIDI to CV Conversion

Post by Chris Willocks » Tue Jan 19, 2021 1:59 pm

Sorry, I forgot to ask; how difficult is it to adapt a poly MIDI to CV circuit to a scanning matrix on a Fatar keybed for example i.e. like that found in a non-modular poly synth? I presume the only difference is the circuitry between the input and microcontroller i.e. no MIDI?

User avatar
KSS
Super Deluxe Wiggler
Posts: 4875
Joined: Mon Jan 25, 2016 7:28 am

Re: Polyphonic MIDI to CV Conversion

Post by KSS » Tue Jan 19, 2021 2:47 pm

Not sure I'm following this question?

The scanned KBD is providing alternate* input to your uP. It's up to you what to do with it.

The output is MIDI and-or CV.

*The other input beng MIDI. And whatever else you might want to have as input.

User avatar
KSS
Super Deluxe Wiggler
Posts: 4875
Joined: Mon Jan 25, 2016 7:28 am

Re: Polyphonic MIDI to CV Conversion

Post by KSS » Tue Jan 19, 2021 2:58 pm

I'm going to play devils advocate a little.

When you propose to add poly to your MIDI2CV module, you're also entering a new level of potential expectations. Expectations which are *currently* ramping up *considerably*. Between MPE and poly AT, there's quite a bit to a modern commercial-level poly MIDI2CV module these days.

If you're not doing this leading edge type product then you fall back into a tier *heavily* laden with really decent and good products. Inexpensive too. Like the CV.OCD or Mutable's MIDI module. OR the Hexinverter DIY with the RPOCC firmware. Or many, many others!

I'm a very big fan of true DIY and Doing. It. Yourself. *is* really rewarding. But in this particular case, this devils advocate is suggesting you might be far better off working with one of the people already well versed in the problem and its solutions. Focus on your other modules, and the business behind them.

User avatar
Chris Willocks
Common Wiggler
Posts: 181
Joined: Mon Dec 09, 2019 1:09 pm
Location: England
Contact:

Re: Polyphonic MIDI to CV Conversion

Post by Chris Willocks » Tue Jan 19, 2021 4:28 pm

KSS wrote:
Tue Jan 19, 2021 2:47 pm
Not sure I'm following this question?

The scanned KBD is providing alternate* input to your uP. It's up to you what to do with it.

The output is MIDI and-or CV.

*The other input beng MIDI. And whatever else you might want to have as input.
Okay, that makes sense.
KSS wrote:
Tue Jan 19, 2021 2:58 pm
I'm going to play devils advocate a little.

When you propose to add poly to your MIDI2CV module, you're also entering a new level of potential expectations. Expectations which are *currently* ramping up *considerably*. Between MPE and poly AT, there's quite a bit to a modern commercial-level poly MIDI2CV module these days.

If you're not doing this leading edge type product then you fall back into a tier *heavily* laden with really decent and good products. Inexpensive too. Like the CV.OCD or Mutable's MIDI module. OR the Hexinverter DIY with the RPOCC firmware. Or many, many others!

I'm a very big fan of true DIY and Doing. It. Yourself. *is* really rewarding. But in this particular case, this devils advocate is suggesting you might be far better off working with one of the people already well versed in the problem and its solutions. Focus on your other modules, and the business behind them.
To be honest, it's just for understanding purposes really. As I mentioned; Tom from Electric Druid has kindly been collaborating (which I'm very grateful for) on a poly MIDI to CV module to go with the Poly-8 modules I've been producing. I haven't really contributed much to his MIDI to CV design apart from the front panel. He has designed the circuit and written the code etc. But I just wanted to make the effort to try and understand how the concepts work; just for my own sanity and future reference more than anything else.

I myself will just be sticking to designing analog modules for the time being, until I feel knowledgeable enough to do otherwise.

You're right though and I'm certainly not going to get ahead of myself.

User avatar
analogmonster
Common Wiggler
Posts: 66
Joined: Wed Jun 26, 2013 6:12 am
Location: Matrix thread Germany
Contact:

Re: Polyphonic MIDI to CV Conversion

Post by analogmonster » Wed Jan 20, 2021 2:24 am

Chris Willocks wrote:
Tue Jan 19, 2021 1:59 pm
Sorry, I forgot to ask; how difficult is it to adapt a poly MIDI to CV circuit to a scanning matrix on a Fatar keybed for example i.e. like that found in a non-modular poly synth? I presume the only difference is the circuitry between the input and microcontroller i.e. no MIDI?
I did this with my microcontroller keyboard projects. Fatar keyboard key scanning matrices scanned by microconrollers and converted into MIDI sequences by them. See also:

Formant keyboard old style
µNet keyboard unit incl. Fatar connection description
Moog System 55 clone keyboard unit with MIDI

User avatar
Kampfzwerg
Learning to Wiggle
Posts: 41
Joined: Fri Mar 29, 2019 5:23 am
Location: the bellybutton of Europe

Re: Polyphonic MIDI to CV Conversion

Post by Kampfzwerg » Wed Jan 20, 2021 8:06 am

Hello Chris,

I'm in the same situation here. I need a Polyphonic Midi2CV Module as well for my Oberheim eight voice clone.
Actually I'm working on the schematics right now. I will use a PIC16F886 with eight MCP4922 DACs.

The problem with of the shelf modules is that you have no control over the inputs and what they to.

I was also about to suggest Emilies code for reference, but Altitude909 was faster ;)

Good luck with your project!
WOMEN AND CATS WILL DO AS THEY PLEASE,
AND MEN AND DOGS SHOULD RELAX AND GET USED TO THE IDEA.

User avatar
Chris Willocks
Common Wiggler
Posts: 181
Joined: Mon Dec 09, 2019 1:09 pm
Location: England
Contact:

Re: Polyphonic MIDI to CV Conversion

Post by Chris Willocks » Wed Jan 20, 2021 5:28 pm

I appreciate the suggestions and information. I'll take a closer look when I can.

Chris

Post Reply

Return to “Music Tech DIY”