Apologies for spam; we've changed our policy by requiring approval for accounts, and deleted all existing spam and user - thanks for your help flagging content. We continue to test our forums and Vanilla software, aiming for release early in 2013. If you need to give us feedback outside the forum, contact us via http://createdigitalmusic.com/contact/ or on Facebook
print hook not being called in C sample, libpd
  • I compiled libpd and C example on Ubuntu 12.04 without a hitch. Running the C example in 'samples/c_samples/c' seems to work, however the two hooks defined for midi-note-on and print are not being called. When I run:

    $./pdtest test.pd ./

    The program runs (and I've verified it is computing samples), but the print hook or midi hooks are not called. Anyone have luck with this basic example?
    I've also had same experience with ARM architecture (compiled fine on Raspberry Pi, and the sample runs, but the hooks aren't called)

    Thanks !

  • Upon closer inspection, it's not that the print hook isn't being called, but instead the hook isn't being set at all (libpd_printhook still NULL even after it is set in pdtest.c).. line 20:

    libpd_printhook = (t_libpd_printhook) pdprint;

    in pdtest.c has no effect.

    Adding a function to z_libpd.c to set it, and then calling this from pdtest.c fixes the issue:

    void libpd_set_printhook(const t_libpd_printhook hook){ libpd_printhook = hook; }

    This shouldn't be necessary since libpd_printhook is declared as extern (and compiles fine), right? I must be missing some C / linking thing...

  • Not sure what's going on here. How did you compile the sample?

  • I just compiled using the included makefile:

    git clone git://github.com/libpd/libpd.git cd libpd make cd samples/c_samples/c make

    running sample (./pdtest test.pd ./), nothing gets printed

  • For me it's the same: program does not deliver output. I compiled the example with debug symbols and stepped through the code, but the functions pdprint and pdnoteon are newer called.

    It's not a good start, when a minimal example fails. Any hints?

  • I ran test.pd in pd. My only audio interface, which is working is ALSA. OSS and JACK are not working on my machine.

    Which is the default audio interface, being inititialized by libpd_init and libpd_init_audio? Can that be a reason for the fail of the program?

  • I built this example on Windows using MinGW and it works.