diff --git a/pd/src/s_midi.c b/pd/src/s_midi.c index d1a20a003cab4a90a452837b894e880e6f583c95..565284a360fd800d5d18974d445e0cf1a1fd1f64 100644 --- a/pd/src/s_midi.c +++ b/pd/src/s_midi.c @@ -291,6 +291,7 @@ typedef struct midiparser /* functions in x_midi.c */ void inmidi_realtimein(int portno, int cmd); +void inmidi_clk(double timing); void inmidi_byte(int portno, int byte); void inmidi_sysex(int portno, int byte); void inmidi_noteon(int portno, int channel, int pitch, int velo); @@ -313,7 +314,17 @@ static void sys_dispatchnextmidiin( void) outlet_setstacklim(); if (byte >= 0xf8) + { inmidi_realtimein(portno, byte); + if (byte == 0xf8) { + // AG: Not sure what the timebase for the right outlet is supposed + // to be. I'm using msecs right now, which is in line with the other + // tempo-related objects such as metro. Multiply with .001 to + // get seconds instead. + double timing = clock_gettimesince(sys_midiinittime); + inmidi_clk(timing); + } + } else { inmidi_byte(portno, byte);