electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » Arduino
mini MIDI to CV converter with Gate and Trigger outputs
Post new topic   Reply to topic
Page 2 of 3 [55 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Goto page: Previous 1, 2, 3 Next
Author Message
wallybob



Joined: Sep 26, 2015
Posts: 7
Location: Iowa

PostPosted: Wed Jan 20, 2021 12:55 pm    Post subject: Reply with quote  Mark this post and the followings unread

I have scoured the internet from head to toe and there is nothing out there that deals with Arduino Pro Micro being a USB host, which is what would be needed to interface with a USB MIDI keyboard. The lack of info is really quite astounding - I would have bet that there would have been more. Maybe I'll try using a raspberry pi instead.
Back to top
View user's profile Send private message
PHOBoS



Joined: Jan 14, 2010
Posts: 5591
Location: Moon Base
Audio files: 705

PostPosted: Wed Jan 20, 2021 6:52 pm    Post subject: Reply with quote  Mark this post and the followings unread

https://www.musiconerd.com/single-post/arduino-pro-micro-as-a-usb-midi-device

edit: I use the pro micro to control a launchpad through midi BUT so far I did have to route it through my PC with pocketmidi as I did not
have the right cable to connect it directly (also easier with coding of course). I did order a USB coupler to connect 2 USB cables together
but the first time it didn't arrive, the second one turned out only to work for USB 3 and now I got one that converts USB A to USB B so that
should plug in straight to my launchpad but I have not tested that yet. So I have been curious if it works, I think It should, but hadn't been
able to test it yet. Might give it a try tomorrow.

oh and yesterday the first one I ordered did actually arrive afterall after I don't know how many months but it's also a USB 3 thingy.


edit 2 (regarding connecting the launchpad): USB3 couplers would probably work too (I think they should be compatible with USB2) but I just
realized that the USB port on the pro micro has a diode in series so it can not provide power only receive it, so now I know why my launchpad
didn't light up at all. However after reading up a bit more about USB hosts and devices I am pretty sure it won't work anyway so I do need to
look for another option. I only opted for the pro micro because of the USB port but I guess I won't need that anymore so I could use something
else.

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube

Last edited by PHOBoS on Thu Jan 21, 2021 5:23 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
PHOBoS



Joined: Jan 14, 2010
Posts: 5591
Location: Moon Base
Audio files: 705

PostPosted: Wed Jan 20, 2021 8:53 pm    Post subject: Reply with quote  Mark this post and the followings unread

apparently there is this for the nano https://www.gravitech.us/usadforarna.html
and a library for the DUE but that seems a bit overkill https://www.arduino.cc/en/Reference/USBHost

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
PHOBoS



Joined: Jan 14, 2010
Posts: 5591
Location: Moon Base
Audio files: 705

PostPosted: Thu Jan 21, 2021 2:25 pm    Post subject: Reply with quote  Mark this post and the followings unread

looked around a bit more and there are some USB host shields available on ebay for around $5,- to $10,-. *
Not sure if they can work with a nano or pro micro but I did found a video of it working with a pro mini.
https://www.youtube.com/watch?v=t8MZhL0RjFc

and here's an instructable using one for an Arduino USB to Legacy MIDI Converter
https://www.instructables.com/Arduino-USB-to-Legacy-MIDI-Converter/



* edit: cheaper on aliexpress

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
PHOBoS



Joined: Jan 14, 2010
Posts: 5591
Location: Moon Base
Audio files: 705

PostPosted: Thu Jan 21, 2021 7:30 pm    Post subject: Reply with quote  Mark this post and the followings unread

I've done a bit more research and compared the pro mini, pro micro and nano.

The pro mini is pin compatible with the host shield and they can simply be stacked on top of eachother. Downsides are that the pro mini
doesn't have a USB interface for programming so does require a seperate FTDI adapter and to be pin compatible with the USB host shield you
will need the 3.3V version which runs only at 8MHz instead of 16MHz for the 5V version. Although it is 3.3V it can be powered with 5V which
is also needed for the USB port on the host shield.

The nano is build around the same ATmega328 as the pro mini and all the pins that seem to be needed for the USB host shield are also
available on the nano. It is not pin compatible so does require some wiring and will take up a bit more space that way. It does however have
a USB port for easy programming and runs at 16MHz powered by 5V (a higher voltage could be used aswell). It also has a 3.3V output which
can be used to power the host shield.

The pro micro is build around the ATmega32u4. There is a 3.3V version available but just as the pro mini it will run only at 8MHz. One of
the pins that is needed for the host shield is not directly available but is connected to the RXLED so might still be usable with some modding.
It does however use one pin for two of the pins needed on the host shield. It might be possible to change this in the USB host library but I think
that overall the pro micro is just not really useful for it.


The library mentioned in the instructable is made for a MAX3421E-based USB Host Shield. I zoomed in on a photo of one of the cheap ones
available on ebay and that one does use the same chip, so I expect that the library will work fine with it.

I'll look around a bit more and order one of those USB host shields and a pro mini and try if I can get it working with the nano.

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
PHOBoS



Joined: Jan 14, 2010
Posts: 5591
Location: Moon Base
Audio files: 705

PostPosted: Tue Jan 26, 2021 12:40 pm    Post subject: Reply with quote  Mark this post and the followings unread

here's a nice coincidence.

I recently aquired a video mixer which has a serial RS232 input. That immediately got me thinking that it should be possible to
use an arduino to add remote control by midi or something else. There isn't a lot of info on the serial connection in the manual so
I started looking online for some more info and found just the right thing. Someone had the same idea as me to use an arduino to
control it with midi and also found out you can't use the USB port on the pro micro as a USB host. They did use a MAX3421E based
USB shield with the pro micro so now I know that one should work aswell.

for more info check: https://scanlines.xyz/t/a-circuit-for-midi-control-of-panasonic-video-mixers/81

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Grumble



Joined: Nov 23, 2015
Posts: 1294
Location: Netherlands
Audio files: 30

PostPosted: Thu Jan 28, 2021 1:23 am    Post subject: Reply with quote  Mark this post and the followings unread

Also the MEGA2560 can be used as a plug and play midi controller, just like the UNO R3 (as long as they have a mega16u2 or mega8u2 on board)

quote:
Quote:
The HIDUINO project provides firmwares, documentation, and example code for building a class-compliant USB-MIDI device from an Arduino UNO or Mega 2560. HIDUINO does not use middleware software to convert serial messages through a MIDI loopback port (like LoopBe1 on Windows or IAC on OSX). Instead, HIDUINO provides a true USB-MIDI device for plug-and-play compatibility on Windows, OSX, and Linux - just like a commercial MIDI controller.

HIDUINO takes advantage of Arduino boards where a second AVR chip is used as the USB controller, so it won't work with single chip variants (e.g. Leonardo), nor older boards that use an FTDI chip as USB controller (e.g. Duemilanove). Many cheap Arduino knockoffs that pretend to be an Uno or Mega also might not work, since they tend to use the (slighly) cheaper FTDI chips.

HIDUINO is based on the LUFA framework by Dean Camera. HIDUINO was previously developed for robotic instruments and new musical interfaces @ the California Institute of the Arts.

The project name refers to a time when it was intended to contain many different USB-HID device types (joystick, mouse, keyboard, etc). The name "mididuino" is in use by an existing project, though it would be a more fitting title for this project.


Just use an external programmer to reprogram the atmega16u2 or atmega8u2 with the file arduino_midi.hex as attached to this post.
from: https://github.com/ddiakopoulos/hiduino


MEGA2560.jpg
 Description:
 Filesize:  90.43 KB
 Viewed:  326 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

MEGA2560.jpg



arduino_midi.hex
 Description:

Download
 Filename:  arduino_midi.hex
 Filesize:  10.14 KB
 Downloaded:  395 Time(s)


_________________
my synth
Back to top
View user's profile Send private message Visit poster's website
PHOBoS



Joined: Jan 14, 2010
Posts: 5591
Location: Moon Base
Audio files: 705

PostPosted: Thu Jan 28, 2021 8:24 am    Post subject: Reply with quote  Mark this post and the followings unread

but does it work as a USB host ? because I don't see that mentioned.
_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Grumble



Joined: Nov 23, 2015
Posts: 1294
Location: Netherlands
Audio files: 30

PostPosted: Thu Jan 28, 2021 11:09 am    Post subject: Reply with quote  Mark this post and the followings unread

Aahh ...no...it’s just a native midi controller head banging monitor but...full duplex Rolling Eyes

Edit: the mega2560 has 4 (four!) uarts so its possible to use it the way shown previous in this thread plus you can use a daw to generate cv-es if you program the atmega16u2 with the hiduino programm

_________________
my synth
Back to top
View user's profile Send private message Visit poster's website
wallybob



Joined: Sep 26, 2015
Posts: 7
Location: Iowa

PostPosted: Fri Jan 29, 2021 7:57 am    Post subject: Reply with quote  Mark this post and the followings unread

Thank you for posting the info and link related to USB host PHOBoS - this has cleared up a lot of my confusion!
Back to top
View user's profile Send private message
wahee



Joined: Jan 27, 2019
Posts: 6
Location: Belfast

PostPosted: Mon Feb 08, 2021 2:59 pm    Post subject: Reply with quote  Mark this post and the followings unread

really nice project. I built it for my Roland SH-09. it
works a treat with a keyboard on single notes. I have an issues when I use it with a sequencer.

When a MIDI sequence is playing into the converter and notes are moved on the timeline or anything overdubbed, the gate signal seems to stop triggering the SH-09. Lights on the arduino still show. The only way to get the gate to trigger the notes is to reset the device/arduino

I tried it on my Teisco 60f and Pro1 with the same results

I tried DAW's like Cubase and Reaper with the same results. With 2 different MIDI interfaces.

Jut wondering if there is anything I can do to solve this as it's otherwise brilliant for me.
Back to top
View user's profile Send private message
PHOBoS



Joined: Jan 14, 2010
Posts: 5591
Location: Moon Base
Audio files: 705

PostPosted: Mon Feb 08, 2021 4:18 pm    Post subject: Reply with quote  Mark this post and the followings unread

Great to hear you got some use out of it Very Happy

Do you know if the gate out stays high ?
My suspicion is that the note counter gets messed up (value of notes_on in the code), maybe because it misses a NoteOff command.
The trigger output should still work I think but I'd have to look at the code again.

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
wahee



Joined: Jan 27, 2019
Posts: 6
Location: Belfast

PostPosted: Mon Feb 08, 2021 4:34 pm    Post subject: Reply with quote  Mark this post and the followings unread

thanks for the reply. No the gate output drops low.
The CV pitch still works as I can hold a note on the midi synth and still hear it sort of playing, but no new gates seem to be issued. If I reset it's good to go again until the next move of a note on the DAW
Back to top
View user's profile Send private message
PHOBoS



Joined: Jan 14, 2010
Posts: 5591
Location: Moon Base
Audio files: 705

PostPosted: Mon Feb 08, 2021 7:55 pm    Post subject: Reply with quote  Mark this post and the followings unread

ok, not sure what's happening yet but could you try if this version changes anything ? (didn't test it myself).


