ofxPDSP icon indicating copy to clipboard operation
ofxPDSP copied to clipboard

Can I sync the sequencer via MIDI clock and/or ableton link ?

Open macramole opened this issue 4 years ago • 7 comments

If not, can you give me some insight on how this could be implemented ?

thanks

macramole avatar Mar 22 '20 20:03 macramole

hello! those feature are not yet available.

midi clock could be implemented but it won't be easy, probably the best option would be to make a class that process pdsp::midi::Input in a similar manner to the keyboard or pads class but it calculates the right playhead value for the audio buffer to process

ableton link should be implemented into a separate addon as the ableton link license (GPL) is incompatible with the ofxPDSP MIT license

npisanti avatar Mar 22 '20 22:03 npisanti

For the MIDI Clock, what if I make public and call SequencerProcessor::setPlayHead() for each MIDI Clock message ? Will it work ? Is it totally wrong ? Will something be out of sync ?

macramole avatar Jun 30 '20 02:06 macramole

i looked at the code again and probably it won't work that way, as it doesn't have memory of the old playhead, so skipping to a point could left you with unplayed events.

Adding midi clock input should need a rewrite of a good amount of ScoreProcessor

npisanti avatar Jun 30 '20 10:06 npisanti

hey man, thanks for the reply. I hope you and your loved ones are hanging in there fine with the pandemic and all.

you mean SequencerProcessor right ?

I'm trying to understand the problem.

What you are thinking is: if I change the playhead using setPlayHead() it won't be "instantaneous" since the process method runs in the audio thread so it will actually change only next time the engine call process. In this scenario we may have events occurring that shouldn't occur. Is this right ?

macramole avatar Jun 30 '20 15:06 macramole

luckily everyone is fine, i'm the south now and here the pandemic has been weaker.

What i mean it's this: when you set the playhead it simply changes the starting point for the next iteration for the audio thread. Then in the audio thread the next point of playhead it's calcolated and only the events between the actual playhead point and the next are triggered. So it could happen that by making the playhead jump with midi you accidentally move it in a way that some events are not triggered (midi clock is also a bit jittery)

npisanti avatar Jun 30 '20 19:06 npisanti

Ok, thanks for the explanation.

Since I'm not using all the great features the sequencer provides I'll just use an alternative clock. Implementing MIDI clock here seems out of my possibilities and a worthless effort since the alternative is working good enough.

I've reached a point where I'm finally enjoying ofxPDSP's features including sound effects !, I'll ask some questions in other thread.

You said "you are in the south" I guess south of Italy ? I'm from Argentina, very long lockdown here.

cheers.

-- leandrogarber.info

El mar., 30 jun. 2020 a las 16:34, Nicola Pisanti ([email protected]) escribió:

luckily everyone is fine, i'm the south now and here the pandemic has been weaker.

What i mean it's this: when you set the playhead it simply changes the starting point for the next iteration for the audio thread. Then in the audio thread the next point of playhead it's calcolated and only the events between the actual playhead point and the next are triggered. So it could happen that by making the playhead jump with midi you accidentally move it in a way that some events are not triggered (midi clock is also a bit jittery)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/npisanti/ofxPDSP/issues/62#issuecomment-651999751, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAWH6OL6ZEQITCMRMTSXWHDRZI44TANCNFSM4LRNNIXQ .

macramole avatar Jul 06 '20 15:07 macramole

ah yes, i was meaning south italy, here the lockdown is a bit loose and there are few cases, obviously we still have to wear masks in many places.

let me know if you need something =)

npisanti avatar Jul 06 '20 19:07 npisanti