modified for dual_queues branch of libpd
updated for latest version of libpd