Author Topic: problem with MIDI pop/clicks  (Read 4551 times)

Dimitree

problem with MIDI pop/clicks
« on: October 18, 2012, 10:23:16 AM »
hello
I've build a small 4x loop midi switcher: a simple PIC controller that receives midi signal and control 4 relays connected to jacks.
The problem is this: when I send midi messages, I can clearly hear on the audio signal path (in every loops, and even in bypass Input to Output directly) clicks/pops. For example, if I send to my switcher a CC midi message starting from 0 to 127, I hear a tremolo-like hum..if I send a PC midi message, I just hear a single/short hum.

I noticed that the problem is the distance between the optocoupler and the audio jacks/relays, and in some part the 2 wires from the midi jack to the optocoupler. But I can't move any further that now, due to the box dimensions.
Is there any way to solve this problem? should I shield the optocoupler board in some way? or use shielded cable for the digital wires?

SISKO

Re: problem with MIDI pop/clicks
« Reply #1 on: October 18, 2012, 01:12:33 PM »
Does the analog (audio) and digital (Pic, relay, etc) share the same grounds? If so, isolate them
--Is there any body out there??--

Dimitree

Re: problem with MIDI pop/clicks
« Reply #2 on: October 18, 2012, 01:47:52 PM »
yes it's the same..
How should I isolate it? I should tie ground to the chassis twice? once for the audio ground and once for the digital one?

Processaurus

Re: problem with MIDI pop/clicks
« Reply #3 on: October 18, 2012, 10:47:04 PM »
How are you powering the device? Do you have pedals or anything sharing the same power?  I've had some digital pedals that caused noise just by sharing the same 9v daisy chain, with no audio cables plugged in.

Regardless, you can star ground the digital, analog, and chassis grounds back where the power supply comes in for starters, if you haven't already. 

Or, isolate the grounds completely?  Since you aren't processing the audio, just switching it, you could easily keep the grounds totally separate. You can make the chassis part of the audio ground (like it is a big bulge in the cable shield), and tie the digital ground alone back to the power supply (-).

If that doesn't help and you think the interference is electrostatic (the audio wires being near noisy digital signals) rather than grounding, you can make little grounded tin hoods to shield the analog sections from the digital sections.  Also shielded cable for the audio could help as well if you have runs longer than a couple inches. 

defaced

Re: problem with MIDI pop/clicks
« Reply #4 on: October 18, 2012, 10:54:57 PM »
yes it's the same..
How should I isolate it? I should tie ground to the chassis twice? once for the audio ground and once for the digital one?
I highly recommend reading the first chapter in Tim William's book The Circuit Designer's Companion.  Between Google Books and the Amazon preview, you can read pretty much the whole chapter for free. 
-Mike

Dimitree

Re: problem with MIDI pop/clicks
« Reply #5 on: October 19, 2012, 06:39:53 AM »
I'm powering the device with 9V adapter.
So the device is getting 9V from the DC jack, from here, the ground goes to the center pin of a 7805 regulator. The 7805 metal tab is connected to the chassis with a screw. To this point comes the audio grounds too: relays ground (input bypass configuration) and jack grounds (in-out-send, return is not grounded). I should add that "send" jacks are not isolated from the chassis, so their grounds are connected to the 7805 too.
Also, the midi jack is not connected with a wire to ground, sinche the jack itself is connected with screws to the chassis and so to the 7805 too.

I noticed that if I put the digital pcb far from the jacks, the "clicks" attenuate and then disappear, but in order to move the pcb that far I need to let the enclosure open, I can't put the pcb that distant when the enclosure is closed
« Last Edit: October 19, 2012, 06:41:57 AM by Dimitree »

Dimitree

Re: problem with MIDI pop/clicks
« Reply #6 on: October 19, 2012, 10:03:06 AM »
ok I rewired this way:
return jacks ground + relays ground + input & output ground goes to DC jack ground.
digital pcb ground (and midi optocoupler ground) goes to 7805 center pin, and then to DC jack ground.

only things attached to the chassis are now:
- "send" jacks, that "take" ground from the bus descripted above
- midi jack, but this ground is not connected at anything except the chassis (and so to the bus above)

the problem still persists.
so I guess it's a electrostatic interference? or should I isolate the midi jack too?

Dimitree

Re: problem with MIDI pop/clicks
« Reply #7 on: October 19, 2012, 10:14:26 AM »
update:
I isolated the midi jack, no differences.

I noticed this:
- if I unplug the optocoupler from the socket (but keep the PIC), the clicks disappeare almost completely (only audible if you put volume really really high)
- if I unplug the PIC but keep the optocoupler, the problem persists, so it's not because of the PIC

SISKO

