or at least getting something from stdout does not work anymore. (everything is fine in older versions (0.51 and below).
example: the shell help-patch "getting the date".
it receives a bang from the right outlet, but nothing from the left outlet. ggee is version 0.28, but it happend with an older version (and current pd) as well. i wonder if this affects other externals too...
bis denn! martin
Try [command] found in deken. It's a replacement for [shell], if I'm not mistaken.
On 26/1/22 11:21, martin brinkmann wrote:
or at least getting something from stdout does not work anymore. (everything is fine in older versions (0.51 and below).
example: the shell help-patch "getting the date".
it receives a bang from the right outlet, but nothing from the left outlet. ggee is version 0.28, but it happend with an older version (and current pd) as well. i wonder if this affects other externals too...
bis denn! martin
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
On 1/26/22 10:21, martin brinkmann wrote:
or at least getting something from stdout does not work anymore. (everything is fine in older versions (0.51 and below).
example: the shell help-patch "getting the date".
it receives a bang from the right outlet, but nothing from the left outlet. ggee is version 0.28, but it happend with an older version (and current pd) as well. i wonder if this affects other externals too...
i cannot reproduce this with:
ggee-0.28 switched from system()
to execve()
to actually run the
commands with [shell], which might well be the culprit here...
fdmsatg IOhannes
¹ that reminds me that i obviously missed ggee-0.28, so there are no newer Debian packages available...
Hi
On Wed, 2022-01-26 at 10:21 +0100, martin brinkmann wrote:
or at least getting something from stdout does not work anymore. (everything is fine in older versions (0.51 and below).
example: the shell help-patch "getting the date".
it receives a bang from the right outlet, but nothing from the left outlet.
I cannot reproduce with ggee 0.28 from Deken with Pd 0.52-1 from git on Ubuntu 20.04. What OS are you using?
ggee is version 0.28, but it happend with an older version (and current pd) as well. i wonder if this affects other externals too...
As Alexandros already pointed out, there is also [command] which was specifically developed to overcome a few short-comings of [shell]. If it is about a new project, I'd recommend to use it instead of [shell]. Personally, I'm inclined to put effort rather into [command] than into [shell], since the latter has some limitations which cannot be addressed without breaking backwards compatibility. Then again, it would be nice if it could be kept working for existing patches using it.
Roman
On 26/01/2022 15:03, Roman Haefeli wrote:
example: the shell help-patch "getting the date".
it receives a bang from the right outlet, but nothing from the left outlet.
I cannot reproduce with ggee 0.28 from Deken with Pd 0.52-1 from git on Ubuntu 20.04. What OS are you using?
i am using 0.52.1 on xubuntu 20.04.3. it is strange that it seems to work elsewhere, though, iir the first time i tested after upgrading to 0.52 it seemed to work. but maybe i do not remember right...
ggee is version 0.28, but it happend with an older version (and current pd) as well.
it is about a new project, I'd recommend to use it instead of [shell].
thanks, i'll do that. i used [shell] basically for getting a random-seed (and filenames) via date, and it affects only a few patches, and should be easy to change to [command].
bis denn! martin
On 1/27/22 10:10, martin brinkmann wrote:
thanks, i'll do that. i used [shell] basically for getting a random-seed (and filenames) via date, and it affects only a few patches, and should be easy to change to [command].
if you need to read the date, you probably should use zexy's [date] (resp [time]). it works on all platforms, and is *much* faster than a call to an external program.
if you want to generate a seed for your random number, you can use the new built in [file] to read some bytes from /dev/random (from your usage use [shell] together with date, i figure you already use a unix-like system). the randomness should be much better than just using some date-based thingy.
mfgadr IOhannes
On 27/01/2022 10:33, IOhannes m zmoelnig wrote:
On 1/27/22 10:10, martin brinkmann wrote:
thanks, i'll do that. i used [shell] basically for getting a random-seed (and filenames) via date, and it affects only a few patches,
if you need to read the date, you probably should use zexy's [date] (resp [time]). it works on all platforms, and is *much* faster than a call to an external program.
i need the date-as-a-filename and seeding [random] only when the patch is loaded, or when a file is saved, so speed does not matter much. platform independence would be nice though, and a 'vanilla'-solution even nicer...
if you want to generate a seed for your random number, you can use the new built in [file] to read some bytes from /dev/random (from your usage use [shell] together with date, i figure you already use a unix-like system).
yes. and i'll try that.
the randomness should be much better than just using some date-based thingy.
and better randomness would be great. [random] feels a bit more like a random walk, it looks like it tends to repeat recent values. (i might be mistaken, i tend to see patterns in noise...)
bis denn! martin
On 27/01/2022 23:05, IOhannes m zmölnig wrote:
On 1/27/22 20:06, martin brinkmann wrote:
i need the date-as-a-filename
but concatenating a bunch of numbers into a symbol is not exactly rocket science,even in Pd.
yes, and that was what i did.
but without a date (and withouth a unique random number as a fallback (shell not working)) my old soundfiles are replaced when a new one is recorded, which is not exactly what i want.
On 1/28/22 08:23, martin brinkmann wrote:
On 27/01/2022 23:05, IOhannes m zmölnig wrote:
On 1/27/22 20:06, martin brinkmann wrote:
i need the date-as-a-filename
but concatenating a bunch of numbers into a symbol is not exactly rocket science,even in Pd.
yes, and that was what i did.
but without a date (and withouth a unique random number as a fallback (shell not working)) my old soundfiles are replaced when a new one is recorded, which is not exactly what i want.
so that's when you use zexy's [date].
i was under the impression, that you simply dismissed zexy's [date] because you "need the date-as-a-filename". on re-reading i see that i was wrong. sorry.
instead you wrote:
so speed does not matter much. platform independence would be nice though, and a 'vanilla'-solution even nicer...
it's of course always nicer to be vanilla only. i suggested zexy mainly because you were *already* using an external (leaving aside that zexy is my library and somebody else's :-))
the thing with ggee is, that it practically has been unmaintained for 15 years or so. zexy otoh is still actively maintained (i consider it stable so there is not much new development going into it; but bugs are fixed regularly - if they are reported)
but if you do want a vanilla solution for setting initial values, i'd go the other way round: create a script that invokes Pd, providing whatever unique values you need. something like:
#!/bin/sh
timestamp=$(date +%Y%m%d-%H%M)
pd -send "timestamp ${timestamp}" -open mypatch.pd
and in the patch you need something like this for filename generation
|
[t b] [r timestampe]
| |
| [symbol]
| |
[symbol XXX]
|
[symbol sound-$1.wav(
|
mgfds IOhannes
On 28/01/2022 08:53, IOhannes m zmölnig wrote:
it's of course always nicer to be vanilla only. i suggested zexy mainly because you were *already* using an external
that is true, though i try to use as few externals as possible, and i had already to use something to invoke commands. i have switched to [command] and it works fine (except for numeric values being converted to floats and coming out of the left outlet (!?), but adding a (non numeric) character to the output helped.)
but if you do want a vanilla solution for setting initial values, i'd go the other way round: create a script that invokes Pd, providing whatever unique values you need.
that is a good idea! maybe i'll add some system info to my pd-startup script. though i have to think of some kind of fallback, in case pd is not invoked from this script...
bis denn! martin
On Sun, 2022-01-30 at 18:59 +0100, martin brinkmann wrote:
i have switched to [command] and it works fine (except for numeric values being converted to floats and coming out of the left outlet (!?), but adding a (non numeric) character to the output helped.)
[command] parses stdout and stderr of the command as a FUDI message. Numeric values are returned as floats, symbolic values as symbols and leading, trailing, or multiple spaces (or tabs) are discarded. I _think_ quite a few objects interfacing the outside world behave like this, so I assume it is kind of a standard.
If you want to preserve the exact output, use the binary format invoked with the -b flag [command -b]. This returns the results as list of bytes. You could use [list tosymbol] to convert the whole thing to a single symbol. If you want more sophisticated parsing, you can do it, though it probably takes a little effort.
Roman
On 30/01/2022 21:43, Roman Haefeli wrote:
If you want to preserve the exact output, use the binary format invoked with the -b flag [command -b]. This returns the results as list of bytes. You could use [list tosymbol] to convert the whole thing to a single symbol.
i have tried this (and used list/tosymbol before with filenames as numeric characters), and it works. but the problem is, that
exec date +%S%M%H%m%d
(my randomseed which looks like 3401210201 for example)
apparently prepends a parsed numeric value to LS_EXIT (first) outlet of [command]).
the output is something like print: 5.70921e+09 print: 0 and nothing at the middle (and right) outlet.
with any character (non numeric) added to the date string, everything woks as expected.
bis denn! martin
On Tue, 2022-02-01 at 21:17 +0100, martin brinkmann wrote:
On 30/01/2022 21:43, Roman Haefeli wrote:
If you want to preserve the exact output, use the binary format invoked with the -b flag [command -b]. This returns the results as list of bytes. You could use [list tosymbol] to convert the whole thing to a single symbol.
i have tried this (and used list/tosymbol before with filenames as numeric characters), and it works. but the problem is, that
exec date +%S%M%H%m%d
(my randomseed which looks like 3401210201 for example)
apparently prepends a parsed numeric value to LS_EXIT (first) outlet of [command]).
I'm confused. The left outlet of [command] outputs the exit code of the command, not the stdout of it. The middle inlet is supposed to output the stdout of the command.
the output is something like print: 5.70921e+09 print: 0 and nothing at the middle (and right) outlet.
As I tried to explain previously, this is expected behavior in Pd land. If you want to preserve the exact output, use the -b flag and convert the result to a symbol with [list tosymbol]:
[exec date +%S%M%H%m%d( | [command] | <- middle outlet [list tosymbol] | [print]
Gives me: symbol 4416220201
Note: If your [command] outputs stdout on the left, then you're using a unreleased beta version of [command] that probably even hasn't the -b flag implemented. However, only the released version v0.1 is available through Deken.
Roman
On 01/02/2022 22:25, Roman Haefeli wrote:
As I tried to explain previously, this is expected behavior in Pd land.
yes, but the float is coming out of the leftmost output, and this only happens when the commands output is a number (and only a number).
"exec echo 123456789" for example, while "exec echo number123456789" works
adding a string, and afterwards splitting it off is a workaround.
Note: If your [command] outputs stdout on the left, then you're using a unreleased beta version of [command] that probably even hasn't the -b
-b works fine. (and is also a (the probably better) workaround.
flag implemented. However, only the released version v0.1 is available through Deken.
i use
commandv0.1.dek Uploaded by rdz @ 2021-10-01 22:20:51
installed via deken a few days ago
bis denn! martin
On 2/2/22 09:04, martin brinkmann wrote:
On 01/02/2022 22:25, Roman Haefeli wrote:
As I tried to explain previously, this is expected behavior in Pd land.
yes, but the float is coming out of the leftmost output, and this only happens when the commands output is a number (and only a number).
"exec echo 123456789" for example, while "exec echo number123456789" works
well, this is just how FUDI works.
and Pd will not show you the *exact* number, but "print" it using %g to make it more visually pleasant.
(I'm not going into details; this has been discussed in the past. more than once; check the archives if you are interested).
so:
and is thus converted to one.
not be *exactly* "123456789" (since this number cannot be represented by a 32bit floating point number). instead it will be stored as 123456792.0f
as "1.23457e+08". the same string-conversion happens if you use $arg expansion (e.g. "[open mysound.$1.wav(").
you can use your own conversion if you send the number to [makefilename]. e.g. [makefilename mysound.%d.wav] will give you the integer part of the full number (but it's still a 32bit floating point number, so you won't get "123456789")
adding a string, and afterwards splitting it off is a workaround.
this is of course very ugly. Pd is not exactly good at string manipulation.
better use zexy's [date] and [time], create a list of the values you are interested in and then do a piecewise assembly:
[12 34 56 79 90] | [open mysound.$1$2$3$4$5.wav(
flag implemented. However, only the released version v0.1 is available through Deken.
i use
commandv0.1.dek Uploaded by rdz @ 2021-10-01 22:20:51
installed via deken a few days ago
i just like to confirm that the version available via deken will indeed output single number printout on the 1st outlet.
https://github.com/pd-externals/command/issues/9
dgnfsa+ IOhannes
On Wed, 2022-02-02 at 12:06 +0100, IOhannes m zmoelnig wrote:
On 2/2/22 09:04, martin brinkmann wrote:
i just like to confirm that the version available via deken will indeed output single number printout on the 1st outlet.
Thanks, Martin, for finding that bug and thanks, IOhannes, for creating an issue.
Roman
On 02/02/2022 13:04, Roman Haefeli wrote:
On Wed, 2022-02-02 at 12:06 +0100, IOhannes m zmoelnig wrote:
Thanks, Martin, for finding that bug
and thanks for fixing it, and i'm looking forward to the new version.
and thanks, IOhannes, for creating
an issue.
sorry, i should have done this myself, but i was not entirely sure whether this was a bug or i was doing something wrong...
bis denn! martin
On Thu, 2022-02-03 at 13:36 +0100, martin brinkmann wrote:
sorry, i should have done this myself, but i was not entirely sure whether this was a bug or i was doing something wrong...
No need to be sorry. More important is that you actually discovered the bug.
Roman
On Wed, 2022-02-02 at 12:06 +0100, IOhannes m zmoelnig wrote:
On 2/2/22 09:04, martin brinkmann wrote:
i just like to confirm that the version available via deken will indeed output single number printout on the 1st outlet.
IOhannes already fixed the problem (whose solution also fixed another issue). I created a 0.2 release. It should be available on Deken soon.
Roman