mrpeach on Raspberry
Hi thanks for your reply, I solved the problem.
I run in Pd 0.47.1 (vanilla) a patch containing [shell] object that I use to launch python script with message
| sudo python dist_continuo_shell.py (
|
[ shell ]
(by the way I was expecting this object to output the value that the python script prints as Alex Drymonitis suggests, but I get no output from the shell object - I guess this is issue for another post).
In the same patch I receive the OSC packets with netreceive. (I WAS FORGETTING TO PUT THE FLAGS -u -b ) like this:
| listen 5000 (
|
[ netreceive -u -b ]
|
[ oscparse ]
The error I got was that he was unable to establish connection. Of course everything becomes clear afterwards, thank you very much for your response anyway and your support in this forum.
Create standalone application
pd extended offered this functionality as a built in feature from what I hear. Unfortunately, pd-extended is a bit dated and no longer maintained... that said, if your patch does not require features from the latest releases of puredata, you could build it in extended and use it's make-app function. If that won't work for you, then making a standalone app from a puredata patch is still possible, but not exactly a simple task. There are actually several ways that you could do this, all of which will likely require some knowledge of coding in other languages like C, java, python etc. If you were looking to make something for mobile devices, there are apps available that can wrap your patch to run in it's own app container type of thing in android and ios. For that, check out pddroidparty, libpd and mobmuplat. If you want to run a patch as a vst type plugin within a DAW, check out pdpulp, chamomile and the one that is i think windows only, pdvst.
If your only need to make a standalone app is to cater to people who are less computer savvy, then I would say that the amount of effort it would take to make a truly standalone app from a pd patch is probably overkill and then some. You could much more easily make a patch that functions somewhat like a standalone app, in that you click an icon and the patch opens up and runs, by creating a launch script. How you would go about doing this would depend on what OS you are using. OSX and linux both run on unix, so a bash script that launches pd and opens the patch with all the desired settings could be written, marked executable (sudo chmod +x <filename>) and assigned an icon. A script could even be made to automate the installation of puredata to go with it.
If you want to be really thorough, you could compile/build a version of puredata from source, making sure all the needed dependencies are contained within the source directory and linked accordingly, and house it in a bundled folder (something like all applications and .kext files on OSX operate,) But once again, this would have some caveats, has it's own learning curve and is generally no simple task for someone who isn't already well versed in these types of things. The easiest thing would probably be to just install pd for your clients manually or via script and make a launch script that they can just click on and have it automatically open pd and the patch of choice.
Hope that helps
Shell object, maybe bugged
Does any command work in the [shell] object that you are using? If you run something simple, like 'ls' or 'pwd' will it output the file list of the directory? If so, then there could likely be a formating issue with the text that you are sending to the object. The way that puredata handles sending certain symbols and characters through messages can sometimes throw a command askew when translating to bash. To make things harder, the front slash that is typically used as an escape symbol to send symbols as literals is not allowed in messages within pd... So if the [shell] object is functional, but your particular command just doesn't seem to want to work properly, then you can try the following:
1 - make use of objects that convert text in messages to and from symbols, like [makesymbol] [cyclone/tosymbol] [cyclone/fromsymbol] [s2l] [l2s] etc.
2 - try sending commands to shell via [text] or [coll].
3- when all else fails, or a script is just too complex or uses many odd characters, open a code editor like kate (or textmate on mac,) and type the code in there. Try running it in a terminal to make sure it works. Save the file, and then in terminal run
sudo chmod +x "/path/to/file/filename"
enter your password and now that file will be marked by the OS as executable. You can call it from the [shell] object by simply sending it the path to the file, or cd <path>; ./<filename>
If your script requires variables that change in pd, like $1 $2, then you can set that up in your script by defining variables and then sending those values as in separate messages. for example, in your code, you could start by defining a variable like
foo=0;
then in pd
[nbx]
|
[foo=$1(
|
[shell]
After you send the change in value to the variable, call the script again and it will output with the updated values.
In sticky situations in shell, this trick has saved the day for me many times. Hope that helps.
how to use serial data sent with header and footer and comma delimiters
@whale-av You can use [coll] or [text] or even [struct] to chart out symbols and their corresponding floats, so when a symbol is received, it spits out the float that goes with it. That is one way to get symbols back to floats without externals... In extended or newer, cyclone has [tosymbol] and [fromsymbol] which are also handy for atom conversions... and [list-drip] may also come in handy for your purposes.
A hackier but useful method that I have successfully used to parse incoming serial data with tricky delimiters is to use the [shell] object. make a script in a separate file that writes the incoming data from the com port to a temporary file and then call that script from the shell object. If the script is not too complex, you can type it in a message right in pd as well. For instance:
|tail -f /tmp/COM3 -n 3(
|
[shell]
|
tof/to_ascii_code
|
iter
Here is a demo of how I did this when I was receiving MIDI from a program which was running in a virtual machine and sending midi data through the virtual comport. comport-midi.pd
Pure data Random endless list of errors?
Currenty outputs no sound?
input channels = 0, output channels = 0
input channels = 0, output channels = 0
tried /Applications/Pd-extended.app/Contents/Resources/extra/libdir/libdir.pd_darwin and succeeded
tried /Applications/Pd-extended.app/Contents/Resources/extra/vanilla/list.pd_darwin and succeeded
tried ./extra.pd_darwin and failed
tried /System/Library/Fonts/extra.pd_darwin and failed
tried /Library/Fonts/extra.pd_darwin and failed
tried /Users/joelnash/Library/Fonts/extra.pd_darwin and failed
tried /usr/X11R6/lib/X11/fonts/TTF/extra.pd_darwin and failed
tried /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/fonts/extra.pd_darwin and failed
tried /Users/joelnash/Library/Pd/extra.pd_darwin and failed
tried /Library/Pd/extra.pd_darwin and failed
tried /Applications/Pd-extended.app/Contents/Resources/Scripts/../extra/extra.pd_darwin and failed
tried ./extra/extra.pd_darwin and failed
tried /System/Library/Fonts/extra/extra.pd_darwin and failed
tried /Library/Fonts/extra/extra.pd_darwin and failed
tried /Users/joelnash/Library/Fonts/extra/extra.pd_darwin and failed
tried /usr/X11R6/lib/X11/fonts/TTF/extra/extra.pd_darwin and failed
tried /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/fonts/extra/extra.pd_darwin and failed
tried /Users/joelnash/Library/Pd/extra/extra.pd_darwin and failed
tried /Library/Pd/extra/extra.pd_darwin and failed
tried /Applications/Pd-extended.app/Contents/Resources/Scripts/../extra/extra/extra.pd_darwin and failed
tried ./extra/extra-meta.pd and failed
tried /System/Library/Fonts/extra/extra-meta.pd and failed
tried /Library/Fonts/extra/extra-meta.pd and failed
tried /Users/joelnash/Library/Fonts/extra/extra-meta.pd and failed
tried /usr/X11R6/lib/X11/fonts/TTF/extra/extra-meta.pd and failed
tried /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/fonts/extra/extra-meta.pd and failed
tried /Users/joelnash/Library/Pd/extra/extra-meta.pd and failed
tried /Library/Pd/extra/extra-meta.pd and failed
tried /Applications/Pd-extended.app/Contents/Resources/Scripts/../extra/extra/extra-meta.pd and succeeded
tried ./pdlua.pd_darwin and failed
tried /System/Library/Fonts/pdlua.pd_darwin and failed
tried /Library/Fonts/pdlua.pd_darwin and failed
tried /Users/joelnash/Library/Fonts/pdlua.pd_darwin and failed
tried /usr/X11R6/lib/X11/fonts/TTF/pdlua.pd_darwin and failed
tried /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/fonts/pdlua.pd_darwin and failed
tried /Applications/Pd-extended.app/Contents/Resources/Scripts/../extra/extra/pdlua.pd_darwin and failed
tried /Users/joelnash/Library/Pd/pdlua.pd_darwin and failed
tried /Library/Pd/pdlua.pd_darwin and failed
tried /Applications/Pd-extended.app/Contents/Resources/Scripts/../extra/pdlua.pd_darwin and failed
tried ./pdlua/pdlua.pd_darwin and failed
tried /System/Library/Fonts/pdlua/pdlua.pd_darwin and failed
tried /Library/Fonts/pdlua/pdlua.pd_darwin and failed
tried /Users/joelnash/Library/Fonts/pdlua/pdlua.pd_darwin and failed
tried /usr/X11R6/lib/X11/fonts/TTF/pdlua/pdlua.pd_darwin and failed
tried /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/fonts/pdlua/pdlua.pd_darwin and failed
tried /Applications/Pd-extended.app/Contents/Resources/Scripts/../extra/extra/pdlua/pdlua.pd_darwin and failed
tried /Users/joelnash/Library/Pd/pdlua/pdlua.pd_darwin and failed
tried /Library/Pd/pdlua/pdlua.pd_darwin and failed
tried /Applications/Pd-extended.app/Contents/Resources/Scripts/../extra/pdlua/pdlua.pd_darwin and succeeded
tried ./tclpd.pd_darwin and failed
tried /System/Library/Fonts/tclpd.pd_darwin and failed
tried /Library/Fonts/tclpd.pd_darwin and failed
tried /Users/joelnash/Library/Fonts/tclpd.pd_darwin and failed
tried /usr/X11R6/lib/X11/fonts/TTF/tclpd.pd_darwin and failed
tried /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/fonts/tclpd.pd_darwin and failed
tried /Applications/Pd-extended.app/Contents/Resources/Scripts/../extra/extra/tclpd.pd_darwin and failed
tried /Users/joelnash/Library/Pd/tclpd.pd_darwin and failed
tried /Library/Pd/tclpd.pd_darwin and failed
tried /Applications/Pd-extended.app/Contents/Resources/Scripts/../extra/tclpd.pd_darwin and failed
tried ./tclpd/tclpd.pd_darwin and failed
tried /System/Library/Fonts/tclpd/tclpd.pd_darwin and failed
tried /Library/Fonts/tclpd/tclpd.pd_darwin and failed
tried /Users/joelnash/Library/Fonts/tclpd/tclpd.pd_darwin and failed
tried /usr/X11R6/lib/X11/fonts/TTF/tclpd/tclpd.pd_darwin and failed
tried /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/fonts/tclpd/tclpd.pd_darwin and
Audio Ideas (AI) Collection (placeholder, currently only links)-effects, controllers, mmp, etc.
Audio Ideas (AI) Collection (placeholder) currently only links
per @LiamG 's kind suggestion I have begun the process of consolidating my abs and patches, etc. into a single location/zip file or for possible upload to github.
Just to get the ball/me rolling and scope the work I got the links for my shares into a single location to later be consolidated into the single AI Collection.
For now at least, please, bare with me (and the links below) as ideas I am more passionate about currently are demanding my attention. (Which funnily enough will probably also be included in the set, where ever they are shared.)
Thanks, for your patience and all you do for the Pure Data Family.
Sincerely,
Scott
abstract~
pushdelay-envelope-env-driven-delay-line-with-both-delay-time-and-feedback-dependent
numpad-abstraction-for-entry-of-large-numbers-via-click-instead-of-sliders-includes-basic-calculator
abs_delay_fbw-feedbackwards-lifo-last-in-first-out-delay
abs_sequences_by_formula-sequences-by-formula-abstraction-ex-collatz
abs_effects_router-60-effects-in-one-abstraction-router-from-diy2-stamp-album-my-abs
visualcontrolsurface-vsl-values-set-by-their-location-on-the-screen-req-ggee-shell
abs_4-8-14_way_toggle-pair-2-toggles-resulting-in-4-8-or-14-states
audioflow-delay-to-forward-backward-looper-using-speed-control
5-band-equalizer-with-bezier-controller-eq5_mey_w_bezier_sv-pd-updated-to-8-band-below
forward-backward-looper-orig-abs-from-residuum-whale-av
abs_rgb2hex-rgb-0-255-colors-to-hexadecimal-values
pseudo-12-string-effect-6-string-guitar-to-sound-like-a-12-string
jack_midi2pd_2sys_connector_sv-jack-midi_out-to-pd-sys_playback-switcher
abs_4to16pads_bin_conv_sv-convert-4-midi-pads-from-a-binary-value-to-a-decimal-for-rerouting
abs_automatedslider_sv-automated-control-changer-pd-and-mobmuplat-editor-versions
idea-for-effects-stack-ing-technique-control-mother
micin-_abs-abstraction-convert-signal-to-notein-ex-using-a-midi-synth-as-a-guitar-pedal
curve_abs-tri-way-curve-switch-to-change-control-values-in-either-linearly-convex-or-concave-manner
a-preset-control-abstraction-for-saving-parameters-presets-to-text-files
4-tap-delay-with-pitch-shifter-per-delay-line-adaptation-of-diy2-patches
patch~
extra
the-15-owl-faust-patches-compiled-as-32bit-linux-externals-attached
libpd
mmponboardeditortemplate-mmp-for-creation-of-mobmuplat-files-directly-on-the-handheld-android-only
3d-synth-webpd-tree-js-webgl_camera_cinematic-html-example
Off topic
Using serially connected [route] to parse strings
For those of you who like pain, or know way more about this object than i do: the following works GREAT in the real shell yet in the [shell] object, due to its limitations (or mine :---) (as I know them) for instance not being able to take ";" it will not work in pd.
(I had thought i could just pass the string to the script and it would take it as a variable to parse)
So if you choose to pursue this, do please, post back. I must move on to other things.
str="34 102 111 118 34 58 57 48 44 34 105 100 34 58 34 107 101 100 34 44 34 112 105 116 99 104 34 58 45 49 46 49 51 49 56 53 53 54 48 55 48 51 50 55 55 53 57 44 34 112 111 115 105 116 105 111 110 34 58 49 50 53 50 56 57 44 34 114 111 108 108 34 58 48 44 34 115 116 97 116 101 34 58 50 44 34 117 114 108 34 58 34 102 105 108 101 58 47 47 47 85 115 101 114 115 47 108 97 112 116 111 112 111 108 105 115 116 47 68 101 115 107 116 111 112 47 86 101 103 97 115 46 109 112 52 34 44 34 121 97 119 34 58 45 50 46 51 49 51 57 50 55 49 55 51 54 49 52 53 48 50"
echo "$str" | awk '{ for(i=1;i<=NF;i++) printf("%c",$i); print ""; }' ```
fyi: I tried creating a script and just pass it to the script but that failed due to how it wants to pass/absorb its $-variables.```
Insert Code Here
jack_midi2pd_2sys_connector_sv: (Jack) Midi_out to pd|sys_playback switcher
Mark this one up as: Creative Ways to Use the [Shell] Object
jack_midi2pd_2sys_connector-help_sv.pd
jack_midi2pd_2sys_connector_sv.pd
{image of code at the bottom of this post}
Synopsis:
By clicking "init" then selecting your left- and right- ins and outs, you can then switch between your midi (or for that matter any jack-in) out-ing to pd_in or system_playback. So from one perspective it is a jack-bypass/router.
Copy from the help file:
This abs is designed to empower the user to switch (in a sense a sort of jack router/bypass) between having a connection, in my case, the virtual midi synthesizer "amsynth", running into pd_in to instead running into system:playback.;
The benefit is that (using the shell object + jack_lsp) the rerouting is done in a single click (which certainly gets one to thinking).
The two inlets are init which writes a file to /tmp which it then reads to populate the connector names and the other inlet is the switch itself.
Steps:
start jack and any and all apps you may want to run through the abs;
then click "init" this writes two files, one for ins and the other for outs;
select from the radios (which populate the symbols on the right);
and
then you can switch between the two connections using the vradio on the top-right.
Note: if you are using QJackCtl or other jack-guis you may need to refresh the connection page to ee the result. -svanya
#end help file
As I say, more than anything (since my system just points to shell scripts to do this), I just wanted to show some novel/powerful things we can do with the [shell] object.
Perhaps, you may find a use for it (or its ideas).
Happy pd-ing
-svanya
p.s. feel obliged to add: in my case, I am using this with my latest and current project (a mobmuplat front-end to go on the body of my guitar (for me to use as I play) which will allow me to run my guitar pedals, a looper, amsynth and all of its controls, as well as the audio-bus controlling the mixing of all of those) to reroute my synth to and from going thru my pedal-rack. So in one case its just a synth ("amsynth" to be exact) and in the other case it is a synth-running-thru-my-pedal-rack.
abs_4to16pads_bin_conv_sv: convert 4 (midi) pads from a binary value to a decimal (for rerouting)
Background:
Last week I made the (what I now know as "life-altering") commitment to buy (and did) my first usb+midi keyboard controller, a Samson Graphite M25. I have since set up my shop (since given my tools+configuration I could not use the Graphite Preset Editor and because everything works better if you get pd involved :---)) to run the kb into pd then into amsynth via jack, using pd as the midi interface: kb>pd>amsynth>out.
In the process, one thing I did was upgrade the 32 "pre", preset button knobs, to 120, using the ideas included in this abstraction: convert the 4 pads and their binary-ness into decimals, so I can then tell pd to make the knobs, 8x15, instead of 8x4 (the default PRE pad count), see below for clarification...
Requirement(s): Linux and shell external (though I am pretty sure a version using the "until" object is do-able, I did not find one and know the shell waaayyy better than until or even metro.
Synopsis: by pushing on various combinations of pads (could actually be any set of cc(?)'s) the resulting binary number is turned into a decimal which can then be used to re-route or set a different control, ex. PROG.
(from the _help file comments):
Purpose: convert binary values to decimals in order to simplify and expand the rerouting from one control to another, ex. from POLTYTOUCH to PROG.
The left inlet takes a routing/control value,;
ex. note/polytouch control, etc.;
the middle inlet takes the value from that control;
and the right inlet takes a bang to trigger/get/output;
the decimal equivalent.
4pad/trigger to 16 pad/trigger binary-to-decimal converter;
the patch converts the pressing of multiple pads;
to a binary number then to a decimal so that;
for ex. a 4 pad control can send signals from 1-15.
the "shell" external is required;
and the shell script, named:bin2dec_pd, is;
also required. It includes only a single line, echo "$((2#$1))".
FYI: in the polytouch instance, the control is looking for;
127 as a trigger value, so the pads must be pushed Completely down.
I DO believe a metro or until version;
of this is also possible but the shell was more expedient.;
-svanya
Copying files to another folder
Why do you want to "cd" to somewhere? Is it a directory with a script? If so, then all you need to do is this:
[sh /path/to/script/your_script.sh(
|
[shell]
This will execute "your_script.sh" which is in "/path/to/script". With [shell] you need to provide an absolute path. I guess "cd" works, but it looks to me that every command is some sort of a new shell, so after you "cd" to somewhere, the next thing will start from scratch, or something like this.