Frage

I'm currently utilizing libPd (Pure Data wrapper) as an audio engine for my text-based adventure game written in Python. With the majority of the programming/patching out of the way, the last thing I need to do is initialize different subpatches independently within Pd depending on different scenarios; I have them set up in such a way that a bang message (or 1) will suffice.

Audio programming malarkey aside, what I'm really asking is how I'd go about "sending" this message (1) to my Pd patch via Python? Is it even possible? A test script exists for receiving information FROM Pd here. I just need the opposite.

War es hilfreich?

Lösung

In python things are a bit different. Once you have the python bindings built you can look in the build folder and find pylibpd.py in the lib.YOUROPERATINGSYSTEM folder. You can see all of the def statements and what they are mapped to in libpd.

The simplest sending message is this:

libpd_message('recvr', 'hellooo')

If you'd rather send a float then you can like this:

libpd_float('recvr', 323.290)

These will show up in your PD patch if you have a receive object with the argument recvr.

Another good resource is the original paper on libpd. http://www.uni-weimar.de/medien/wiki/images/Embedding_Pure_Data_with_libpd.pdf

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top