How to use Ableton Link with ofxPd?

Hi, I’m trying to use Ableton Link with @danomatika’s ofxPd on iOS.

I followed these steps which I found from this link
(https://github.com/libpd/pd-for-ios/tree/master/abl_link)

Getting started

  • Set up a libpd-based Xcode project as usual.
  • Add the Link library and headers to your project setup as described here: http://ableton.github.io/linkkit/#getting-started
  • Add abl_link/ios to your header search path.
  • Add abl_link/ios/PdLinkAudioUnit.{h,m} to the sources of your project.
  • Add the Link preference pane to your user interface (e.g., by cargo-culting the relevant bits of the LinkHut sample project).
  • Create a Link instance, a PdLinkAudioUnit instance, and a PdAudioController instance:
ABLLinkRef linkRef = ABLLinkNew(120);
PdLinkAudioUnit pdAudioUnit = [[PdLinkAudioUnit alloc] initWithLinkRef:linkRef];
PdAudioContoller pd = [[PdAudioController alloc] initWithAudioUnit:pdAudioUnit];
  • Create a Pd patch using the desktop version of the Link external, abl_link~.
  • Add the patch to your Xcode project.

Following these steps, I found out it requires iOS version of libpd and not C++ version which ofxPd uses.

Would it be possible to use [abl_link~] external in ofxPd?
Has anyone ever tried this?
Any advise or guidance would be greatly appreciated.

There is currently no “drop in” way to do this. You will have to take the appropriate Link C++ bits out of the PdLinkAudioUnit and implement them into your OF app. The main area would be taking the audio render callback Link update parts and placing them in ofApp::audioIn or ofApp::audioOut, etc.

1 Like

Hi @danomatika

Thank you for your answer.
It looks like it is beyond my ability to do the work at the moment.
I guess I’ll try this later when I feel more confident with objective-c.

You don’t need any Obj-C and you don’t need the PdAudioController since OF provides it’s own sound system. Link itself is a C++ library and you simply need to make the same setup & update calls to it in your ofApp as is done in the PdAudioController with the most important part being how Link is updated in the audio render callback along with libpd. You don’t have to use the Link UI framework to use Link itself.

I recently used Link with the default ofSoundStream. This is mostly copy & paste from the Link example project into the of soundOutputStream class callback.