Yarns: apply swing when clocked externally

It seems Yarns doesn’t apply swing when clocked externally.

How hard would that be to add? Is it a good idea?

It seems harder to do swing for an incoming clock than when generating a clock, because it would have to generate a pulse before the MIDI clock happens. It could estimate the tempo based on the last two MIDI clock pulses and apply swing to that.

There are two approaches for syncing to incoming MIDI clock:

1. You derive the tempo from the clock messages and use that to set the tempo of your internal sequencer. This is often done by averaging over 1 beat (24 messages).
2. You use the clock messages to advance your sequencer directly. In this case your sequencer probably has a resolution of 24 ppqn.

2 is what simpler or older gear does, 1 is what most modern gear does. There’s no way to do your own swing if you do 2.

Thanks @t2k!

Where in the yarns code does it respond to MIDI clock? Is it already computing the tempo from clock messages (1)?

I don’t know. I assume Yarns does 2 because devices that do 1 can swing regardless of where their clock comes from.

I’m sure @pichenettes knows :slight_smile:

Yarns doesn’t try to compute the tempo from the MIDI clock. It reacts to each MIDI clock tick (2).