Part of the idea of a libdir is to also include examples. Currently, this is done using an 'examples' subfolder. The problem with that is the example patches won't automatically find the objects from the libdir that they are embedded in. So I'm wondering what the best way to handle this is. Here are a couple ideas:
- require [declare -path ..] for all example patches (works on any branch of Pd)
- instead of 'examples' folder, use mypatch-example.pd in the main dir of the libdir (works without extra tricks)
- use [import mylib] for all example patches (works even when the example patch is saved elsewhere)
Another idea would be to have Pd automatically add ".." to the path when you open an example folder.
.hc
----------------------------------------------------------------------------
I spent 33 years and four months in active military service and during that period I spent most of my time as a high class muscle man for Big Business, for Wall Street and the bankers. - General Smedley Butler
On Sat, 2010-04-10 at 13:25 -0400, Hans-Christoph Steiner wrote:
Part of the idea of a libdir is to also include examples. Currently, this is done using an 'examples' subfolder. The problem with that is the example patches won't automatically find the objects from the libdir that they are embedded in. So I'm wondering what the best way to handle this is. Here are a couple ideas:
- require [declare -path ..] for all example patches (works on any
branch of Pd)
- instead of 'examples' folder, use mypatch-example.pd in the main dir
of the libdir (works without extra tricks)
- use [import mylib] for all example patches (works even when the
example patch is saved elsewhere)
- use [declare -stdpath extra/mylib] for all example patches (works on any branch of Pd and works even when the example patch is saved elsewhere)
Another idea would be to have Pd automatically add ".." to the path when you open an example folder.
.hc
On Sat, Apr 10, 2010 at 11:01:22PM +0200, Roman Haefeli wrote:
On Sat, 2010-04-10 at 13:25 -0400, Hans-Christoph Steiner wrote:
Part of the idea of a libdir is to also include examples. Currently, this is done using an 'examples' subfolder. The problem with that is the example patches won't automatically find the objects from the libdir that they are embedded in. So I'm wondering what the best way to handle this is. Here are a couple ideas:
- require [declare -path ..] for all example patches (works on any
branch of Pd)
- instead of 'examples' folder, use mypatch-example.pd in the main dir
of the libdir (works without extra tricks)
- use [import mylib] for all example patches (works even when the
example patch is saved elsewhere)
- use [declare -stdpath extra/mylib] for all example patches (works on
any branch of Pd and works even when the example patch is saved elsewhere)
I think, this doesn't work if "mylib" isn't installed or isn't installed in "extra".
Ciao
On Mon, 2010-04-12 at 09:33 +0200, Frank Barknecht wrote:
On Sat, Apr 10, 2010 at 11:01:22PM +0200, Roman Haefeli wrote:
On Sat, 2010-04-10 at 13:25 -0400, Hans-Christoph Steiner wrote:
Part of the idea of a libdir is to also include examples. Currently, this is done using an 'examples' subfolder. The problem with that is the example patches won't automatically find the objects from the libdir that they are embedded in. So I'm wondering what the best way to handle this is. Here are a couple ideas:
- require [declare -path ..] for all example patches (works on any
branch of Pd)
- instead of 'examples' folder, use mypatch-example.pd in the main dir
of the libdir (works without extra tricks)
- use [import mylib] for all example patches (works even when the
example patch is saved elsewhere)
- use [declare -stdpath extra/mylib] for all example patches (works on
any branch of Pd and works even when the example patch is saved elsewhere)
I think, this doesn't work if "mylib" isn't installed or isn't installed in "extra".
True. But since we're talking about example patches _coming with_ certain libraries, I think it does make sense to assume that the original library is installed, and installed in "extra". Or am I missing something here?
Roman
On Apr 12, 2010, at 3:43 AM, Roman Haefeli wrote:
On Mon, 2010-04-12 at 09:33 +0200, Frank Barknecht wrote:
On Sat, Apr 10, 2010 at 11:01:22PM +0200, Roman Haefeli wrote:
On Sat, 2010-04-10 at 13:25 -0400, Hans-Christoph Steiner wrote:
Part of the idea of a libdir is to also include examples. Currently, this is done using an 'examples' subfolder. The problem with that is the example patches won't automatically find the objects from the libdir that they are embedded in. So I'm wondering what the best way to handle this is. Here are a couple ideas:
- require [declare -path ..] for all example patches (works on any
branch of Pd)
- instead of 'examples' folder, use mypatch-example.pd in the
main dir of the libdir (works without extra tricks)
- use [import mylib] for all example patches (works even when the
example patch is saved elsewhere)
- use [declare -stdpath extra/mylib] for all example patches
(works on any branch of Pd and works even when the example patch is saved elsewhere)
I think, this doesn't work if "mylib" isn't installed or isn't installed in "extra".
True. But since we're talking about example patches _coming with_ certain libraries, I think it does make sense to assume that the original library is installed, and installed in "extra". Or am I missing something here?
Yeah, [declare -stdpath extra/mylib] requires the library to be in the 'extra' folder. [declare -path ..] will work anywhere that library is, but won't work if the example is saved outside of the library folder.
Also, stdpath will add the library to the global path, right? That seems like a bad idea. That could change the objects that other patches get without any real warning. It needs to be something that only applies to that particular patch.
.hc
----------------------------------------------------------------------------
Computer science is no more related to the computer than astronomy is related to the telescope. -Edsger Dykstra
On Mon, 2010-04-12 at 11:32 -0400, Hans-Christoph Steiner wrote:
On Apr 12, 2010, at 3:43 AM, Roman Haefeli wrote:
On Mon, 2010-04-12 at 09:33 +0200, Frank Barknecht wrote:
On Sat, Apr 10, 2010 at 11:01:22PM +0200, Roman Haefeli wrote:
On Sat, 2010-04-10 at 13:25 -0400, Hans-Christoph Steiner wrote:
Part of the idea of a libdir is to also include examples. Currently, this is done using an 'examples' subfolder. The problem with that is the example patches won't automatically find the objects from the libdir that they are embedded in. So I'm wondering what the best way to handle this is. Here are a couple ideas:
- require [declare -path ..] for all example patches (works on any
branch of Pd)
- instead of 'examples' folder, use mypatch-example.pd in the
main dir of the libdir (works without extra tricks)
- use [import mylib] for all example patches (works even when the
example patch is saved elsewhere)
- use [declare -stdpath extra/mylib] for all example patches
(works on any branch of Pd and works even when the example patch is saved elsewhere)
I think, this doesn't work if "mylib" isn't installed or isn't installed in "extra".
True. But since we're talking about example patches _coming with_ certain libraries, I think it does make sense to assume that the original library is installed, and installed in "extra". Or am I missing something here?
Yeah, [declare -stdpath extra/mylib] requires the library to be in the 'extra' folder.
Isn't that the point of this exercise? Do we want the freedom to put the example files wherever we want or are we looking for the freedom to put the library wherever we want? I was assuming the former, since usually you have the library installed at a fixed install location.
[declare -path ..] will work anywhere that library is, but won't work if the example is saved outside of the library folder.
Exactly.
Also, stdpath will add the library to the global path, right?
No, it only affects the patch with the [declare] inside. At least on 0.42.5 vanilla. When loading binary externals, they're added the global path (which is the same for all mechanisms).
Roman
On Apr 12, 2010, at 11:59 AM, Roman Haefeli wrote:
On Mon, 2010-04-12 at 11:32 -0400, Hans-Christoph Steiner wrote:
On Apr 12, 2010, at 3:43 AM, Roman Haefeli wrote:
On Mon, 2010-04-12 at 09:33 +0200, Frank Barknecht wrote:
On Sat, Apr 10, 2010 at 11:01:22PM +0200, Roman Haefeli wrote:
On Sat, 2010-04-10 at 13:25 -0400, Hans-Christoph Steiner wrote:
Part of the idea of a libdir is to also include examples. Currently, this is done using an 'examples' subfolder. The problem with that is the example patches won't automatically find the objects from the libdir that they are embedded in. So I'm wondering what the best way to handle this is. Here are a couple ideas:
- require [declare -path ..] for all example patches (works on
any branch of Pd)
- instead of 'examples' folder, use mypatch-example.pd in the
main dir of the libdir (works without extra tricks)
- use [import mylib] for all example patches (works even when the
example patch is saved elsewhere)
- use [declare -stdpath extra/mylib] for all example patches
(works on any branch of Pd and works even when the example patch is saved elsewhere)
I think, this doesn't work if "mylib" isn't installed or isn't installed in "extra".
True. But since we're talking about example patches _coming with_ certain libraries, I think it does make sense to assume that the original library is installed, and installed in "extra". Or am I missing something here?
Yeah, [declare -stdpath extra/mylib] requires the library to be in the 'extra' folder.
Isn't that the point of this exercise? Do we want the freedom to put the example files wherever we want or are we looking for the freedom to put the library wherever we want? I was assuming the former, since usually you have the library installed at a fixed install location.
There needs to be a user-installed folder for libraries. "extra" is not a user-installable location unless you are installing Pd yourself from source.
[declare -path ..] will work anywhere that library is, but won't work if the example is saved outside of the library folder.
Exactly.
Also, stdpath will add the library to the global path, right?
No, it only affects the patch with the [declare] inside. At least on 0.42.5 vanilla. When loading binary externals, they're added the global path (which is the same for all mechanisms).
Ah right, my mistake. That demonstrates one reason why I avoid [declare] and made [import]. I can never remember what [declare]'s options mean. :-)
.hc
----------------------------------------------------------------------------
The arc of history bends towards justice. - Dr. Martin Luther King, Jr.
On Mon, 2010-04-12 at 15:51 -0400, Hans-Christoph Steiner wrote:
That demonstrates one reason why I avoid [declare] and made [import]. I can never remember what [declare]'s options mean. :-)
You made [import] before miller made [declare]. That might rather be the reason for you to prefer [import]. However, I prefer [declare], since it's built-in.
Roman