Re: problem with MIDI pop/clicks
« Reply #8 on: October 19, 2012, 11:25:15 AM »
To see whats causing the problem, isolate (just for now) your audio path from you digital path. Use a diferent power supply for the midi device and for the audio effects etc.  Unscrew the regulator from the chassis (install a heatsink if necessary), use the chassis ONLY as analog ground. Keep separated the analog ground from the digital ground, the dont need to be the same.

All this is just to see it the problem is caused by ground loop problem or if is it an interference
--Is there any body out there??--

Dimitree

Re: problem with MIDI pop/clicks
« Reply #9 on: October 19, 2012, 01:10:05 PM »
thanks, but as I said in the update post, I isolated the 2 paths (removed the regulator from the chassis, chassis only as analog ground, and so on)..but it didn't help.
Since moving the midi cable with hands help reduces clicks, I'm pretty sure it's an interference problem.
now my question is: how can I shield the midi signal? I can't shield the audio path since the cable between the jack are too shorts and it would be too hard to place a shielded cable everywhere.
Can I use shielded cable for the midi signal? how the shield should be connected?

Processaurus

Re: problem with MIDI pop/clicks
« Reply #10 on: October 22, 2012, 05:50:57 AM »
thanks, but as I said in the update post, I isolated the 2 paths (removed the regulator from the chassis, chassis only as analog ground, and so on)..but it didn't help.
Since moving the midi cable with hands help reduces clicks, I'm pretty sure it's an interference problem.
now my question is: how can I shield the midi signal? I can't shield the audio path since the cable between the jack are too shorts and it would be too hard to place a shielded cable everywhere.
Can I use shielded cable for the midi signal? how the shield should be connected?

It's significant that physically moving the circuit parts reduces the interference, now all you have to do is figure out how to shield the digital stuff from the audio.  You can use 3 conductor coaxial cable (microphone cable) for the midi jack to the board, after all, that is what is used for midi cables.  Connect the shield only on the circuit end.

I would recommend using tin to make a little enclosure/hood for the digital section.  You can use a tin can (make sure it's really tin, not aluminum, so you can solder to it), and cut it up with tin snips, and you can solder a ground to it.  You can cover it in tape or something to insulate it from shorting things out if necessary.  You can test out its effectiveness just by grounding a piece of the tin with a cliplead or something and place it temporarily  around the circuit to see where it works best.

PS in the MIDI spec it shows a properly designed device never connects the ground from the MIDI input to the device.  It is left floating, and only connected on the sending unit end, as a shield.  This is to avoid ground loop hell.

Dimitree

Re: problem with MIDI pop/clicks
« Reply #11 on: October 23, 2012, 09:13:24 AM »
thanks for the help, I used shielded cable on both midi lines and audio path (where possible), it did reduce the clicks, but not completely, but now it's acceptable.
another problem that seems to have now is that when I plug the 9V adapter, a small hiss comes in. If I remove the 9V adapter it disappear (since the looper can be used without power, in bypass mode)

MoltenVoltage

Re: problem with MIDI pop/clicks
« Reply #12 on: October 25, 2012, 02:29:34 AM »
Try reducing the current to the optocoupler.

Also put the right filter caps by the V/R and PIC.

Take a look at the schematic on our 9 Switches Chip datasheet (page 6) for tips on interfacing micrcontrollers with MIDI.
http://www.pedalsync.com/
« Last Edit: October 25, 2012, 02:31:22 AM by MoltenVoltage »
MoltenVoltage.com for PedalSync audio control chips - make programmable and MIDI-controlled analog pedals!

ElectricDruid

Re: problem with MIDI pop/clicks
« Reply #13 on: December 16, 2012, 03:01:30 PM »
yes it's the same..
How should I isolate it? I should tie ground to the chassis twice? once for the audio ground and once for the digital one?

If you've got relays, why have the two grounds connected at all? Isn't that the point of relays?

Use one ground for the In/Out jacks, connected to just the jacks and nothing else. There shouldn't be any need for power to the jacks.

Use the actual power ground for the MIDI circuit and the relay coils. Also check that your MIDI leads/sockets are actually correct. MIDI leads shouldn't have all pins connected, and neither should MIDI sockets.

HTH,
Tom

MoltenVoltage

Re: problem with MIDI pop/clicks
« Reply #14 on: December 18, 2012, 01:49:22 PM »
Also check that your MIDI leads/sockets are actually correct. MIDI leads shouldn't have all pins connected, and neither should MIDI sockets.

Pin 2 (center) on the MIDI In jack should never be connected.  It is only connected to ground on the MIDI Out.

MoltenVoltage.com for PedalSync audio control chips - make programmable and MIDI-controlled analog pedals!