OfxSequencer and external midi

I am using ofxSequencer for a project , and I would like that the sequencer works as a slave of an incomming midi signal .

I tryed to sync manually the ofxSequencer example with a Drum Machine but looks like the ofxSequencer loses the sync. So, I would like to try to input external midi clock coming from the drum machine to ofxSequencer .

I saw there is an addon called ofxMidiClock, that probably will allow me to sync the sequencer to external devices but I dont know how can I implement it properly.

Is there anyone could give me some hint ?

Thanks !

Hey @llorencg,

Besides some addons around, you can use this example to receive an external midi clock into OF:

If you want to use tight internal clock things go harder, several timers like ofxMSATimer, etc will go out of sync very often. When the app window is moved, minimized, or framerate performance is suffering clock timer out performs…

This is another internal clock that worked well but stills clock timer problems.

If you want to implement a tight internal clock, some users advise using the audio buffer (not timers) as a better clock. Some snippet to use here:

You can check other audio engines with internal sequencers like ofxPDSP, ofxSoundObjects or ofxPd.

(Also, ofxSequencer has some rare behaviors here like ignored mouse clicks sometimes, start playing from step 2 not 1 sometimes and other problems. If you make some improvements into a new fork I would like to check. Has been so hard to my skills to handle the code well to store patterns and make scalable or customize patterns sizes.)
Maybe if you are interested I can put my buggy tests public at GitHub (step sequencer + patterns kit + internal/external clock) It looks like:


Thanks for all the info! very useful, I am really new with OF and coding in general so I will need some time to check all links :slight_smile: I will try first to implement the midi input and later on to improve the internal clock following the links you posted. I woud be super interested to see your sequencer , looks amazing !

it could be worth to check out ofxPDSP as well, there are sequencer examples included. i am not sure how to sync with an external clock, but @npisanti probably can give some advices.

1 Like

hey @llorencg,
If you want to receive and sync only from an external midiclock (to receive into your ofApp), without any sequencing, you can use this other add-on alone.

With this addon you can receive the clock ticks from a external sequencer like you asked. You need to setup a virtual midi port to feed from Ableton or any midi sequencer app. You can receive the midi clock also from an external hardware device that runs a clock too.
I hope it helps in some way.

Thanks so much !!! I will test it and let you know my progress!! :slight_smile: