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
Libpd and OpenAL (C / C++)
  • Having a hard time getting OpenAL to play any patch (using libpd). I was wondering if someone out there could help me out and explain what I'm doing wrong. I'm getting some output, but it's not the patch, it's just a repetitive buzz sound, which leads me to think that I'm doing something wrong per frame, rather than with initialization;

    void update(double timeSinceLastFrame) {

    pdBase->processFloat(1, inbuf, outbuf);
    alBufferData(_bufferHandle, AL_FORMAT_STEREO16, outbuf, 128, srate); alSourcei(_sourceHandle, AL_BUFFER, _bufferHandle); alSourcePlay(_sourceHandle);

    }

    Is this the generally used method for getting OpenAL to play the output of a patch?

  • I'm not really familiar with OpenAL, but it looks to me like you have a sample format mismatch -- you're computing float samples with libpd, but you're telling OpenAL to expect short int samples. That would explain the sort of buzz you're hearing; I once almost fried my studio monitors that way. Try pbBase->processShort instead.