Cool! [route Darwin] worked but I had to put back the [delay 100] from [logger2] in order to have the [set exec...( update before [t b b b b b] hits the rest.
I noticed that you can actually skip using [netsend] and just go straight into your [list prepend send] ---> [command] part. How would this do performance wise? Is [netsend] more effective than [command] or would it not matter?
Did you ever try using the full path to pdreceive as mentioned above,
Sweet, It works with the full path! I thought I tried it several times, hmm. And no error code. The right "error" outlet does send out
listening on 3000but it works anyhow.
I changed permissions:
chmod a+rwx pdreceivebut still didn't work without full path.
then I did this and noticed the com.apple.quarantine flag:
jnl@nmbp bin % ls -@l pdreceive -rwxrwxrwx@ 1 jnl admin 174048 3 Jul 18:11 pdreceive com.apple.lastuseddate#PS 16 com.apple.quarantine 57 jnl@nmbp bin % xattr -d com.apple.quarantine pdreceive jnl@nmbp bin % ls -@l pdreceive -rwxrwxrwx@ 1 jnl admin 174048 3 Jul 18:11 pdreceive com.apple.lastuseddate#PS 16 jnl@nmbp bin %
The com.apple.quarantine flag is added on downloaded apps by osx, preventing them to run without confirmation.
Removed the flag but it still does not work. I have to read up a bit on osx security. Its close though.
But there could be an Applications directory in root for apps available to all users these days, once again my lack of knowledge regarding modern OSX.
that's how it is structured nowadays yes.
@cfry When you have the help file open you have a tcp receiver in [netreceive-help] that might be receiving your messages.
yes, when deleting the receiver in the help file the connection is refused. Using -u allows netsend to stay open. I was thinking that I should use udp in the end but it could be good if tcp also worked.
send symbol through right inlet to make a new file - ok
use bang before exit - no need to force quit pd
send data through left inlet - not working, except if pdreceive is started from terminal, then it works
it seems that [exec pdreceive 3000(-[command] is never executed. I added print objects to the output of the [command] object and still all that is output is
exit pdreceive: 2
I tried to escape space with \ [exec pdreceive\ 3000(, but same issue.
what does the "2" exit code indicate?
should I use bash instead of zsh?
@oid these are the error messages. I never seen this dialogue before. It happens when I try to quit Pd. I think we should break up this in parts, maybe not do it inside an abstraction. I need to automate creating new logg files in the end anyway so in that case using an abs for naming is not the best solution.
It may be that something has happened with my system: it seems like I can only use [netsend] when having the help window open. I'll look into this as soon as I can.
(A little Swedish dictionary: Fel = Error, Programfel = Program Error)
@oid with the new logger abs [netsend] does not work: pd log:
recv (tcp): Connection refused (61). I can not see the problem because it looks exactly the same as in the help file and there it works. If I keep the help page open it connects (but I still can not write to the text file). I would guess that command has some process still running and is blocking?
Starting pdreceive 3000 from terminal works too. (now globally, I fixed that).
I can create a new file, and I can also write to it by for example sending [exec pwd( to [command] inside logger.pd.
@seb-harmonik.ar yes I have done that now, pdreceive is in the PATH variable. I got the impression that this was taken care of upon installing pd.
But I have not gotten the logger abs working. Some process is started and I have to force quit pd. I understand that you have to treat |command] a bit different than other pd objects.
@oid thanks this is great stuff.
I managed to create a log file and write data to it through your logger.pd abstraction but I had to disable the part that starts pdreceive and start pdreceive from Terminal manually. Obviously pdreceive and many other commands on my system is not working global:
/Applications/Pd-0.53-2.app/Contents/Resources/bin/pdreceive 3000 >> mylogfile.txt
...and that is because something is up with my system/shell.
~ % pdreceive 3000 >> mynewlogfile.txt zsh: command not found: pdreceive
Working on this I use macOS Monterey 12.6.9 and by default zsh(z-shell) is used. I tried to change to using bash but it is the same problem still.
Before I dive into this and try to fix it I would like to ask you
- if your logger.pd abstraction did work on your system
- what os do you use?
- for advice on how to set up my computer in this senario:
I see many uses for me with this setup but the goal at the moment:
is to put this on a raspberry pi and record interaction sessions with an artwork during the day, and optionally process it during the night. It will be open for interaction for a month, not monitored.
But when coding I use my mac. So ideally I want to set up my mac as similar as possible to the raspberry pi having to make as few changes as possible when switching computer.
Any idea on how to fix this without messing up my mac? And where is a good starting point to get some better understanding of shell(s)? So I do not bloat this thread/forum with non-pd questions.
Thank you so much, I really appreciate it.
Thanks, would it be possible to control file naming when using
pdreceivefrom terminal to create a text file? Maybe trigger it from Pd, send a command to terminal? Or have a size or time limit and then auto-create a new file?
I was able to send text back to [qlist] using
catand have it play back again. I will rely on loading complete text files (into [qlist] or whatever), it is good enough. I will filter out repeated messages in the data stream before recording. This will make the files way lighter.
I need to read up on using bash/terminal. This is so smooth.
If I would like to have it streamed back to Pd I think I should write a python script that mimics qlist. But this is not really needed for me at this point.
Just for the record, the raw serial data (not filtered) is formatted like this :
(timestamp milliseconds | device | type of data | multiple sensors data):
10.024 a1 analog 565 565 565 565 565; 0.332 a1 analog 562 544 565 565 565; 6.606 a1 analog 565 565 565 565 565; 0.34 a1 analog 562 544 565 565 565; 12.482 a1 analog 565 565 565 565 565; 0.29 a1 analog 562 544 565 565 565;
@oid this is sweet! I managed to set this up and save a qlist readable file:
No cpu load, pd is stable after 1 hour recording, 18 mb file, all good. Using netsend seems great for recording a session in the background.
In order to make the transition from my [qlist] recorder smooth I figure I should try to be able to use terminal/pdsend to load the text file to [qlist]. How do I use pdsend in Terminal to send the recording5_pd.txt back to pd [qlist]?
jnl@nmbp ~ % /Applications/Pd-0.54-0.app/Contents/Resources/bin/pdsend 3000 >> recording5_pd.txt connected to 127.0.0.1
...I did not seem to get anything out of [netreceive] in Pd.
Is there documentation to be found on this somewhere?
@alexandros I would like to have to option to be able record the raw data so I can redo filtering at a later stage, but in most cases it would be better to filter out repeated messages, yes.
I am experimenting with having Pd detect silence and no interaction and then do offline non-realtime stuff (like saving, or using your neural network lib) at that point. But using [netsend] to save the sensor data at least eliminates the [qlist] save instability issue.
@seb-harmonik.ar [binfile] seems interesting, I may try that one down the line. Thanks!
I have made some experiments with making data recording abstractions using [qlist].
Looks like this:
It works OK but I think there are better ways to do this.
I use it for
- recording and looping on the fly,
- background recording of session and
- along with more advanced processing (neural network is the plan).
The data that I record is often sensor data over serial connection using [comport] with arduinos, but the idea is that you can take any data stream inside Pd and record it.
I use this in my live rig but I also want to include it in installations and have the data being automatically saved to disk, maybe also upload it to cloud on the fly.
One problem is that there is quite a lot of messages coming in when recording the serial data (I use a high baud rate) and when saving the text file the system can get unstable and PD crash at times. Usually the text file is intact though. The text file gets quite large also, I suspect that there could be more suitable file formats. When saving Pd gets locked up too so it is not a realtime solution as it is.
Maybe one should write the data to disk right away instead of having it in a buffer like [qlist]?
Would using [text sequence] be more stable?
So how would you do this?
Thankful for input!
I copy the paths in Finder with alt-right click and paste it into the text object. Its a quick manoeuvre and I got the flexibility of the text object.
Don't guess -- examine the data!
But one key here is that a list in Pd is not "space delimited."
I hear you Thanks for this clear explanation, it helped a lot.
I saw your last post flash by and tried it out, worked fine. As does the version with list-drip.
But! Now I can not load more than 40 something elements. And my list is really close to 200 elements, and may grow.
Is there some kind of limit in the text object?
edit: for this project I am on Mac Pd0.53-2. I probably can find a terminal script to remove special characters, I do that already with blank spaces. Its annoying that OSX name screen recordings with special characters when you set your OS language to something else than English.
-This works but not if using special characters:
[pd stored-list] just contains a blank message box: [(
I understand that for this type of operation should use the text object (maybe it even accepts file names with blank spaces?). However text seems to require semi-colons as separators for a list. I guess that open panel 2 returns a list with return as separators? How could I set this up with text object?
How can I save a list that I have created with [openpanel 2] and [list store]?
...I would like to store this output in the patch upon save.
If I edit the [list store] like this...
[list store /Users/me/my-videos/20230714_171857.mp4
...I get the result I want in the patch but I want to use openpanel 2 instead of copy&paste.
Should I convert the output of [openpanel 2] to a message and then loadbang this message into list store upon load or what? I usually save values in patches by setting messages but something is lost in translation... [list store] does not seem to store anything with the patch.
I have ran pd on a raspberry controlling it with VNC Viewer over wifi quite successfully. Since I keep editing the Pd project I need to have access to the GUI, but I would prefer run it headless on the rpi since that would free up quite a bit of cpu.
Could you run Pd's GUI on one computer (i.e. my laptop) and Pd audio process headless on another (i.e. the RaspberryPi)? That would be so neat.
I solved it by having looped interludes where I could adjust and look at the projection. It worked quite OK. A plus is that I was not distracted by the visuals when performing, so the setup made sense in this way too.
But will try some the methods mentioned here next time I perform with this setup. I really like the OF/Ofelia setup, had almost no crashes or oddities happening and I even wasn't that careful. And CPU pressure was quite low too.
I was not aware that [list store] [insert( [delete( was a newer functions when I made this abs and I need to use it on a Raspberry Pi with custom OS with Pd 0.51.4 installed. Of course it would be better to upgrade Pd but I am not sure it is convenient. I am looking into it.
Any ideas on how I could rewrite this to work with Pd <0.52? I guess I could use prepend instead of insert, but how could I replace delete? If possible.
Is there a sensible way of having the Ofelia window shown both on a full screen projector/monitor and at the same time windowed on my laptop sharing space with Pd-gui controls? Im on Mac for this. I was hoping that osx had some built-in feature for this but I at least have not found it. Thanks.