Go Down

Topic: glitchy MIDI controller (Read 2381 times) previous topic - next topic

boguz

Oct 08, 2014, 12:30 pm Last Edit: Nov 01, 2014, 12:36 pm by boguz
Hi
About a year ago i have build and arduino MIDI Controller:
http://forum.arduino.cc/index.php?topic=180338.0

Back then i didn't have much time to test it, but i thought it was working ok. I have now started using it, and i see that there is something not quite right.

The first problem i had was with the baud rate. I had it set to 31250 (is this always the best BR for MIDI devices?), but when I tried using the Spikenzielabs Serial to MIDI Converter I always got this error:


I didn't know what was wrong, so I tried changing the baud rate (to 115200) and I stopped getting any errors (but still I noticed that the "RX" light always blink red and then green on any button press).
When I run a MIDI Monitor I get something like this:

Things seem to be ok, apart from the TIME column, which is always "*** ZERO ***". What is going on? How can I fix that?

I then noticed that something was going on when I tried to use it with a DAW. I manage to map the buttons and pots without problems, but then when I use the buttons something strange happens.
I'll try to explain it with an example:
I click a button to start recording. Then sometime out of nowhere the recording stops on its own (instead of stopping on another button push).
This doesn't always happen, doesn't happen always on the same place or even on the same button.
I have tried the same midi mapping with another midi controller (a Korg nano controller) and things worked without problems, so I think the problem isn't on the mapping or on the DAW side, but rather on my Arduino controller...

Any ideas of what is going on? How could I fix it?

It would be great to be able to get this working to have some fun making some music!

Thanks!
=)

boguz


Grumpy_Mike


no ideas?   :(

Not without you posting your code and schematic.

boguz

#3
Nov 01, 2014, 12:45 pm Last Edit: Nov 01, 2014, 12:46 pm by boguz
Oh, you're right! The code and schematics were posted on the original post, but of course i should have posted them here too.
Here they are...

Schematic


and the code is attached to this comment.


Thanks!
=)

wabbitguy

#4
Nov 01, 2014, 06:35 pm Last Edit: Nov 01, 2014, 06:37 pm by wabbitguy
Maybe it's just me but for something to be labeled as a "MIDI" foot controller, I'd expect to see a MIDI IN/OUT port in the schematic. I don't see one in your schematic.

So you're either generating MIDI and sending that binary out the USB port, to Processing, which in turn reads the Arduino serial port and sends the received data off to some virtual MIDI port so yet another application, like Live, can receive it.

Or you have converted the UNO into a USB-HID device (MIDI interface), but if that was done, I don't see what the use for Processing or a Serial to MIDI converter would serve.

If you're just sending binary MIDI to some other software, baud rate on the Arduino can be anything you want (faster than 31.5K). It's not MIDI per se, it's just binary data.

For the "zero" time stamps, time stamping is optional for MIDI, the device driver is supposed to "time stamp" when it sends a message.

void send(MidiMessage message, long timeStamp) would be a way to send a message with a timestamp where the timeStamp argument is expressed in microseconds, according to the receiving device's notion of time. Don't know if the MIDI library supports time stamping.

Keep in mind that time stamping isn't used much of the time by the receivers, hence why it's an option.

Why not add a MIDI port to your project (it's like $4 worth of parts)? Thats's what I build for all my MIDI projects. From that point, any software via a standard MIDI interface or external hardware can be controlled. No extra software required and keeps everything simple.

Grumpy_Mike

You can not use the normal MIDI baud rate from processing it is not a standard value, the whole point is that the processing application converts the serial data stream to the internal MIDI bus of the computer.

A much better converter in that respect is an application called hairless. That might also give you time stamps as well, but as has been said is not used much.

The random button activations might very well be being caused by your lack of any decoupling capacitors in your circuit.

boguz

i am sending the data as serial information.
At the time i didn't use a MIDI OUT because i didn't have a MIDI IN on my computer, and i thought i would use this to some kind of "live performance" (where i am already using my laptop), so i thought USB would be ok.

I have read that one can change the firmware on the Arduino so it behaves as a native USB-MIDI controller. That would be great, but at the time there was some reason (i don't remember it so well, it was more than a year ago) for me not doing it. Maybe i thought it was too complicated for me, needed to buy some more parts,...

Like i said up there on the post, I am then using the SpikenzieLabs Serial to MIDI converter, and if it would work, using a converter wouldn't be a problem for me.
I have also tried the Hairless converter. I got a little bit different results, but the end result was much the same.

Ah, decoupling capacitors! They are used to "isolate" different parts of the same circuit, for things like noise? is this right?
Hmmm, i guess that could be it.
But wouldn't i then also get some "random unexpected" messages on the MIDI Monitor?

I think very often that the problem is on the "mapping" side of things. But I have tried the same mapping with another controller (an APC40) and i got good (expected) results.
I thought there might be some kind of "incompatibility" because I have several other MIDI controllers plugged in, so when i get home i will try to change the FootController's MIDI channel. Maybe to channel 16 or something. I'll check what the others are using...

Oh, it's such a shame this project isn't working properly. It was great fun to learn some electronics and Arduino, to build it, and it actually looks nice, so i would really love to use it on stage!   ;)


Grumpy_Mike

Well the random messages you are getting through not having any decoupling are the glitches you are seeing.

boguz

The "glitches" i am having are happening inside Ableton. On the Midi Monitor i don't see anything out of the ordinary.

And, by the way, i have updated to the new Yosemite, and installed the latest Processing and Midi Monitor versions. I now see also the time on Midi Monitor!
=)

I have changed the channel to channel 16. It seems better, but i still had a couple of times when stuff happened without me pressing anything. This is strange...   :S

wabbitguy

In Live's Preferences, do you have any MIDI output enabled to the IAC port you're using? Generally when using a MIDI controller it's a one way street. The controller strictly sends data and nothing should be sent back to it.

I tried the USB-HID and Hairless MIDI. Zero luck with the HID end of things but not a big deal any way. Although Hairless MIDI worked, I eventually wrote my own that also did mapping and filtering (I use it with an FCB1010).

In the end, I added a MIDI port to the UNO, Leonardo or whatever. Didn't use SoftwareSerial, just had the Arduino turn the MIDI port on and off so I can upload sketches to it and used the standard TX for the MIDI interface (MIDI library works better that way). So control of external MIDI devices is more versatile, and for the computer end, a simple MIDI interface is all that's needed. Unless you're doing SYSEX in which case you need a little better interface because they aren't all rated for SYSEX.

One of most useful MIDI projects I built was an inline MIDI "sniffer". It displays the MIDI commands (including SYSEX) as they pass through. That's saved me hours of troubleshooting. Sort of a Midi Monitor but using an Arduino (and TFT display).

boguz

I am now thinking that the problem was on the software side.
I haven't been a lot at home to try it (work!), but the last couple of times things worked without any problem.
I have for a couple of weeks updated my os to the newest OSX, the Yosemite.
I also downloaded and installed all the new versions of Processing, Arduino IDE and Midi Monitor.
The Ableton Live is still the same.
Maybe there was some "junk" in my system preventing it from working ok.
I will try to make a little video to show you how am i using it!
;)


Hey wabbitguy, the midi monitor idea sounds nice!   ;)

Thank you guys for your input and help!

Go Up