x42 / jack_midi_clock

JACK MIDI Clock - Utility to send MIDI Beat Clock pulses that follow the JACK Transport
http://www.teuton.org/~gabriel/jack_midi_clock/
GNU General Public License v2.0
40 stars 4 forks source link

MIDI Output BPM jumps around the actual BPM #2

Open ViktorNova opened 8 years ago

ViktorNova commented 8 years ago

I'm having a problem where jack_midi_clock doesn't send the BPM that JACK is set to, but rather jumps around the BPM and constantly changes to a tempo above or below JACK's tempo.

E.G. JACK is set to 120 bpm, but the tempo received by all of my connected MIDI devices fluctuates between 118, 122, 116, 124, etc., they receive a new tempo about twice per second that is one of these values

This has actually been happening for me for years, but my synths have always been able to compensate ok and it hasn't been a problem until now, I am interfacing with a new piece of outboard gear (Eventide Timefactor delay pedal) that reacts badly when the bpm is constantly changed, causing constant momentary drops in the audio output so I am just now reporting this as an issue. It's happened on multiple OSs on multiple machines, so I don't think it's me..

Are you aware of this or anything that would cause it? I am using a stock kernel (not tuned for low latency audio), could this be the culprit? Thank you!!! This is driving me crazy.

x42 commented 8 years ago

You're seeing this only when leaving the system and using actual hardware, right? If so, the best guess: the midi-device that you're using has excessive jitter.

You can test/measure that with https://github.com/x42/jack_midi_latency use a MIDI cable to connect the soundcard's MIDI out back to its MIDI in. then launch jack_midi_latency and connect its ports.

jack_midi_clock here is solid -- the timing when used inside jack is perfect and when it leaves the machine it depends on the MIDI hardware used, but even with USB soundcards the jitter here is well below a ms:

# jack_midi_latency -i "system:midi_capture_1" -o "system:midi_playback_1"
[....]
 min=  4.00 max=  5.02 range=  1.02 avg=   4.5 dev=  0.28 [ms]

What soundcard(s) do you use?

ViktorNova commented 8 years ago

Correct, I am only seeing this when leaving the computer and connecting to actual physical MIDI hardware, Emagic MT4 is the MIDI interface in question (which otherwise works perfect)

Thank you for the tip, I will run the test you suggested on the MT4 and a few other devices, and report back.

x42 commented 8 years ago

come to think of it: it could also be jack2's built-in midi driver -- prefer a2jmidid or jack1.

ViktorNova commented 8 years ago

Interesting.. I am using jack2 and didn't know there were issues with it, however I am using "none" as the MIDI driver and usiung a2jmidid to go out to ALSA, so it's not that. Thanks for mentioning that though. I'll try a few different things and let you know what I find out