Hi dynamic community,
I'm working on an open source multiuser game with a sound experimentation focus. The choosen sound engine is our favorite one Pure Data. Let's imagine populate a 3D world with pd sound patchs ! The issue is to create/destroy audio abstractions (made by users/artists) and connect/disconnect them. The audio path system must be compliant with paths in a 3D world. A sound pass through rooms and apertures : http://abel.jerome.free.fr/newatlantis/AudioDynamicPatching/images/pathfindi...
It must be dynamic like a game. I was enjoying doing this with pd, but ... my hair become more and more white. It's quite difficult.
I propose here to write a little review of this issue. To be completed, to be rectified. Don't forget that the best is the easiest way (less compilation, less dependancies, less bad tricks, etc.) and cross-platform (Linux/MacOSX/Win).
*** DYNAMIC PATCHING TESTS ***
All my tests and comments here (patchs, screenshots) : http://abel.jerome.free.fr/newatlantis/AudioDynamicPatching.tar.gz
First, considering audio in Pd, we can read "do not use dynamic patching" !! http://puredata.info/docs/tutorials/TipsAndTricks#how-to-avoid-audio-drop-ou...
It's not very encouraging. So what ? Which tool use then ?
A comparison of audio tools : http://en.wikipedia.org/wiki/Comparison_of_audio_synthesis_environments
Supercollider seems to work well with dynamic audio connections. We can read "Adding an Effect Dynamically" and so on. http://danielnouri.org/docs/SuperColliderHelp/Tutorials/Tutorial.html
"It is an efficient and expressive dynamic programming language" http://en.wikipedia.org/wiki/SuperCollider
So, how interface it with a pd patch ? I know that it's ok with OSC messages, but could we imagine, Supercollider as a the connection manager and Pd as the sounds loader ? An audio communication between Supecollider and Pd.
Some projects use Python to make dynamic patching. I don't know if those projects are really working with full functionnalities like a complete audio path system. I think the most advanced is Purity but may be not enough, see the roadmap. Any feedbacks in use ?
Purity is a Python library for Pure Data dynamic patching. http://wiki.dataflow.ws/Purity
Pyata - a Library that allows you to use Pure Data inside Python svn checkout http://pyata.googlecode.com/svn/trunk/ pyata-read-only
Automata-topd is a small collection of Python classes to communicate with Pure Data sending FUDI messages by socket. https://github.com/automata/topd
PuréeData is a browser-based PureData interface for a remote, central server that allows live, collaborative patching for anyone, anywhere. https://github.com/virgildisgr4ce/PureeData
Let's come back with Pd. We know that Pd was used in a game Spore : http://lists.puredata.info/pipermail/pd-list/2007-11/056212.html
It could be a solution to handle dynamic audio patching. Any feedbacks ?
Libpd turns Pd into an embeddable library, so you can use Pd as a sound engine in mobile phone apps, games, web pages, and art projects http://puredata.info/community/projects/software/libpd/
How to use Pure Data as an API http://jeraman.wordpress.com/2009/03/22/how-to-use-pure-data-as-a-api/
This external allows the dynamic creation and deletion, connection and disconnection of standard Pd objects and abstractions. But : dyn~ is bound to the PD version it is compiled for. http://puredata.info/Members/thomas/dynext
I success compile it. It seems a good system. If we compile a binary for 3 or more plateforms, will it work just with the binaries ? We must see advantages with my system (pd-messages + index + abstractions) http://abel.jerome.free.fr/newatlantis/AudioDynamicPatching/images/dyn-audio...
We know reflection in Pd with iemguts. I'm not comfortable with it. Any feedbacks about the issue ? https://pure-data.svn.sourceforge.net/svnroot/pure-data/trunk/externals/iem/... http://lac.linuxaudio.org/2009/cdm/Saturday/18_Zmoelnig/zmoelnig_pdreflectio...
A review with pd internal messsages. http://puredata.info/Members/eni/techniques
In Pd : /usr/lib/pd-extended/doc/Pure Data/manuals/pd-msg
Basic tests : http://abel.jerome.free.fr/newatlantis/AudioDynamicPatching/images/dyn-audio...
'iemmatrix' provides a suite of matrix processing and linear algebra functionality. http://puredata.info/community/projects/software/iemmatrix
The problem here, the numbers of rows and columns are fixed.
System with receive~/throw~ and catch~/send~ (many-to-many connections) : http://abel.jerome.free.fr/newatlantis/AudioDynamicPatching/images/dyn-audio... http://abel.jerome.free.fr/newatlantis/AudioDynamicPatching/images/dyn-audio...
Do you think receive~/send~ could be use in a dynamic audio patching ? Is there a problem with buffer or something like that ? Any feedbacks with a lot of connections ?
There is a problem when I create an audio abstraction. The sound of the abstraction is not working while other previous audio objects are working. We have to send a mouseup and cut message to simulate mouse activity ! http://abel.jerome.free.fr/newatlantis/AudioDynamicPatching/images/dyn-audio...
*** OTHER RESOURCES ***
http://jeraman.wordpress.com/tag/dynamic-patching/
[PD] dynamically settable many-to-many cordless audio routing http://www.mail-archive.com/pd-list@iem.at/msg29163.html
[PD] About dynamic patches http://lists.puredata.info/pipermail/pd-list/2002-05/006646.html
[PD] [PD-announce] many - a library for managing many instances http://lists.puredata.info/pipermail/pd-list/2010-11/084446.html http://puredata.info/community/projects/software/many
[PD] About dynamic patches http://lists.puredata.info/pipermail/pd-list/2002-05/006658.html
[PD] Automated object/message/etc creation http://lists.puredata.info/pipermail/pd-list/2005-11/032911.html
http://konkanok.com/2010/12/dyn-object-for-pure-data/
--- flext ---
# where is the PD source package? PDPATH=/usr/lib/pd-extended/ ... # where should the external be installed? INSTPATH=/usr/lib/pd-extended/extra
--- dyn ---
How-to: Hacking RjDj with PD http://blog.makezine.com/archive/2008/11/howto-hacking-rjdj-with-p.html?CMP=...
https://pure-data.svn.sourceforge.net/svnroot/pure-data/trunk/externals/iem/...
http://autobuild.puredata.info/auto-build/ 2) create a directory iem_guts : mkdir iem_guts 3) take iem_guts sources : svn co https://pure-data.svn.sourceforge.net/svnroot/pure-data/trunk/externals/iem/... ./iem_guts 4) move into sources directory cd iem_guts/src 5) compile iem_guts : make l_i386 6) add library into ~.pdsettings
http://nsound.sourceforge.net/
Have you looked at the [switch~] object? It doesn't allow you to create/destroy the abstractions, but it does allow you to turn off dsp in each of them as necessary.
-Jonathan
--- On Tue, 3/15/11, Jérôme Abel abel.jerome@free.fr wrote:
From: Jérôme Abel abel.jerome@free.fr Subject: [PD] Dynamic patching with audio - review To: pd-list@iem.at Date: Tuesday, March 15, 2011, 12:07 AM Hi dynamic community,
I'm working on an open source multiuser game with a sound experimentation focus. The choosen sound engine is our favorite one Pure Data. Let's imagine populate a 3D world with pd sound patchs ! The issue is to create/destroy audio abstractions (made by users/artists) and connect/disconnect them. The audio path system must be compliant with paths in a 3D world. A sound pass through rooms and apertures : http://abel.jerome.free.fr/newatlantis/AudioDynamicPatching/images/pathfindi...
It must be dynamic like a game. I was enjoying doing this with pd, but ... my hair become more and more white. It's quite difficult.
I propose here to write a little review of this issue. To be completed, to be rectified. Don't forget that the best is the easiest way (less compilation, less dependancies, less bad tricks, etc.) and cross-platform (Linux/MacOSX/Win).
*** DYNAMIC PATCHING TESTS ***
All my tests and comments here (patchs, screenshots) : http://abel.jerome.free.fr/newatlantis/AudioDynamicPatching.tar.gz
1 - PURE DATA
First, considering audio in Pd, we can read "do not use dynamic patching" !! http://puredata.info/docs/tutorials/TipsAndTricks#how-to-avoid-audio-drop-ou...
It's not very encouraging. So what ? Which tool use then ?
A comparison of audio tools : http://en.wikipedia.org/wiki/Comparison_of_audio_synthesis_environments
2 - SUPERCOLLIDER
Supercollider seems to work well with dynamic audio connections. We can read "Adding an Effect Dynamically" and so on. http://danielnouri.org/docs/SuperColliderHelp/Tutorials/Tutorial.html
"It is an efficient and expressive dynamic programming language" http://en.wikipedia.org/wiki/SuperCollider
So, how interface it with a pd patch ? I know that it's ok with OSC messages, but could we imagine, Supercollider as a the connection manager and Pd as the sounds loader ? An audio communication between Supecollider and Pd.
3 - PYTHON
Some projects use Python to make dynamic patching. I don't know if those projects are really working with full functionnalities like a complete audio path system. I think the most advanced is Purity but may be not enough, see the roadmap. Any feedbacks in use ?
Purity is a Python library for Pure Data dynamic patching. http://wiki.dataflow.ws/Purity
Pyata - a Library that allows you to use Pure Data inside Python svn checkout http://pyata.googlecode.com/svn/trunk/ pyata-read-only
Automata-topd is a small collection of Python classes to communicate with Pure Data sending FUDI messages by socket. https://github.com/automata/topd
PuréeData is a browser-based PureData interface for a remote, central server that allows live, collaborative patching for anyone, anywhere. https://github.com/virgildisgr4ce/PureeData
4 - PURE DATA - LIBPD
Let's come back with Pd. We know that Pd was used in a game Spore : http://lists.puredata.info/pipermail/pd-list/2007-11/056212.html
It could be a solution to handle dynamic audio patching. Any feedbacks ?
Libpd turns Pd into an embeddable library, so you can use Pd as a sound engine in mobile phone apps, games, web pages, and art projects http://puredata.info/community/projects/software/libpd/
How to use Pure Data as an API http://jeraman.wordpress.com/2009/03/22/how-to-use-pure-data-as-a-api/
5 - PURE DATA - DYN~
This external allows the dynamic creation and deletion, connection and disconnection of standard Pd objects and abstractions. But : dyn~ is bound to the PD version it is compiled for. http://puredata.info/Members/thomas/dynext
I success compile it. It seems a good system. If we compile a binary for 3 or more plateforms, will it work just with the binaries ? We must see advantages with my system (pd-messages + index
- abstractions)
http://abel.jerome.free.fr/newatlantis/AudioDynamicPatching/images/dyn-audio...
6 - PURE DATA - IEMGUTS
We know reflection in Pd with iemguts. I'm not comfortable with it. Any feedbacks about the issue ? https://pure-data.svn.sourceforge.net/svnroot/pure-data/trunk/externals/iem/... http://lac.linuxaudio.org/2009/cdm/Saturday/18_Zmoelnig/zmoelnig_pdreflectio...
7 - PURE DATA - PD MESSAGES
A review with pd internal messsages. http://puredata.info/Members/eni/techniques
In Pd : /usr/lib/pd-extended/doc/Pure Data/manuals/pd-msg
Basic tests : http://abel.jerome.free.fr/newatlantis/AudioDynamicPatching/images/dyn-audio...
8 - PURE DATA - MATRIX~
'iemmatrix' provides a suite of matrix processing and linear algebra functionality. http://puredata.info/community/projects/software/iemmatrix
The problem here, the numbers of rows and columns are fixed.
9 - PURE DATA - COORDS / WIRELESS
System with receive~/throw~ and catch~/send~ (many-to-many connections) : http://abel.jerome.free.fr/newatlantis/AudioDynamicPatching/images/dyn-audio... http://abel.jerome.free.fr/newatlantis/AudioDynamicPatching/images/dyn-audio...
Do you think receive~/send~ could be use in a dynamic audio patching ? Is there a problem with buffer or something like that ? Any feedbacks with a lot of connections ?
10 - PURE DATA - CREATE AUDIO ABSTRACTIONS
There is a problem when I create an audio abstraction. The sound of the abstraction is not working while other previous audio objects are working. We have to send a mouseup and cut message to simulate mouse activity ! http://abel.jerome.free.fr/newatlantis/AudioDynamicPatching/images/dyn-audio...
*** OTHER RESOURCES ***
DYNAMIC PATCHING
http://jeraman.wordpress.com/tag/dynamic-patching/
PURE DATA MAILING LIST
[PD] dynamically settable many-to-many cordless audio routing http://www.mail-archive.com/pd-list@iem.at/msg29163.html
[PD] About dynamic patches http://lists.puredata.info/pipermail/pd-list/2002-05/006646.html
[PD] [PD-announce] many - a library for managing many instances http://lists.puredata.info/pipermail/pd-list/2010-11/084446.html http://puredata.info/community/projects/software/many
[PD] About dynamic patches http://lists.puredata.info/pipermail/pd-list/2002-05/006658.html
[PD] Automated object/message/etc creation http://lists.puredata.info/pipermail/pd-list/2005-11/032911.html
DYN~
http://konkanok.com/2010/12/dyn-object-for-pure-data/
DYN~ - INSTALLATION
--- flext ---
- Download flext, see readme.txt, see build.txt
- bash build.sh pd gcc
- edit buildsys/config-lnx-pd-gcc.txt :
# where is the PD source package? PDPATH=/usr/lib/pd-extended/ ... # where should the external be installed? INSTPATH=/usr/lib/pd-extended/extra
- bash build.sh pd gcc
- sudo bash build.sh pd gcc install
--- dyn ---
- cd ./dyn/
- bash ../flext/build.sh pd gcc
- bash ../flext/build.sh pd gcc install
- bash ../flext/build.sh pd gcc clean
LIBPD
How-to: Hacking RjDj with PD http://blog.makezine.com/archive/2008/11/howto-hacking-rjdj-with-p.html?CMP=...
IEMGUTS
https://pure-data.svn.sourceforge.net/svnroot/pure-data/trunk/externals/iem/...
- install NightlyBuild pd-extended :
http://autobuild.puredata.info/auto-build/ 2) create a directory iem_guts : mkdir iem_guts 3) take iem_guts sources : svn co https://pure-data.svn.sourceforge.net/svnroot/pure-data/trunk/externals/iem/... ./iem_guts 4) move into sources directory cd iem_guts/src 5) compile iem_guts : make l_i386 6) add library into ~.pdsettings
NSOUND
http://nsound.sourceforge.net/
-- Jérôme Abel http://abel.jerome.free.fr
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hi,
On Tue, Mar 15, 2011 at 12:07:05AM +0100, JérÎme Abel wrote:
I'm working on an open source multiuser game with a sound experimentation focus. The choosen sound engine is our favorite one Pure Data. Let's imagine populate a 3D world with pd sound patchs ! The issue is to create/destroy audio abstractions (made by users/artists) and connect/disconnect them. The audio path system must be compliant with paths in a 3D world. A sound pass through rooms and apertures : http://abel.jerome.free.fr/newatlantis/AudioDynamicPatching/images/pathfindi...
It must be dynamic like a game. I was enjoying doing this with pd, but ... my hair become more and more white. It's quite difficult.
I propose here to write a little review of this issue. To be completed, to be rectified. Don't forget that the best is the easiest way (less compilation, less dependancies, less bad tricks, etc.) and cross-platform (Linux/MacOSX/Win).
...
4 - PURE DATA - LIBPD
Let's come back with Pd. We know that Pd was used in a game Spore : http://lists.puredata.info/pipermail/pd-list/2007-11/056212.html
It could be a solution to handle dynamic audio patching. Any feedbacks ?
Libpd turns Pd into an embeddable library, so you can use Pd as a sound engine in mobile phone apps, games, web pages, and art projects http://puredata.info/community/projects/software/libpd/
libpd will make a complete instance of Pd available inside of another application, but it does not deal with instantiating single objects. This is still only possible with the "usual" mechanism Pd offers, i.e. dynamic patching, and it has the same disadvantages.
Maybe LuaAV would be worth a look, too?
Frank Barknecht Do You RjDj.me? _ ______footils.org__
Not that I am necessarily recommending it but, Csound will allow you to instantiate multiple instances of objects at runtime. I did this with Csound awhile ago and haven't touched Csound since but the general idea was create all your instruments to accept parameters and store input/output connections etc. in tables. You tell Csound to read its score file from stdin and you create/destroy instruments with various parameters by sending to Csound's stdin using the general-purpose computer language of your choice. (I used Python). Hopefully Csound has graduated to allowing instances of instruments to be created through OSC as well as stdin at this point.
-John
On 03/15/2011 03:15 AM, Frank Barknecht wrote:
Hi,
On Tue, Mar 15, 2011 at 12:07:05AM +0100, Jérôme Abel wrote:
I'm working on an open source multiuser game with a sound experimentation focus. The choosen sound engine is our favorite one Pure Data. Let's imagine populate a 3D world with pd sound patchs ! The issue is to create/destroy audio abstractions (made by users/artists) and connect/disconnect them. The audio path system must be compliant with paths in a 3D world. A sound pass through rooms and apertures : http://abel.jerome.free.fr/newatlantis/AudioDynamicPatching/images/pathfindi...
It must be dynamic like a game. I was enjoying doing this with pd, but ... my hair become more and more white. It's quite difficult.
I propose here to write a little review of this issue. To be completed, to be rectified. Don't forget that the best is the easiest way (less compilation, less dependancies, less bad tricks, etc.) and cross-platform (Linux/MacOSX/Win).
...
4 - PURE DATA - LIBPD
Let's come back with Pd. We know that Pd was used in a game Spore : http://lists.puredata.info/pipermail/pd-list/2007-11/056212.html
It could be a solution to handle dynamic audio patching. Any feedbacks ?
Libpd turns Pd into an embeddable library, so you can use Pd as a sound engine in mobile phone apps, games, web pages, and art projects http://puredata.info/community/projects/software/libpd/
libpd will make a complete instance of Pd available inside of another application, but it does not deal with instantiating single objects. This is still only possible with the "usual" mechanism Pd offers, i.e. dynamic patching, and it has the same disadvantages.
Maybe LuaAV would be worth a look, too?
Ciao
And if you're going to use Csound there's the zak system of course. It's a pig to set up and very hard mental work to keep track of which streams have been activated or cleared to avoid clips or feedback... but it works in practice to give any to any dynamic patching so you can have modular synths being gracefully repatched at runtime.
a.
On Tue, 15 Mar 2011 23:29:17 -0500 John Harrison john.harrison@alum.mit.edu wrote:
Not that I am necessarily recommending it but, Csound will allow you to instantiate multiple instances of objects at runtime. I did this with Csound awhile ago and haven't touched Csound since but the general idea was create all your instruments to accept parameters and store input/output connections etc. in tables. You tell Csound to read its score file from stdin and you create/destroy instruments with various parameters by sending to Csound's stdin using the general-purpose computer language of your choice. (I used Python). Hopefully Csound has graduated to allowing instances of instruments to be created through OSC as well as stdin at this point.
-John
On 03/15/2011 03:15 AM, Frank Barknecht wrote:
Hi,
On Tue, Mar 15, 2011 at 12:07:05AM +0100, Jérôme Abel wrote:
I'm working on an open source multiuser game with a sound experimentation focus. The choosen sound engine is our favorite one Pure Data. Let's imagine populate a 3D world with pd sound patchs ! The issue is to create/destroy audio abstractions (made by users/artists) and connect/disconnect them. The audio path system must be compliant with paths in a 3D world. A sound pass through rooms and apertures : http://abel.jerome.free.fr/newatlantis/AudioDynamicPatching/images/pathfindi...
It must be dynamic like a game. I was enjoying doing this with pd, but ... my hair become more and more white. It's quite difficult.
I propose here to write a little review of this issue. To be completed, to be rectified. Don't forget that the best is the easiest way (less compilation, less dependancies, less bad tricks, etc.) and cross-platform (Linux/MacOSX/Win).
...
4 - PURE DATA - LIBPD
Let's come back with Pd. We know that Pd was used in a game Spore : http://lists.puredata.info/pipermail/pd-list/2007-11/056212.html
It could be a solution to handle dynamic audio patching. Any feedbacks ?
Libpd turns Pd into an embeddable library, so you can use Pd as a sound engine in mobile phone apps, games, web pages, and art projects http://puredata.info/community/projects/software/libpd/
libpd will make a complete instance of Pd available inside of another application, but it does not deal with instantiating single objects. This is still only possible with the "usual" mechanism Pd offers, i.e. dynamic patching, and it has the same disadvantages.
Maybe LuaAV would be worth a look, too?
Ciao
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Yeah the zak system. That's what I used. I recall it was a bit of a mental teaser as you said.
On Wed, Mar 16, 2011 at 4:23 AM, Andy Farnell padawan12@obiwannabe.co.ukwrote:
And if you're going to use Csound there's the zak system of course. It's a pig to set up and very hard mental work to keep track of which streams have been activated or cleared to avoid clips or feedback... but it works in practice to give any to any dynamic patching so you can have modular synths being gracefully repatched at runtime.
a.
On Tue, 15 Mar 2011 23:29:17 -0500 John Harrison john.harrison@alum.mit.edu wrote:
Not that I am necessarily recommending it but, Csound will allow you to instantiate multiple instances of objects at runtime. I did this with Csound awhile ago and haven't touched Csound since but the general idea was create all your instruments to accept parameters and store input/output connections etc. in tables. You tell Csound to read its score file from stdin and you create/destroy instruments with various parameters by sending to Csound's stdin using the general-purpose computer language of your choice. (I used Python). Hopefully Csound has graduated to allowing instances of instruments to be created through OSC as well as stdin at this point.
-John
Hi,
libpd will make a complete instance of Pd available inside of another application, but it does not deal with instantiating single objects.
libpd does (handle instantiating patches) as of about 2 weeks ago. It maintains the $0 value of the patch as well, so you can send values to unique receivers. You can make as many instances of a patch as you want and control them all separately, on the fly.
This is still only possible with the "usual" mechanism Pd offers, i.e. dynamic patching, and it has the same disadvantages.
Maybe LuaAV would be worth a look, too?
Ciao
Frank Barknecht Do You RjDj.me? _ ______footils.org__
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
See this thread at Pd Everywhere:
http://noisepages.com/groups/pd-everywhere/forum/topic/new-patch-handling-ap...
On Thu, Mar 17, 2011 at 1:17 AM, Rich E rich.eakin@gmail.com wrote:
Hi,
libpd will make a complete instance of Pd available inside of another application, but it does not deal with instantiating single objects.
libpd does (handle instantiating patches) as of about 2 weeks ago. It maintains the $0 value of the patch as well, so you can send values to unique receivers. You can make as many instances of a patch as you want and control them all separately, on the fly.
This is still only possible with the "usual" mechanism Pd offers, i.e. dynamic patching, and it has the same disadvantages.
Maybe LuaAV would be worth a look, too?
Ciao
Frank Barknecht Do You RjDj.me? _ ______footils.org__
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hi,
On Thu, Mar 17, 2011 at 01:17:28AM +1100, Rich E wrote:
libpd will make a complete instance of Pd available inside of another application, but it does not deal with instantiating single objects.
libpd does (handle instantiating patches) as of about 2 weeks ago. It maintains the $0 value of the patch as well, so you can send values to unique receivers. You can make as many instances of a patch as you want and control them all separately, on the fly.
Oh, cool, I wasn't aware of that. Can you tell a bit more about the performance of this approach and how it compares to dynamic patching for dynamic instantiation of objects/patches?
Frank Barknecht Do You RjDj.me? _ ______footils.org__
Oh, cool, I wasn't aware of that. Can you tell a bit more about the performance of this approach and how it compares to dynamic patching for dynamic instantiation of objects/patches?
Ciao
-- Frank Barknecht Do You RjDj.me? _ ______footils.org__
Initial performance is a little faster, as it doesn't take about 1,000 pd objects to open the patch, just a call to glob_evalfile (through whatever wrapper you are using to interface libpd), but that wasn't the main concern. The biggest bonus for me is that you can instantiate the patches in an object-orientated manner (and in an object orientate language like python, java, obj-c, c++, etc), on the fly. Doing this with dynamic patching involved using workarounds (like deleting to contents of a subpatch in order to just delete an embedded patch) which seemed awkward and bug prone. Lastly, the $0 value that libpd recovers lets you send signals or messages to a unique patch, without the need of [namecanvas] - a method that causes a bag full of problems in itself when it comes to dynamic patch loading/unloading.
Dynamic patch loading/unloading (not dynamic patching) could also be done directly in a pd external, provided the following small patch is accepted (: http://sourceforge.net/tracker/?func=detail&aid=3189135&group_id=557...
Cheers, Rich
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
I am just a lowly Pd user, not a dev. How would I use libpd? Does it work just like Pd, but embeddable in other devices? or are we talking lines of code?
thanks
On Sun, Mar 20, 2011 at 2:04 PM, Rich E reakinator@gmail.com wrote:
Oh, cool, I wasn't aware of that. Can you tell a bit more about the performance of this approach and how it compares to dynamic patching for dynamic instantiation of objects/patches?
Ciao
-- Frank Barknecht Do You RjDj.me? _ ______footils.org__
Initial performance is a little faster, as it doesn't take about 1,000 pd objects to open the patch, just a call to glob_evalfile (through whatever wrapper you are using to interface libpd), but that wasn't the main concern. The biggest bonus for me is that you can instantiate the patches in an object-orientated manner (and in an object orientate language like python, java, obj-c, c++, etc), on the fly. Doing this with dynamic patching involved using workarounds (like deleting to contents of a subpatch in order to just delete an embedded patch) which seemed awkward and bug prone. Lastly, the $0 value that libpd recovers lets you send signals or messages to a unique patch, without the need of [namecanvas] - a method that causes a bag full of problems in itself when it comes to dynamic patch loading/unloading.
Dynamic patch loading/unloading (not dynamic patching) could also be done directly in a pd external, provided the following small patch is accepted (:
http://sourceforge.net/tracker/?func=detail&aid=3189135&group_id=557...
Cheers, Rich
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On Sun, 20 Mar 2011, Rich E wrote:
Dynamic patch loading/unloading (not dynamic patching) could also be done directly in a pd external, provided the following small patch is accepted (: http://sourceforge.net/tracker/?func=detail&aid=3189135&group_id=557...
In the meanwhile, a simple workaround is to access the canvas_list global variable and walk the linked list of canvases to figure out what has been added. Sounds like a hack but is much faster than instantiating an object from the linked-list of at least two hundred or thousand names in pd_objectmaker.
Besides, loading a patch with glob_evalfile is not the only way to load a patch. You can also load it through pd_objectmaker by pretending that it is an abstraction. Then you pick up the pointer using pd_newest(). In that case, however, don't bother looking in canvas_list, it's not there.
Once you have a canvas pointer, you can find the $0 easily. It involves using a private interface that you can have by copying a struct definition from pd's source code in the same manner that several externals already use. Right after that, ce_dollarzero is yours.
Lastly, the $0 value that libpd recovers lets you send signals or messages to a unique patch, without the need of [namecanvas] - a method that causes a bag full of problems in itself when it comes to dynamic patch loading/unloading.
I'm not sure I understand. What are the problems with [namecanvas] ?
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC
Thanks for the insight into more pd internals, although I think I prefer an approach that does not heavily rely on public pointers floating around, like pd_newest (it is funny that it is declared in m_pd.h, but then there is a comment above its implementation that it is a hack, maybe be removed or redesigned). I chose to use glob_evalfile because it is the closest method I can find to opening a patch in the 'normal' way. By the way, if I call pd_newest after glob_evalfile(), will it give me a reference to the patch? I'd try it out, but I don't have my dev machine at the moment.
About namecanvas, there were two issues that I found when I had a system for dynamically loading/unloading and linking together patches that contained audio:
Sometimes I wouldn't even get audio out of an object until this happened.
menuclose message was unstable, and would sometimes crash pd.
I didn't ever get to the bottom of these issues, but from what I understand, [namecanvas] doesn't handle deallocation too well. I lost all this code anyway, so the new approach I am using for patch maintainence is through libpd and an object oriented language (objective C at the moment, although I think I would prefer python for running pd on a laptop/desktop). It is just really nice.
Cheers, Rich
On Mon, Mar 21, 2011 at 8:30 AM, Mathieu Bouchard matju@artengine.cawrote:
On Sun, 20 Mar 2011, Rich E wrote:
Dynamic patch loading/unloading (not dynamic patching) could also be done
directly in a pd external, provided the following small patch is accepted (:
http://sourceforge.net/tracker/?func=detail&aid=3189135&group_id=557...
In the meanwhile, a simple workaround is to access the canvas_list global variable and walk the linked list of canvases to figure out what has been added. Sounds like a hack but is much faster than instantiating an object from the linked-list of at least two hundred or thousand names in pd_objectmaker.
Besides, loading a patch with glob_evalfile is not the only way to load a patch. You can also load it through pd_objectmaker by pretending that it is an abstraction. Then you pick up the pointer using pd_newest(). In that case, however, don't bother looking in canvas_list, it's not there.
Once you have a canvas pointer, you can find the $0 easily. It involves using a private interface that you can have by copying a struct definition from pd's source code in the same manner that several externals already use. Right after that, ce_dollarzero is yours.
Lastly, the $0 value that libpd recovers lets you send signals or messages
to a unique patch, without the need of [namecanvas] - a method that causes a bag full of problems in itself when it comes to dynamic patch loading/unloading.
I'm not sure I understand. What are the problems with [namecanvas] ?
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC
On Tue, 22 Mar 2011, Rich E wrote:
Thanks for the insight into more pd internals, although I think I prefer an approach that does not heavily rely on public pointers floating around, like pd_newest
pd_newest is a function returning a pointer, not a pointer itself. that's an easy mistake to do, especially as the return value of it gets almost always cast to a more specific type such as :
t_my_something_tilde *stuff = (t_my_something_tilde *)pd_newest();
(it is funny that it is declared in m_pd.h, but then there is a comment above its implementation that it is a hack, maybe be removed or redesigned).
No, it's not funny. Miller will call "hacks" things that are quite normal to be doing, and then forget about them entirely, and 15 years later, people like you still assume that the comments mean something, even though in the meantime 13 or 42 developers had to call pd_newest() somewhere because it's the only way to do a rather basic thing.
By the way, if I call pd_newest after glob_evalfile(), will it give me a reference to the patch?
From what I know and from what I can read quickly, you wouldn't get it,
you'd get the last object created in the patch, but I didn't try it.
However, canvas_popabstraction does set pd_newest, so you can already use pd_newest() if you pretend that the patch is an abstraction.
About namecanvas, there were two issues that I found when I had a system for dynamically loading/unloading and linking together patches that contained audio: 1) DSP had to be shut off and then turned back on once the linking was done. Sometimes I wouldn't even get audio out of an object until this happened.
Ah ok, this is not the responsibility of [namecanvas], but I know what you mean.
- closing a patch that had audio receivers containing $ variables via
the menuclose message was unstable, and would sometimes crash pd.
I don't see how this could ever happen. Is there a way to make a very small patch that causes that crash to happen ?
I didn't ever get to the bottom of these issues, but from what I understand, [namecanvas] doesn't handle deallocation too well. I lost all this code anyway,
What do you mean you "lost" it ?
so the new approach I am using for patch maintainence is through libpd and an object oriented language (objective C at the moment, although I think I would prefer python for running pd on a laptop/desktop).
So why don't you use libpd's python bindings ?
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC
Well...
Thanks a lot to Jérôme for this long review... (by the way, what about the game you've talked about ?)
So... does anyone has find a proper solution to this ? :
######### 10 - PURE DATA - CREATE AUDIO ABSTRACTIONS
There is a problem when I create an audio abstraction. The sound of the abstraction is not working while other previous audio objects are working. We have to send a mouseup and cut message to simulate mouse activity ! http://abel.jerome.free.fr/newatlantis/AudioDynamicPatching/images/dyn-audio... #########
For info :
With dsp on, I've tried to :
[dsp 1( | [pd-subpatch] // the one containing the audio abstractions dynamically created
The last created abstraction produce sound as wanted. But the previous ones seems to be in a double sample rate or something like that... If I put and cut a box, everything becomes fine...
For now, I use the Jérôme's trick of dynamically put an cut a box. And it works fine in my case.
Cheers.
01ivier
2011/3/22 Mathieu Bouchard matju@artengine.ca
On Tue, 22 Mar 2011, Rich E wrote:
Thanks for the insight into more pd internals, although I think I prefer
an approach that does not heavily rely on public pointers floating around, like pd_newest
pd_newest is a function returning a pointer, not a pointer itself. that's an easy mistake to do, especially as the return value of it gets almost always cast to a more specific type such as :
t_my_something_tilde *stuff = (t_my_something_tilde *)pd_newest();
(it is funny that it is declared in m_pd.h, but then there is a comment
above its implementation that it is a hack, maybe be removed or redesigned).
No, it's not funny. Miller will call "hacks" things that are quite normal to be doing, and then forget about them entirely, and 15 years later, people like you still assume that the comments mean something, even though in the meantime 13 or 42 developers had to call pd_newest() somewhere because it's the only way to do a rather basic thing.
By the way, if I call pd_newest after glob_evalfile(), will it give me
a reference to the patch?
From what I know and from what I can read quickly, you wouldn't get it, you'd get the last object created in the patch, but I didn't try it.
However, canvas_popabstraction does set pd_newest, so you can already use pd_newest() if you pretend that the patch is an abstraction.
About namecanvas, there were two issues that I found when I had a system
for dynamically loading/unloading and linking together patches that contained audio: 1) DSP had to be shut off and then turned back on once the linking was done. Sometimes I wouldn't even get audio out of an object until this happened.
Ah ok, this is not the responsibility of [namecanvas], but I know what you mean.
- closing a patch that had audio receivers containing $ variables via the
menuclose message was unstable, and would sometimes crash pd.
I don't see how this could ever happen. Is there a way to make a very small patch that causes that crash to happen ?
I didn't ever get to the bottom of these issues, but from what I
understand, [namecanvas] doesn't handle deallocation too well. I lost all this code anyway,
What do you mean you "lost" it ?
so the new approach I am using for patch maintainence is through libpd and
an object oriented language (objective C at the moment, although I think I would prefer python for running pd on a laptop/desktop).
So why don't you use libpd's python bindings ?
______________________________**______________________________** ___________ | Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2011-08-18 13:49, Olivier B wrote:
The last created abstraction produce sound as wanted. But the previous ones seems to be in a double sample rate or something like that... If I put and cut a box, everything becomes fine...
???
a) you shouldn't dynamically create abstractions while dsp is running, as it slows down significantly.
b) do [; pd dsp 0; pd dsp 1( right after your creation to fix the dsp-graph
fmasdr IOhannes
2011/8/18 IOhannes m zmoelnig zmoelnig@iem.at
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2011-08-18 13:49, Olivier B wrote:
The last created abstraction produce sound as wanted. But the previous ones seems to be in a double sample rate or something
like
that... If I put and cut a box, everything becomes fine...
???
Try, you'll see... :-p No need dynamic patching for that... Send [dsp 1( to a subpatch playing audio and let it be... ;-)
a) you shouldn't dynamically create abstractions while dsp is running, as it slows down significantly.
b) do [; pd dsp 0; pd dsp 1( right after your creation to fix the dsp-graph
I've tried it as proposed on previous posts but as Jérôme said, it makes click... And as the trick to put and cut box works fine I'm gonna do it in that way.
For curious, I've posted my work here : http://yamatierea.org/papatchs/#quaudriolatere It a sampler control by the corners of a polygon. For no-francophone : Each left-click makes a square and records 2 seconds. Right-clik to move corner. Red corner : level & pan Blue : dry/wet on Y axis Greens : Fx
Cheers.
01ivier
fmasdr IOhannes -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk5NIJsACgkQkX2Xpv6ydvT3/wCdHlcA6bYOPoY4LTvG4ZtvDWMq VHkAoLoLqfTr0dQ9+q9R8wTXou2JENzY =EOPG -----END PGP SIGNATURE-----
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list