edit: replaced the file with the 'official' release.


MINI_MIDI_TO_CV_V1_2.ino
 Description:
negative overflow for note counter fix

Download
 Filename:  MINI_MIDI_TO_CV_V1_2.ino
 Filesize:  49.94 KB
 Downloaded:  231 Time(s)


_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube

Last edited by PHOBoS on Tue Feb 09, 2021 10:35 am; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
wahee



Joined: Jan 27, 2019
Posts: 6
Location: Belfast

PostPosted: Tue Feb 09, 2021 6:23 am    Post subject: Reply with quote  Mark this post and the followings unread

yes it has totally fixed this issue with the gate. Now I can move notes around at will with no dropouts. Looks like the note off thing was the issue. Thanks so much
Back to top
View user's profile Send private message
PHOBoS



Joined: Jan 14, 2010
Posts: 5591
Location: Moon Base
Audio files: 705

PostPosted: Tue Feb 09, 2021 10:33 am    Post subject: Reply with quote  Mark this post and the followings unread

excellent! cheers

I just limited the note counter so it can't go lower than 0. In theory this shouldn't happen as it counts up when there is a NoteOn command
and down when there is a NoteOff command and there shouldn't be more NoteOff commands than NoteOn commands. However if it does
happen for some reason the counter would roll over to 255. With this fix it just stays at 0. It can still happen the other way around but that
would require more than 255 NoteOn commands without a single NoteOff command and there aren't even enough notes for that.

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
wahee



