danomatika / ofxPd

(maintained) a Pure Data addon for OpenFrameworks using libpd
Other
202 stars 45 forks source link

[metro] outputs a single bang and then stops #90

Closed alexdrymonitis closed 2 years ago

alexdrymonitis commented 2 years ago

I've successfully included a Pd patch to my OF app with ofxPd (I'm receiving various messages printed to Pd's console in OF), but when I send a 1.0 to a [metro], it bangs only once and then stops, without receiving any 0.0 to make stop. Is there any known issue with libPd and [metro] or other similar objects?

danomatika commented 2 years ago

No known issues. Are you running the audioIn/audioOut functions with the ofxPd object?

alexdrymonitis commented 2 years ago

I wasn't, but tried it after you suggested it and it's still the same. Actually I don't need any audio, so I was trying to not call pd.start(), which worked for sending messages and printing to the console. I now included pd.start() and audioReceived() and audioRequested() but still no dice.

danomatika commented 2 years ago

I have no idea. metro has always worked as is in the test patches. Does pdExample work?

alexdrymonitis commented 2 years ago

Yes, pdExample worked fine. I'll try to narrow it down and maybe post some code here, if I can't figure it out.

alexdrymonitis commented 2 years ago

I think it has to do with ALSA, as I'm trying to use ofxPd to sequence OSC messages that I'm receiving in another Pd instance. If I first launch Pd, then [metro] doesn't work in ofxPd. If I launch the OF app first, then I can't run audio in Pd, but [metro] works fine. Is there a solution to this?

danomatika commented 2 years ago

I have no idea and have had no issue sending OSC between Pd and an OF app.

If you don't need audio in the OF app, run the ofxPD audioOut function in a loop in the ofApp::update() function with a dummy buffer. Do maybe 8 ticks or so. You could calculate the fake buffer rate using the frame rate and choose the number of ticks to run each frame.

alexdrymonitis commented 2 years ago

Actually, using Jack solved the issue. Both OF and Pd used Jack (I didn't have to do anything in the OF app, since Jack was running, it was chosen by default) and [metro] worked fine. I didn't get any sound from Pd (not from ofxPd), but that's irrelevant. Anyway, I'm closing this issue as it's not related to ofxPd. Thanks for the hints.

danomatika commented 2 years ago

I would bring it up on the main openFrameworks repo as perhaps it's a general issue for OF+ALSA on linux.