Sending bar/beat in MIDI event

I’m trying to figure out how I can get Ardour to send the song position as a MIDI event. I can’t find the Song Position Pointer event coming from any MIDI output (Midi clock, MTC, MMC) and can’t find any other equivalent info. The QFRAME time code and the MIDI clock can get like 50% there, but not all the way.

My goal is to have an external MIDI sequencer follow Arsour’s position in the song to do stuff like arpeggiation or step sequencing synced to the song.

Ardour should send it via the MIDI Clock output, if set to generate MIDI Clock. When do you expect to see it sent?

I didn’t have a specific expectation of when; I thought I saw a doc that indicated it would be every 6 Clock events but that’s not important to me, as long as I know it will come at least when there’s a discontinuity in the clock so I can track it with decent accuracy.

Good to hear that it’s expected to come out – probably it’s a case of the event getting lost in my software stack somewhere and silently dropped. If I am seeing the MIDI Clock events on the output, is there any additional setting that I could need to enable for song position, or do they go together?

image

It is sent before the transport starts. It is not sent continuously - that’s not part of the MIDI spec for SPP.

BTW: the screenshot shows an error - this is from the MIDI Clock out port, not the one shown there.

Ok, I did some more exploring and I am seeing the SPP event as you show above. Not sure why I wasn’t seeing it before!

The one caveat seems to be that if the starting position is 0 there’s no SPP sent, so if you are tracking the song position you have to interpret every “Real Time Start” event as resetting the position to 0 pending a possible following SPP. Does that seem correct?

Slightly different but related issue – I can successfully get the SPP and clock events into either an external MIDI program or an LV2 plugin instance, great! Also I get MIDI QFRAME events from the MTC output to a separate MIDI-handling program. However I can’t see any QFRAME events coming through to an LV2 plugin.

In the LV2 docs it looks like there is a quarter frame event defined, but it doesn’t have a payload specified so there’s no way to send the clock time. It would make sense if this meant that implementors would choose not to send this event?

I have dug around in the Ardour source, but I can’t find where the internal MIDI events are converted to LV2 :confused:

Likely LV2Plugin::connect_and_run()