Joined: Jan 27, 2019
Posts: 6
Location: Belfast

PostPosted: Tue Feb 09, 2021 11:39 am    Post subject: Reply with quote  Mark this post and the followings unread

ah yes I see where you did that. It maybe was the sequencer sending data out as I was moving a large volume of notes, effectively playing them as I moved the sequence. The gate is really solid now Very Happy
Back to top
View user's profile Send private message
GlassHausen



Joined: Nov 06, 2019
Posts: 6
Location: Portland, Oregon, USA

PostPosted: Wed Feb 24, 2021 1:01 pm    Post subject:  Cool project! Reply with quote  Mark this post and the followings unread

Wow, this is really great! Thanks for sharing your knowledge and ideas everyone, especially you, PHOBoS!
Back to top
View user's profile Send private message
PHOBoS



Joined: Jan 14, 2010
Posts: 5591
Location: Moon Base
Audio files: 705

PostPosted: Wed Feb 24, 2021 3:45 pm    Post subject: Reply with quote  Mark this post and the followings unread

my pleasure Very Happy
_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
injektilo001



Joined: Aug 21, 2020
Posts: 10
Location: Chile

PostPosted: Sun May 23, 2021 9:40 pm    Post subject: help with courious issue. Reply with quote  Mark this post and the followings unread

