1

I've encountered an undocumented issue which I have not been able to diagnose. I'm using pd-for-ios. My patch loaded into libpd (iOS) is behaving differently to running within Pd.

I managed to find out that delay and metro objects are sending out messages at much higher rate than specified. It seems that there is no time sync within libpd. To test this I made a simple patch that's got a metronome sending a bang every 1 second. In Pd it works as expected. In libpd I registered a dispatcher and a bang is coming in every few milliseconds. When I load in the patch into one of pd-for-ios test projects supplied the result is the same. Seems as if the metronome is working without time limit, sending bangs continuously.

enamodeka
  • 65
  • 6

1 Answers1

2

libpd itself has no built-in sense of wall time. It only keeps track of time in terms of the number of audio frames processed; client code is responsible for calling libpd's process method at the right time.

If you use libpd with pd-for-ios, then this will be taken care of implicitly because pd-for-ios will create an audio unit that invokes libpd's process method in its rendering callback.

If you're calling the process method directly, then it'll just run as fast as it can, which explains the behavior you're seeing. You could implement your own delays, but it's probably easier to go through pd-for-ios instead.

Nettoyeur
  • 91
  • 2
  • Interestingly, I am using pd-for-ios. I should have explicitly stated that the libpd test projects I tested my patch with are from the pd-for-ios package. (edited original question). That's what got me startled. Any idea how to check whether pd-for-ios is setting Audio Unit correctly? – enamodeka Oct 10 '15 at 19:30
  • Which test project are you looking at? – Nettoyeur Oct 13 '15 at 00:16
  • This is doing my head in. I did try SliderPadBasic and PolyPatch. What's interesting, in PolyPatch my patches' tone stays at right pitch, but fires so fast it sounds as a continuous sound (it does at in all other tests I've done too), BUT the PolyPatch test2.pd is playing a low pitch sound blurbs. Yet, when I open the patch in Pd the pitch of test2.pd is higher and plays at shorter intervals... – enamodeka Oct 13 '15 at 22:40