To register and login, use your Google, Twitter, Facebook, LinkedIn, or OpenID credentials.

This is allowing us to stop most spam registrations. We've deleted most of the spam accounts that got through, and we're closely watching for more.

iPad cpu limitations libpd

nisiosnisios Posts: 2
edited December 2012 in Pd Everywhere


This is my first post here, so i want to thank evrybody for making such a great community. Thanks!!!
Im a sound engineer making a libpd app for my final graduation project with the help of a friend of mine who is experienced in ios development.

I've been using pd for a long time in my college (very nice thing indeed i had so many pd and max related classes!) and i thought it would be very nice to develop a consumer application as soon as i knew libpd existed.

We are trying to make a polyphonic synth for ipad but are getting in some trouble.

We maneged to make the synth work but only with 2 voices instead of the planned 8. When we add all the voices the synth compiles and the app loads but we get no sound out of it. The strange thing is that when we run the app in profiler mode it runs smooth with all the 8 voices (although the cpu usage is approximately 70%)

I strimelined the code to make it a lot more cpu friendly (table lookup oscilators instead of bandlimited ones) but the result is exactely the same.

Does anyone has any experience with this?




  • reakinatorreakinator Posts: 301

    First off, you can try simplifying your synth voices to just be [osc~] objects, and turn off all effects with [switch~]. Make sure you have that working on desktop / Pd Vanilla with a test patch, and then try loading it on your iPad. If you're still not getting sound, there's probably some variable, such as volume or cutoff or something, that hasn't been set - time to start using [env~] in various places and printing the results to the console.

    Hope that helps you on your path..


  • Hi,

    Thanks for replying.

    I'm actually getting sound out of the synth, the thing is that it only runs in profiler mode with 8 voices. In normal or whatever it's named mode I can only make it work (output sound, because it apparently runs) with two or three voices.

    My question is, can at least I make it run like in profiler mode all the time?


  • Hi,

    As my colleague nisios has already said, if the number of voices is limited to two only, the application works even with all the effects associated with each oscillator.

    The thing is really tricky as it stops giving sound when more than two voices are used (not giving sound at all).

    However, when application is launched thru XCode Instruments with Activity Monitor mode selected, it runs fine, giving sound, even with 8 voices.

    The tricky part is... what is limiting the app? What is instruments doing to allow more voices? It was supposed to run worst since Instruments ads some overhead. I can't really figure out what is happening and I was hoping someone had experienced the same kind of phenomena.



    With my best regards,

    Nuno Santos

  • reakinatorreakinator Posts: 301

    As a preliminary sanity check, you can try the SlidePad sample in pd-for-ios with 10 voices (just change the constant at the top of SlidePadViewController.m from 5 to 10). I'm pretty sure this was working fine for me, but it's been a while.

  • I'll do that and post the results later! ;) Can you remember any other details that might be missing me?

  • Problem solved.

    The question is that when the application was run in profiling mode, it was being builded by default for Release, while when builded to simply Run, it was being built for Debug.

    I changed the settings to build it for Release in Run mode and it is now working.

    In the mean while we have also identified some optimizations that can be done in the pd side.


    Nuno Santos

  • pbrinkmannpbrinkmann Posts: 686 ✭✭

    Thanks for the update, Nuno! What sort of optimizations did you come up with on the Pd side?

Sign In or Register to comment.