Hi, I hang from this thread because its about a Midi to CV converter that uses the DAC mcp4725 and arduino.

I will describe some observations that hopefully will narrow the options.

So, pitch CV coming from the DAC doesn't change voltage unless I get my finger close almost touching it or much more when I cover the small PCB that has the DAC with my hand. I takes 2 second and it starts working and It keeps working until a remove my body part, and after 2 to 8 seconds it stops. I though that it was heat, but i tried getting my solder iron very close, and nothing happened. Maybe the moisture off my hand triggering something?? I swear i don't touch it, several tries already.

Gate out and everything coming directly from arduino works good, maybe a little dark clic that you can hear when the gate is engaged, but i doesn't bother.

I have two mcp4725 boards, and this problem happens with both. This one

https://es.aliexpress.com/item/33004120130.html?spm=a2g0s.9042311.0.0.274263c0cMC4Oi

Well, this is what I know, I already searched the web with no luck.

Any help and ideas are welcome, thanks in advance

JEAN PAUL
Back to top
View user's profile Send private message
PHOBoS



Joined: Jan 14, 2010
Posts: 5591
Location: Moon Base
Audio files: 705

PostPosted: Mon May 24, 2021 4:15 am    Post subject: Reply with quote  Mark this post and the followings unread

What you are describing sounds very similar to what can happen if there is an unconnected input. It's odd that it still works though.
The first thing to do is carefully check all the connections to make sure nothing has a bad connection.

It could have to do with the address setting on the DAC. I don't remember setting it myself but you can try if that helps.
There are 3 solder pads on the DAC that are labeled GND, ADDR, VCC. connect the middle one (ADDR) to the one labeled GND with some solder
so that it looks like this:
Posted Image, might have been reduced in size. Click Image to view fullscreen.

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
injektilo001



Joined: Aug 21, 2020
Posts: 10
Location: Chile

PostPosted: Mon May 24, 2021 10:52 am    Post subject: Reply with quote  Mark this post and the followings unread

Hello!! Well, with your help the issue is fixed! Instead of soldering the ADDR pad to ground as you said, i did it to Vcc, because of the address thing and now it works in perfect tune. It's funny how my body proximity made the necessary "contact" between the pads to make it work.
Thanks Phobos for your time to answer and more thanks because now it works!
Cheers from Chile!
Back to top
View user's profile Send private message
PHOBoS



Joined: Jan 14, 2010
Posts: 5591
Location: Moon Base
Audio files: 705

PostPosted: Mon May 24, 2021 12:20 pm    Post subject: Reply with quote  Mark this post and the followings unread

that's great to hear, glad it was helpful Very Happy

I did have a look at a spare DAC I have but that one does not have the address set.
So I am a curious if I actually did that with the other one or just got lucky.
Not curious enough to open up the midi keyboard though.

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Mickeyluv



Joined: Jan 18, 2022
Posts: 6
Location: UK

PostPosted: Wed Jan 19, 2022 11:12 am    Post subject: Reply with quote  Mark this post and the followings unread

I've just ordered the parts to build this, but it just dawned on my that I may have made a mistake in thinking that I could use this with my guitar to MIDI converter to be able to then convert that output to CV/gate.

It would appear that whilst the octave range would encompass an electric guitar of around 4 octaves, the actual positioning within the range of the MID to CV converter would mean I'd lose a lot of the higher notes. Is there any way to fix this?

Thanks,
Mick

EDIT; Is this as straightforward as setting the octave switches to 011, corresponding to octaves 2 to 6?
Back to top
View user's profile Send private message
PHOBoS



Joined: Jan 14, 2010
Posts: 5591
Location: Moon Base
Audio files: 705

PostPosted: Wed Jan 19, 2022 5:26 pm    Post subject: Reply with quote  Mark this post and the followings unread

welcome party!

They way it works (if I recall correctly) is that the CV output is always somewhere between 0..5V so 5 octaves max.
Those octaves are assigned to an input range (midi notes) which can be selected with the octave switches.
So it selects 5 octaves from the max of 10 (+ some notes) input octaves and converts those to a CV.

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic
Page 2 of 3 [55 Posts]
View unread posts
View new posts in the last week
Goto page: Previous 1, 2, 3 Next
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Arduino
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use