Author |
Message |
himijendrix
Joined: Apr 16, 2012 Posts: 18 Location: Germany
|
Posted: Wed Aug 14, 2013 5:33 am Post subject:
MIDI2CV Project + PCB files Subject description: Complete and verified project for building a Midi2CV interface, using the Atmel Atmega 168/328. |
|
|
Hello,
I built a MFOS Mini Synth Mark II.
For my other Synthesizer I use the MCV876 from Marc Bareille, which has more features, but also has the tendency to crash with some reasons.
I'm still searching for the problem.
So a different interface was needed, and I found a project based on the Atmega 168 uC. It is based on a project from Wolf Schuster
http://wolf.schuster.ws/?page_id=156 (It's in German )
I added the DIP Switch, fixed some bugs in the Software and created a PCB file.
Features are:
- Midi In, Midi Thru
- Channel selection by DIP switch
- 1 V/oct Out
- Velocity Out
- Trigger Out
- Gate Out
- Clock Output + Clock Divider Pot
All Outputs are set to 5V but can be easily increased to 10V by editing the Software. For the Power Supply +/- 12V are needed.
For the Panel i used Aluminium Dibond (direct UV Print, 3mm)
There is also the technique of printing on photo paper and using a foil (lamination) to stick it to the aluminium dibond. But i ordered a sample and it wasn't so hard and didn't look good. The foil will also come off if you drill many holes.
I ordered them from http://www.digitaldruck-fabrik.de/werbeschilder/kalkulieren-bestellen.aspx for cheapy 3,50€.
The bigger faceplate for my minisynth (33x24 cm) cost around 7,30€ + porto. The Layout was done with Front designer http://www.abacom-online.de/html/frontdesigner.html
This is the PCB, but the DIP Switch must be vice versa. The settings are explained in the Code comments of the Firmware. It can be opened with the Arduino IDE.
The RAR File contains all the Eagle files, the Parts Layout, schematic, Code and PCB Layout (which is very tight, so if you think about using the Iron Transfer method for making your own PCB, you might have to change the layout size in eagle!):
http://electro-music.com/forum/download.php?id=35530
It should all work, i tried it and even a mass of fast Midi Input didn't crash it. But if you find any mistakes, please write me.
For the Future there could also be:
- Pitchbend
- DIN Sync Output for Roland Drum Machines
- Learn Button (Instead of the Dip Switch)
- A second CV/Velocity Output
- Controller Message Output
Description: |
|
Filesize: |
583.66 KB |
Viewed: |
660 Time(s) |
This image has been reduced to fit the page. Click on it to enlarge. |
|
Description: |
|
Filesize: |
1.13 MB |
Viewed: |
564 Time(s) |
This image has been reduced to fit the page. Click on it to enlarge. |
|
Description: |
The Aluminium Dibond. 3mm is perfect for the Potentiometers and isn't very flexible at all! |
|
Filesize: |
121.21 KB |
Viewed: |
550 Time(s) |
This image has been reduced to fit the page. Click on it to enlarge. |
|
Description: |
|
Download |
Filename: |
Midi2CV v1.0.rar |
Filesize: |
225.37 KB |
Downloaded: |
851 Time(s) |
Last edited by himijendrix on Sun Feb 16, 2014 5:35 am; edited 3 times in total |
|
Back to top
|
|
|
elmegil
Joined: Mar 20, 2012 Posts: 2177 Location: Chicago
Audio files: 16
|
Posted: Wed Aug 14, 2013 6:56 am Post subject:
|
|
|
Very nice work, thank you for sharing it! |
|
Back to top
|
|
|
LFLab
Joined: Dec 17, 2009 Posts: 497 Location: Rosmalen, Netherlands
|
Posted: Thu Aug 29, 2013 5:56 am Post subject:
|
|
|
Pretty cool way to make frontpanels, and quite cost effective.
So, in your opinion the UV direct print is best? Is it durable?
About 7-8 euros for a 14TE eurorack frontpanel, nice! |
|
Back to top
|
|
|
PHOBoS
Joined: Jan 14, 2010 Posts: 5591 Location: Moon Base
Audio files: 705
|
|
Back to top
|
|
|
himijendrix
Joined: Apr 16, 2012 Posts: 18 Location: Germany
|
Posted: Mon Sep 02, 2013 12:21 am Post subject:
|
|
|
@LFLab
Yes, the UV direct print is the best solution in my opinion.
I think it's hard enough for this application. I'm not sure if the colour will fade a bit whithin some years, but i think it should stay like this if not exposed directly to sunlight for years...
@PHOBoS
I got them from here ... http://www.musikding.de/Ampstyle |
|
Back to top
|
|
|
scriptstyle
Joined: Jan 22, 2008 Posts: 250 Location: nj
|
Posted: Sun Feb 02, 2014 11:20 pm Post subject:
|
|
|
i have only glanced at the sketch for this, my understanding is that you pick what midi channel you want to transmit over to the DACs. do you think that it would be possible to extend all 16 channels with separate DACs for each channel(access through an analog switchs or rotary). I am aware the ATmega328 limit of 14 digital I/O pins, and 6 analog. the ATmega2560 has 54 digital I/O and 16 analog. that sounds like i could build something like this around that? also this sketch weighs in around 5.5kb what do you guys think the estimated size of said sketch? I/O stuff aside i do not think a sketch this size would fit on a 32kb micro controller...
Am i missing something simple? the last few days i have been full speed on Midi like its a new thing again. Hello world 2014 |
|
Back to top
|
|
|
himijendrix
Joined: Apr 16, 2012 Posts: 18 Location: Germany
|
Posted: Mon Feb 03, 2014 6:10 am Post subject:
|
|
|
So do you want to receive and convert Midi at all Channels simultaneously?
Because you are writing that you want to use a rotary switch, and I don't completely understand for what?
If you want to use them in parallel, the sketch wouldn't definitely not become too huge for the Atmega328, and if you want to use 16 DACs you can chain them in an i2c bus, so they will only need 2 digital pins, like before.
But then you will have to use the MAX519 as an DAC, because it has 4 inputs for setting the adress (each input connects either to 5V or to ground (High, Low)) which gives you 2^4 = 16 different addresses. So 16 Max519 can share one i2c bus.
See the Datasheet on page 8:
http://pdf1.alldatasheet.com/datasheet-pdf/view/73502/MAXIM/MAX517BCPA.html
But you should consider that the MAX Dac isn't so cheap, and depending on what you want to do, this is maybe an overkill. Do you want to control 16 Synths at one time? Or just switch lights or something else by midi?
greetings, himi
[/url] |
|
Back to top
|
|
|
scriptstyle
Joined: Jan 22, 2008 Posts: 250 Location: nj
|
Posted: Mon Feb 03, 2014 1:24 pm Post subject:
|
|
|
Quote: | So do you want to receive and convert Midi at all Channels simultaneously? |
yes
Quote: | Because you are writing that you want to use a rotary switch, and I don't completely understand for what? |
you are right i think i was getting ahead of myself with the rotary, I was thinking of a ways around the dip to enable active channels...
Quote: | If you want to use them in parallel, the sketch wouldn't definitely not become too huge for the Atmega328, and if you want to use 16 DACs you can chain them in an i2c bus, so they will only need 2 digital pins, like before. |
this sounds good what needs to be changed in the sketch? And as for DACs i want to start with just two channels 1 and 2. and then add channels maybe thats when i started thinking about rotary encoders and what not haha. |
|
Back to top
|
|
|
gdavis
Joined: Feb 27, 2013 Posts: 359 Location: San Diego
Audio files: 1
|
Posted: Mon Feb 03, 2014 1:51 pm Post subject:
|
|
|
Another option might be a multichannel DAC. I'm using the ATMega328 (Arduino Nano) to drive an 8 channel serial DAC through the SPI interface. Two of these DACs would require 4 digital pins - shared data and clk plus one enable pin for each DAC. Or you can just get a 16 channel DAC. _________________ My synth build blog: http://gndsynth.blogspot.com/ |
|
Back to top
|
|
|
scriptstyle
Joined: Jan 22, 2008 Posts: 250 Location: nj
|
Posted: Mon Feb 03, 2014 3:25 pm Post subject:
|
|
|
I like the idea of using 2-8 channel serial DACs, but would this would tie up the serial spi correct? I have plans for 2X16 LCD or an OLED... |
|
Back to top
|
|
|
mosheen
Joined: Jun 19, 2013 Posts: 21 Location: NC
|
Posted: Mon Feb 03, 2014 4:00 pm Post subject:
|
|
|
Not really. You just have to have an available digital output on the arduino to select between each device. |
|
Back to top
|
|
|
scriptstyle
Joined: Jan 22, 2008 Posts: 250 Location: nj
|
Posted: Mon Feb 03, 2014 10:39 pm Post subject:
|
|
|
what do i need to change in the sketch to have all 16 channels? I am going to try and give it a good look tonight and see what i can come up with |
|
Back to top
|
|
|
mosheen
Joined: Jun 19, 2013 Posts: 21 Location: NC
|
Posted: Mon Feb 03, 2014 11:11 pm Post subject:
|
|
|
You'll have to see how it loops through all the values and add your extra channels into the loop. You'll have to toggle the different chip select pins for each write to each SPI device. |
|
Back to top
|
|
|
scriptstyle
Joined: Jan 22, 2008 Posts: 250 Location: nj
|
Posted: Tue Feb 04, 2014 12:20 am Post subject:
|
|
|
ok this makes sense I need to gather my thoughts and see if what i want to do is feasible. I looked at the sketch and now the DIP switch makes sense very clever, i might still build one like this but for what i am trying to work out it would make sense that it looks something like this :
CHANNEL1->CV1->DAC1
CHANNEL1->VEL1->DAC1
CHANNEL2->CV2->DAC1
CHANNEL2->VEL2->DAC1
I want this as a basic starting point. i have 4 MAX517s so I will try with these for now and see how it goes. Last edited by scriptstyle on Wed Feb 05, 2014 3:22 am; edited 1 time in total |
|
Back to top
|
|
|
xpmtl
Joined: Aug 10, 2007 Posts: 162 Location: Brussels, Belgium
|
Posted: Tue Feb 04, 2014 11:29 am Post subject:
|
|
|
Can you repost the files RAR?
Archive link is broken for some reason.
Thanks _________________ http://sdiy.xpmtl.net |
|
Back to top
|
|
|
himijendrix
Joined: Apr 16, 2012 Posts: 18 Location: Germany
|
Posted: Tue Feb 04, 2014 11:54 am Post subject:
|
|
|
@xpmtl
It should work now again.
@scriptstyle
Now I'm curios, 16 Synthesizers at one time? When you are finished I want to hear some samples |
|
Back to top
|
|
|
himijendrix
Joined: Apr 16, 2012 Posts: 18 Location: Germany
|
Posted: Sun Feb 16, 2014 4:23 am Post subject:
Optocuppler resistor bug |
|
|
I found a little bug ...
R25 (3,3k) which acts as a pullup resistor in the Midi input section, right after the optocuppler can be left out. Because the Atmega 328 already has an internal 10k pullup resistor, so this would be too much in some cases (for example if the current provided to the LED inside the optocuppler by the MIDI input signal is too low, the phototransistor wouldn't switch properly and couldn't ground the signal with a too small pullup resistor...)
You should also replace R24 (220 ohm) with a smaller resistor. 220 ohm is often used in the Midi input schematics, but in fact for a 4N28 it is too high.
In the datasheet you can see that the 4N28"s internal LED needs 1.3V@50mA which gives a series resistor of 74 Ohms, so 100 Ohm works fine.
P.S.
This problem was only notable when I used my Midi Thru expander box (1 Input, 5 Outputs). It uses a schmitt trigger to buffer and sharpen the signal, but unfortunately schmitt triggers have a rather low output current, which was not enough to drive the optocupplers LED. with the reistor change it works again. I will also try to add a second schmitt trigger ontop of the first one (Parallel) for increasing the maximum Output current.
... and another bug in the code, where the Trigger wouldn't go low after a short time. I fixed that and uploaded a new rar package.
PPS:
If you are looking for a really clever designed and simple Midi -> device you should have a look at this:
http://mutable-instruments.net/modules/cvpal
I built it and it works very well. The DAC is doesn't even need a trimmer. Everything is calibrated by software, and even the non linearity of the DAC+Trimmer (higher notes tend to be slightly out of tune) is corrected by its software. |
|
Back to top
|
|
|
YashN
Joined: Jun 27, 2011 Posts: 104 Location: Canada
|
Posted: Tue Feb 25, 2014 1:24 am Post subject:
|
|
|
I would recommend the latest MIDI v4.0 library and structure your code with callbacks. You could also use a high-resolution timer in the fast modes for listening to MIDI messages.
Well done! |
|
Back to top
|
|
|
himijendrix
Joined: Apr 16, 2012 Posts: 18 Location: Germany
|
Posted: Wed Jul 09, 2014 2:41 am Post subject:
|
|
|
I had some trouble with the optocoupler recently, where some midi keyboards didn't worke with the circuit.
The problem is not the LED resistor, it's rather the fact that an 4N28 (passive) is crap in midi applications.
You should use an 6N137 or 6N138 which is an active coupler and requires a Vcc Connection.
Here they discuss the same problem: http://mutable-instruments.net/forum/discussion/5276/midi-input-with-optocouplers/p1 |
|
Back to top
|
|
|
capicoso
Joined: Nov 19, 2012 Posts: 128 Location: Argentina
|
|
Back to top
|
|
|
himijendrix
Joined: Apr 16, 2012 Posts: 18 Location: Germany
|
Posted: Fri Jul 11, 2014 6:09 am Post subject:
|
|
|
Hi capicoso, I also did this (You should change R4 to some higher value like 10k when using a stanalone microcontroler, because in this example pin 0 of the AVR on the arduino board is also connected to the USB Serial chip, that's why R4 has to be so low in this case)
The problem is that with a very cheap Midi Keyboard (Kawai Datacat) it still receives faulty Midi signals.
I tried to switch it to an 6n138, but it still fails (It's also too slow I think).
My better Midi Keyboard (Aturia) works. I think it provides a more stable Midi signal.
The best solution seems to be the 6n137.
I have an Shruti_1 Synthesizer, which uses this one together with an AVR and it all works fine. |
|
Back to top
|
|
|
capicoso
Joined: Nov 19, 2012 Posts: 128 Location: Argentina
|
Posted: Fri Jul 11, 2014 1:20 pm Post subject:
|
|
|
Weird, i thought the 6n138 was the "best" opto for this...
My modular has a mcv628 from bareille, it uses 6n136, and it worked with everything, until I bought a casio cz5000, with that one it doesn't work. On the other hand, my arduino sequencer has midi in for transpose, with 4n28 and it works with everything i have, luck i guess heh |
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24081 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Fri Jul 11, 2014 3:19 pm Post subject:
|
|
|
It is also possible to damage optos with heat .. best to set the iron hot and do it quickly .. or socket 'm . _________________ Jan
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
Dodecasonico
Joined: Jul 12, 2015 Posts: 4 Location: México
|
Posted: Sat Apr 30, 2016 9:42 am Post subject:
|
|
|
Can I put this on a +\- 15 PSU??? Is there any modification?? |
|
Back to top
|
|
|
himijendrix
Joined: Apr 16, 2012 Posts: 18 Location: Germany
|
Posted: Mon May 09, 2016 2:17 pm Post subject:
|
|
|
+-15V should work fine (LF444 is rated at +-22V).
But you will get +15V as a gate out.
----
I wouldn't recommend this project, since the DAC are only 8-bit and the opamps' non-linearity is also a problem. Furthermore the MAX517 are so expensive now. With 8-bit resolution it could also be done with the Atmega328 and PWM+Low Pass Filter.
For a better Pitchbend (which is 14-bit) to CV convertion to MCP4922 (12-bit and cheaper) could be used. Together with a 5V reference and a opamp voltage doubler.
Four Channels could be Note (+ Pitchbend) , Velocity, Modulation Wheel, CC |
|
Back to top
|
|
|
|