hide array name?
@ingox I think this might be system and or locale dependent, I get escapes with 32 160. Plain 160 is probably the safest way to go for portability since it is a non-breaking space in both UTF-8 and Unicode and should work on most system and still work if pd goes unicode. Apprently 194 160 is UTF-8 and not unicode as I had said, but it is the same character as 160 (a non-breaking space). I half suspect that 32 160 is being seen as a double space by pd on some systems and the 32 is dropped as pd tends to drop double spaces leaving you with just the 160s and no escaped 32s, but the other half of me suspects I am overlooking something.
Debugging Externals With Xcode 12
For anyone interested, I was able to figure out how to do it using the original guide for earlier Xcode versions. The mistake I was making was to attach the full package of Pure Data to the debugging scheme as the executable. The correct way of doing it is to link the actual executable file as described below.
In Xcode (this is v 12.3):
- Create a new debugging scheme
- Edit the new scheme:
- In the Executable drop-down menu, select Other...
- Find the executable for pd (e.g. /Applications/Pd-0.51-3.app/Contents/Resources/bin/pd)
The settings for the scheme should look like this (notice the setting for Launch - Automatically)
- Build and run the external. This will start Pd. The actual debugging will begin when you instantiate the external object inside a patch.
In my case, I added a breakpoint inside the bang() method. Upon receiving the bang, the breakpoint is reached:
math.h, float or double?
@morpheu5 the canonical supported pd only uses 32-bit floats in messages (and signals). the question of how to write/format externals that support both floats and doubles is an ongoing discussion afaik. Right now almost everyone uses "normal" pd w/32-bit floats, and externals generally aren't available for pd-double.
most architectures support doubles now, so t_float isn't based on the machine. (but I presume the reason supported pd uses 32-bit floats is so it can run on an abbacus)
However, there's nothing to restrict external developers from using doubles in their externals internally. It's just that when the message/signal goes back into pd it will be 32-bit.
I think functions like fmod are fine to use for both doubles and floats (I wouldn't be surprised if the compiler will just use fmodf instead if the inputs are floats)
But I don't know how far off pd-double is from being supported or used anyways, so right now
I'd say right now you don't need to worry about t_floats or t_samples being doubles at all. No externals support pd double, because I don't think the loading mechanism/convention has been completely fleshed-out yet. (and barely anyone uses pd-double)
pix_video crashes pd
@enaeer Well........ mine has stopped working as well.
In 32-bit Pd/Gem (extended) I cannot get [pix_video] to work at all any more.
So maybe like me you don't have any 32-bit drivers for the camera on your system?
But in 64-bit It will work with [pix_video WMD]..... so set to use Windows media driver.
Setting driver DS just reverts to WMD for my camera.
It will not crash but I only get an image after repeatedly selecting device 0 until it succeeds.
So many programs install codecs and filters..... maybe it searches for the next one and again searches until is stumbles across one that works?
There are tools here...... https://www.nirsoft.net/utils/installed_codec.html that let you see all the 32-bit of 64-bit filters and codecs that you have installed........ and to disable them if necessary.
Clicking [enumerate( in cam.zip will print a message to the console with more information about your camera and a clue about the missing codec/filter.........
Do that before you click "create"....
But on my system it gives different messages for 32 and 64-bit Pd.
David.
Scripting Purr Data - with JavaScript?
Thanks again @lacuna - great to have that thread as reference!
Just tried it for a bit: I cannot seem to find any binary releases in the github, https://github.com/mganss/pdjs (EDIT: found them https://github.com/mganss/pdjs/releases )- so I went along with this:
I don't really understand what this .dek
file is supposed to be, but the page itself says it is a zip file, so I tried this (I use MSYS2 bash
shell in Windows):
$ wget http://puredata.info/Members/mganss/software/pdjs/1.2.63/pdjs%5Bv1.2.63%5D%28Darwin-amd64-32%29%28Linux-amd64-32%29%28Linux-arm64-32%29%28Windows-amd64-32%29.dek/at_download/file -O pdjs_v1.2.63.dek
$ unzip pdjs_v1.2.63.dek
Archive: pdjs_v1.2.63.dek
inflating: pdjs/js.dll
inflating: pdjs/js.l_arm64
inflating: pdjs/js.pd_darwin
inflating: pdjs/js-help.pd
inflating: pdjs/js.pd_linux
inflating: pdjs/js-help.js
nice, now I have a pdjs folder; so I tried copying it to my 32-bit copy of PurrData:
$ mv pdjs /c/bin/PurrData_x86_2.15.2/extra/
$ /c/bin/PurrData_x86_2.15.2/bin/pd.exe -verbose
Here, in an empty patch, I place an object [pdjs/js test.js]
(see also the note in the Github README about declare -path pdjs
); and I get:
...
tried C:\\Program Files (x86)\\Common Files\\Pd-l2ork\\pdjs\\js\\pdjs\\js.pd and failed
tried C:\\bin\\PurrData_x86_2.15.2\\extra\\pdjs\\js.m_i386 and failed
tried C:\\bin\\PurrData_x86_2.15.2\\extra\\pdjs\\js.dll and succeeded
verbose( 1):C:\\bin\\PurrData_x86_2.15.2\\extra\\pdjs\\js.dll: couldn't load
tried C:\\bin\\PurrData_x86_2.15.2\\extra\\pdjs\\js.pd and failed
tried C:\\bin\\PurrData_x86_2.15.2\\extra\\pdjs\\js.pat and failed
tried C:\\bin\\PurrData_x86_2.15.2\\extra\\pdjs\\js\\pdjs\\js.pd and failed
error: couldn't create "pdjs/js test.js"
...
Hmmm... library got found, but is not loaded; then I thought, let's check:
$ file /c/bin/PurrData_x86_2.15.2/bin/pd.exe
/c/bin/PurrData_x86_2.15.2/bin/pd.exe: PE32 executable (GUI) Intel 80386 (stripped to external PDB), for MS Windows
$ file /c/bin/PurrData_x86_2.15.2/extra/pdjs/js.dll
/c/bin/PurrData_x86_2.15.2/extra/pdjs/js.dll: PE32+ executable (DLL) (GUI) x86-64, for MS Windows
Yeah - I cannot load a 64-bit .dll by a 32-bit .exe!
So, apparently, there is no 32-bit build for pdjs
(see "Supported platforms" in the Github README), so I installed the 64-bit build of Purr Data ... and tried it there:
$ cp -a /c/bin/PurrData_x86_2.15.2/extra/pdjs /c/bin/PurrData_x86_64_2.15.2/extra/
$ /c/bin/PurrData_x86_64_2.15.2/bin/pd.exe -verbose
... and finally, could see it working - instantiating [pdjs/js test.js]
gives messages:
...
tried C:\\bin\\PurrData_x86_64_2.15.2\\extra\\pdjs\\js.m_i386 and failed
tried C:\\bin\\PurrData_x86_64_2.15.2\\extra\\pdjs\\js.dll and succeeded
pdjs version 1.2.63 (v8 version 8.6.395.24)
tried C:\\bin\\PurrData_x86_2.15.2\\test.js and failed
tried C:\\Users\\user\\AppData\\Roaming\\Pd-l2ork\\test.js and failed
tried C:\\Program Files\\Common Files\\Pd-l2ork\\test.js and failed
tried C:\\bin\\PurrData_x86_64_2.15.2\\extra\\test.js and failed
error: Script file 'test.js' not found.
... click the link above to track it down, or click the 'Find Last Error' item in the Edit menu.
error: couldn't create "pdjs/js test.js"
One invocation that works for quick test is [pdjs/js pdjs/js-help.js]
, which succeeds - and then you can right-click the object and see the Help.
Finally, note this from the README:
There is no built-in editor like in Max, source files have to be created and edited outside of Pure Data.
Well, this is nice! On to see how to work with this object...
Thanks again for the help!
Kinect and Pure Data connection and head tracking
@Laevatein It looks like the utility was built for use with Pd Extended.
Do you have any "cannot create" messages in the Pd window?
It could be that you need the 32-bit dll for OpenCV as Extended is 32-bit and the SDK is probably 32-bit too. And maybe an older version? But a 32/64 bit mismatch is more likely.
I don't have a Kinect....... so this is guesswork from me...
David.
TUIO client issue with Windows 10.
@zeke1183 The 32-bit client you want to compile receives UDP packets from the ReacTivision server on port 3333 (default) and then changes the list headers to some friendly symbols such as "addCursor" before spitting out the data (I think..... I have misplaced my amoebae....... maybe the headers are the same?).
It is all OSC data so you can receive it like this...... tuio_client.pd
You can send data back to the ReacTivision server with the left inlet of [netreceive].... see its help file.
You then have some work to do if you need to use the other patches that are provided with the 32-bit [tuioclient] ....... translating the headers....... but those other patches are abstractions and should work in your 64-bit Pd.
The data format is unchanged I think.
Have a look at the ReacTivision online documentation to understand the messages. The patch above should be receiving those messages set out in their doc.
Here is the original spec........ TUIO_Documentation.pdf
I remember the Pd [TuioClient] external actually making it much more difficult to analyse the messages from the server...... due to the translated headers...... and headers added to each data part.... such as "xPos".......
David.
((P.S. You are more likely to get instant support using 32-bit extended with [TuioClient]
A browser search engine will find quite a lot......... but it will all be based on the older Pd OSC objects (from MrPeach etc.) and forcing the newer Pd OSC objects to do exactly the same requires much more knowledge of OSC formatting.
You will need some specialized help for every question you ask....... whereas for the 32-bit version probably all the questions were answered years ago.....
You could run Pd-extended just for TUIO...... and run a 64-bit Pd vanilla at the same time for your patches....... communicating between the two using [netsend] and [netreceive]....))
Zexy repack on Mac
Hey,
I've uploaded the Zexy external on the latest version of PD-Vanilla (Pd-0.51-1) on my Mac, (I'm on Catalina) but when I go to add a repack object it still isn't recognised and won't create the object. Any ideas why?
Best
Jess
How to translate crazy one-liner symphonies to Pd
@Jona I think the issue with your method is that the value stays the same over the entire block, so using it to drive a function would only output changed values at the beginning of every block.
you could use your method of adding the samples of a block in conjunction with a [tabreceive~]
reading from a table that contains every integer from 0 to blocksize-1 and that would work though.
(btw I also have an object in my library [pinb~]
that simply outputs the current sample # in the block for situations like this)
also if you do run it at a samplerate of 8000 hz it will take a ~5.5 times longer for rpole~ to not be able to represent than @ 44.1k so in this case it might not be as much of an issue (though obviously a counter that doesn't do that at all is preferable)
of course any method will lose precision between samples, especially if the counter isn't reset to 0 after 2^32 -1 samples (assuming "t" is a 32-bit integer)
in pd-double it would probably be better to use phasor~ with / and *~ to scale phasor to increment 1 every sample, with a period of 2^32 samples. Unfortunately in 32-bit float pd you can only represent up to 24 bits of precision so you can't divide or multiply by 2^32 exactly
Reblocking under the hood
A degenerate case that has probably no utility but that i post for fun.
The [block~ 32 2] (reblocked down overlapped twice)???
Notice that here the letters represents 16 samples (64/4). And since it is always complete at each tick just one of them is required. The result is strange. Each DSP vector is sliced in four pieces, and combined. Is it normal. I don't know? But it can be awesome! For what?
TBH I did that kind of thing only to be sure that i didn't make an error while refactoring Pure Data.
[a b c d] ! [A B - -]
[- C D -]
[- - A B]
[D - - C]
--> [A+D B+C A+D B+C]
// [block~ 32 2]
BLOCK FREQUENCY+4
BLOCK PERIOD+1
INLET SIZE+64
INLET WRITE+64
INLET HOP+64
OUTLET SIZE+64
OUTLET HOP+16
#+0#
P+0/+64
R+0/+32
W+0/+32
R+32/+32
W+16/+32
R+0/+32
W+32/+32
R+32/+32
W+48/+32
E+0/+64
#+1#
...