Artists using Pure Data
@snowball: I should probably clarify what I mean about gui and functionality. When I said there are few instances when the gui is very important to the functionality, I was referring to the fancier gui elements. I actually do believe in many cases the gui is important to the functionality. It is important when it gives you the proper visual feedback to help the user understand what's going on. In most cases, sliders, knob, number boxes, etc. present you with all you need. You don't always need interactive waveform displays or filter curves; and you aren't likely to need adjustable rounded corners, elaborate color schemes, gradients, and segmented patch cords. Now, to be honest, I am kind of a sucker for cool guis, and spent time doing "hacks" with what Pd provides to make them do things they weren't intended to do. But I have always gotten what I needed.
To give you an example of something that I felt needed a nice gui, here is a video presentation of my final project in college:
The idea was to use a Photoshop-based interface that most of us are in some way familiar with and do sound design with it. I did this in Max because I didn't think GEM had what I needed to do it (I've just recently looked at GridFlow, however, and I think it may have the missing pieces I was after). pd123's comment about Jitter similarly reflects my experience with this project. While it has the nice objects I wanted to use, it also had some irritating bugs that were hard to pin down. As a result, this project was, and still is, unfinished.
When it comes to "more advanced" things like [poly~] and [pfft~], this is one of the big differences between Max and Pd-vanilla. Max offers quite a bit more higher level objects, which make it easier for new users as they don't have to try and patch those things ([freqshift~], [gizmo~], and [stutter~] are a few others that come to mind). BUT, Pd offers what you need to patch most, if not all, of those yourself using the objects it does have. And, Pd-extended includes many externals and abstractions that clone Max objects. [nqpoly4], for example, is a [poly~] clone made with Pd objects. I haven't done much FFT in Pd, but as far as I can tell, [pfft~] is essentially like putting Pd's FFT objects in a subpatch and adjusting the blocksize with [block~]. I don't believe Max lets you adjust the blocksize per subpatch, so [pfft~] is a workaround for that.
Don't get me wrong, I don't think these high level objects are a bad idea. I use Pd-extended, after all .
Namecanvas to create and connect objects?
sum~? and the outlet you create is a not an audio object. but besides this, if you want to connect the single catch~ objects to an individual outlet~ you have to find an algorithm, but yeah it's possible. "connect" finds objects by the order they were created, zero based.
you may want to have a look at this: http://puredata.hurleur.com/sujet-2953-winds-doom-soundscape-generator
in this soundgenerator, you can change the number of voices, what means, the single voice abstractions get created and deleted dynamical.
maybe you find some help in there.
just for your example:
#N canvas 527 79 1024 728 10;
#X obj 62 407 namecanvas thing;
#X obj 206 213 makefilename channel%d;
#X obj 161 252 pack f s;
#X obj 161 212 * 100;
#X msg 161 291 \; thing obj \$1 50 catch~ \$2 \; thing obj \$1 90 outlet~
\;;
#X obj 134 154 t f f f;
#X obj 32 241 pack;
#X obj 38 180 t f f;
#X msg 32 348 \; thing connect \$1 0 \$2 0 \;;
#X floatatom 132 108 5 0 0 0 - - -;
#X obj 32 211 + 12;
#X obj 62 211 + 13;
#X connect 1 0 2 1;
#X connect 2 0 4 0;
#X connect 3 0 2 0;
#X connect 5 0 7 0;
#X connect 5 1 3 0;
#X connect 5 2 1 0;
#X connect 6 0 8 0;
#X connect 7 0 10 0;
#X connect 7 1 11 0;
#X connect 9 0 5 0;
#X connect 10 0 6 0;
#X connect 11 0 6 1;
this works like this: you have to count all objects that exist in the patch before any object is created dynamically (also atom boxes and message boxes). in this case these are 12, but you have to count them zero based, so there are 11, starting with object number 0. the 2 objects you want to create dynamical are consequently object number 12 and number 13. by adding 12 and 13 in the structure on the left side to connect message as arguments i tell the canvas to connect these two objects (always from outlet 0 (the first outlet) to inlet 0 (the first inlet)). but caution: this only works, if you start with 0 and increase step by step. if you e.g. start with 1, the structure will add 12 respectivly 13 to 1 from the number box. so it trys to connect object 13 to 14. but object 14 still does not exist...
if you accidently create 2 objects twice, it will not work too. and it would be good to add a feature to delete object pairs if you decrease the number again. so this is just a starting point, there's much work left for you!
Please Help ! I can't get \[matrix~\]/ \[mtx~\] from anywhere!
Hi, I am in the eleventh hour of a project, that is supposed to debut in two days. A friend and myself are using puredata to build a home-brew reactable. The problem is I need to be able to route and re-route in real time, the audio signals from a collection of objects. essentially, I need to be able to route the output from one object into the input of any other object which may be on the board. routing is controlled by a set of abstractions that detect the proximity of each object to the others, and determine whether or not a link is created. I have installed the latest version of Pd-extended, to no avail. Neither the matrix~ or mtx~ can be created. I have looked everywhere for the files matrix~.pd_darwin and mtx~.pd_darwin. They are nowhere on my system. I checked Hans's site, the pure data portal, and goto10's website; as well as everything that google has to offer, with no luck. Does any one know where I can get a working copy of this object? From what I can tell it seems like there had been some kind of mixup between objects with the same name in a whole bunch of different libraries; creb, cyclone, iemlib etc. I am desperate to get a working copy of these objects, or even source code which I could compile; I can find neither of these anywhere. I am running OS 10.4 on a Mac PowerPC, but The final patch will need to run on an intel-Mac as well. Any and all help and suggestions are appreciated.
Conversion from signal to numbers Or how to calculate phase of signal
In Max/MSP, there are objects cartopol~ (cartesian to polar) and poltocar~
(polar to cartesian). The first object take imaginary and real parts of
FFT and give its polar values (amplitude and phase), whereas the second
object takes amplitude and phase , and convert it back to real and
imaginary. for details see
"http://www.cycling74.com/story/2006/11/2/113327/823".
I searched these objects in pd, there is one object
named cpole~, but this object does not clearly states that it produces
amplitude and phase, as MAx/MSP object says.
and also pd does not have inverse of (polar to cartesian).
so any idea, of these two MAX/MSP objects in pure data.
>>There is a signal domain [atan~] unit. Can't remember what library it's in though, >>have a search for it.
thanks. I try to search it.
Problem compiling external on Windows
Hey,
thanks to everyone who responded to my posts both here and in the mailing list. Since then, I've figured out how to compile externals written in C using Microsoft Visual C++ 2005. There's more to document, however, such as how to compile externals using some of the other Windows compilers (Borland, djgpp, etc.), and also how to compile externals written in C++ in Windows. But one thing at a time.
one little thing to note... steps 4 and 7 may seem a little roundabout, but they account for the fact that MSVC sometimes has trouble with spaces in directory names (eg. C://Program Files/). If anyone knows how to override this behavior, post a reply, and I'll try to simplify the steps accordingly.
Updated June 29, 2007:
use [b]C://Progra~1/[/b] instead of [b]C://Program Files/[/b],
use [b]C://Docume~1/[/b] instead of [b]C://Documents and Settings/[/b], etc.
So, without further ado...
How to compile a pd external written in C using Microsoft Visual C++ 2005:
Compared to Windows, linux offers a much more user-friendly environment for compiling pd externals. However, with a little patience, a usable environment can be set up in Windows, and the good news is that everything you need is available for free. There are several reputable Windows-compatible C/C++ compilers out there, but here I'll discuss compiling externals with Microsoft Visual C++ 2005 (MSVC for short).
1. Download and Install Microsoft Visual C++ 2005 Express Edition.
a. Click the link above, then click Go! in the Visual C++ box.
b. Run vcsetup.exe to install the program
(the setup wizard should guide you through the process).
2. Download [url=http://download.microsoft.com/download/7/7/3/7737290f-98e8-45bf-9075-85cc6ae34bf1/VS80sp1-KB9267
]Visual C++ 2005 Express Service Pack 1.
a. Click the link above to download the Service Pack.
b. Run VS80sp1-KB926748-X86-INTL.exe to install the program.
3. Create a new project:
a. Open Visual C++.
b. Open the New Project window (Ctrl+Shift+N).
c. In the Project Types pane, select Visual C++.
d. In the Templates pane, select emptyproj.
e. Enter object name (helloworld).
f. Leave Create directory for solution unchecked, and click OK.
4. Import the pd header file:
a. Get m_pd.h here, or, using pd-vanilla (not pd-extended):
1. Open Windows Explorer or My Computer.
2. Navigate to the pd/src/ directory on your system.
3. Open m_pd.h in a text editor (file type is: C/C++ header).
b. Select all (Ctrl+A).
c. Copy selection to the clipboard (Ctrl+C).
d. Back in Visual C++, open the New File window (Ctrl+N).
e. In the Categories pane, select General.
f. In the Templates pane, select Text File, and click Open.
g. Copy the contents of m_pd.h into the editor window (Ctrl+V).
h. Open the Save File As Window (Ctrl+S).
i. Save as m_pd.h.
j. From the File Menu, select Move m_pd.h into; select helloworld.
5. Write the source code for the external in C.
a. Open the New File window (Ctrl+N).
b. In the Categories pane, select General.
c. In the Templates pane, select Text File, and click Open.
d. Write your source code in the editor window.
The following example is taken from the tutorial by Johannes M. Zmoelnig.
#include "m_pd.h"
static t_class *helloworld_class;
typedef struct _helloworld {
t_object x_obj;
} t_helloworld;
void helloworld_bang(t_helloworld *x)
{
post("Hello world !!");
}
void *helloworld_new(void)
{
t_helloworld *x = (t_helloworld *)pd_new(helloworld_class);
return (void *)x;
}
void helloworld_setup(void) {
helloworld_class = class_new(gensym("helloworld"),
(t_newmethod)helloworld_new,
0, sizeof(t_helloworld),
CLASS_DEFAULT, 0);
class_addbang(helloworld_class, helloworld_bang);
}
6. Save and import the source code into the project:
a. Open the Save File As Window (Ctrl+S).
b. Save as helloworld.c.
c. From the File Menu, select Move helloworld.c into; select helloworld.
7. Access the pd library file:
a. Open Windows Explorer or My Computer.
b. Navigate to the pd/bin/ directory on your system.
c. Right-click on pd.lib (file type is: Object File Library) and select Copy.
d. Navigate to the C://TEMP/ directory on your system.
e. Paste the copy of pd.lib in the C://TEMP/ directory (right-click or Ctrl-V).
8. Set configuration properties:
a. Set configuration type to .dll:
1. Back in Visual C++, open the helloworld Property Pages window (Alt+F7).
2. In the left pane, select Configuration Properties >> General.
3. In the right pane, under Project Defaults, click on
Configuration Type, and select Dynamic Library (.dll)
(using the arrow on the right).
b. Add MSW to preprocessor definitions:
1. In the left pane, select
Configuration Properties >> C/C++ >> Preprocessor.
2. In the right pane, type MSW in the Preprocessor Definitions field.
c. Tell compiler which language to use:
1. In the left pane, select
Configuration Properties >> C/C++ >> Advanced.
2. In the right pane, select Compile As.
3. Select Compile as C Code (/TC) by clicking the arrow on the right.
d. Tell linker where to find pd.lib:
1. In the left pane, select Configuration Properties >> Linker >> Input.
2. In the right pane, select Additional Dependencies and enter
C://TEMP/pd.lib.
e. Tell linker to export the setup function:
1. In the left pane, select
Configuration Properties >> Linker >> Command Line.
2. In the right pane, type
/export:helloworld_setup in the Additional options field.
3. Click OK.
9. Compile and link:
a. Use the Build Solution command (F7).
10. Copy the new helloworld.dll file into pd.
a. Open Windows Explorer or My Computer.
b. Navigate to the
My Documents/Visual Studio 2005/Projects/helloworld/Debug/
directory on your system.
c. Right-click on helloworld.dll (file type is: Application Extension)
and select Copy.
d. Navigate to the pd/extra directory on your system.
e. Paste the copy of helloworld.dll in the pd/extra directory
(right-click or Ctrl-V).
11. Test the external in pd.
a. the external should now be a useable object in pd.
b. open a new pd patch and try to create a helloworld object.
c. add a bang to the left inlet and test it out.
d. if the main pd console window displays "Hello world !!",
the external has succeeded.
Hope this helps!
-- middlepedal
Framenumber to timecode conversion
Hello,
please excuse my stupidity both in programming and generally in understanding PD. i've been trying to figure a way to convert a frame number (received with OSC) to a timecode but the code i tried to adapt from a matlab script by Malcolm A. MacIver that i found here http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=1116&objectType=File
involves some for...loop and i dont know how to do the same in PD... can anyone explain, please?
i guess the field part of the smpte timcode (and other bits of information) are usually not needed, for most people HH:MM:SS:FF Information will be ok... maybe with an adjustable framerate between 30 (ntsc) and 25 (pal)
greetings,
till
function smpte = dec2smpte(init, framecount, field)
% convert the smpte time from the total elapsed frames and field as an integer
% to the new smpte time
first_field=init(9);
weight=[1080000 108000 18000 1800 300 30 10 1];
ns=[];
remain=framecount;
for i=1:8
ns(i)=floor(remain/weight(i));
remain=remain- (ns(i)*weight(i));
end
if strcmp(first_field,':')
second_field='.';
else
second_field=':';
end
if field==1
field_flag=first_field;
else
field_flag=second_field;
end
smpte=[ ...
num2str(ns(1)) num2str(ns(2)) ':' ...
num2str(ns(3)) num2str(ns(4)) ':' ...
num2str(ns(5)) num2str(ns(6)) field_flag ...
num2str(ns(7)) num2str(ns(8))];
different approach here
function itc (int "framecount", float "rate", bool "ms")
{
rate=default(rate,25)
ms = default(ms, false)
drop = (rate==29.97)? true : false
rate2 = (drop==true)? 30 : rate
hours=floor((framecount/rate)/3600)%60
mins=floor((framecount/rate)/60.0)%60
secs=floor(framecount/rate)%60
milli=floor(1000*framecount/rate)%6000%1000
fmilli=framecount/rate - floor(framecount/rate)
#frames=floor(fmilli*rate2)
frames=framecount%int(rate)
dframes = (drop==false)? frames : (secs==0)&&(mins%10!=0)? floor(fmilli*rate2) + 2 : frames
return (ms==false)? (string(hours,"%02.0f")+":"+string(mins,"%02.0f")+":"+string(secs,"%02.0f")+":"+string(frames,"%02.0f")) :
\ (string(hours,"%02.0f")+":"+string(mins,"%02.0f")+":"+string(secs,"%02.0f")+":"+string(milli,"%03.0f"))
}
Lemur with OSCx
Anyone have a rough idea for a patch to send and receive integers and floats to+from a lemur and pd (Jazzmutant Lemur). The one I've got functions with Max/MSP, successful results.
If rig specifications help,
The port I chose for the lemur to utilize with Max/MSP was 8000.
It seems the dumpOSC object has issues with the argument 8000. The object won't create. Additionally, though the oscx seems to have loaded, the prepend send object with arguments /box/led also does not manifest itself and the _help-40h.pd patch and OSCplumbing subpatch seem to offer resolutions to using OSC though I don't know exactly the manner. I've replaced their ports with 8000, nothine at all is printing, though the lemur has been operating properly with Max/msP all the while.
For those familiar with Max/MSP, the code to write a patch receiving lemur messages is: (and all below are objects, no messages, no duplications of objects, if listed twice, then it is same object)
"udpreceive 8000" , outlet connected with "zl nth 1" left inlet, "zl nth 1" 's left outlet to "prepend send" inlet. "zl nth 1" 's right outlet, however was connected with "zl reg" 's right inlet. "prend send" 's left outlet connected with "t b s" 's left inlet. "t b s" 's left outlet connected with "zl reg" 's left inlet. "t b s" 's right outlet connected with "forward" 's left inlet, "zl reg" 's left oulet connected with "forward" 's left inlet.
For udpsend, objects look like "/nameoflemurobject.value $1" with left inlet coming from float. left outlet goes to "udpsend (then ip adress) (then port number)"
With a request of any more information, I'll reply. If anything else comes to mind, I'll submit asap. If you desire patcher files for the above listed code, i'll attach it immediately. Ok.
Pd and max/msp/jitter
Puredata is free open source software, Max costs money.
Puredata is more flexible and extensive than Max because it is maintained and
supported by a community who use it.
There are more freely available examples, patches, tutorials and documentation for Puredata than Max.
Max data can be imported into Puredata with Cyclone, but afaik the converse is not possible.
In many cases Max MSP has prettier GUI components, but depending on your point of view these can also be seen as fluff and cruft.
I consider Pd the "grown ups version of Max"
Since I don't use Max because I can't afford it (Cycling74 refused to offer me a complementary version in return for writing them tutorials) there may be advantages to Max I have no idea about.
The downside is what is typical of most free software, installation and configuration is more difficult.
So basically if you are prepared to do a little thinking and don't need a shrink wrapped spoon feed, it does more than Max, better, for free.
Play a sample
there seems to be something called [table16] that can read large soundfiles, but it still seems to be the in development stage.
for the moment, the only thing i can suggest is to cut your 20 minute file into 20 x 60 second segments,
and then use something like this:
#N canvas 0 22 751 443 10;
#X obj 114 16 table 0-Right;
#X obj 15 16 table 0-Left;
#X obj 114 36 table 1-Right;
#X obj 15 36 table 1-Left;
#X obj 114 56 table 2-Right;
#X obj 15 56 table 2-Left;
#X obj 114 76 table 3-Right;
#X obj 15 76 table 3-Left;
#X obj 114 96 table 4-Right;
#X obj 15 96 table 4-Left;
#X obj 114 116 table 5-Right;
#X obj 15 116 table 5-Left;
#X obj 114 136 table 6-Right;
#X obj 15 136 table 6-Left;
#X obj 114 156 table 7-Right;
#X obj 15 156 table 7-Left;
#X obj 114 176 table 8-Right;
#X obj 15 176 table 8-Left;
#X obj 114 196 table 9-Right;
#X obj 15 196 table 9-Left;
#X obj 114 216 table 10-Right;
#X obj 15 216 table 10-Left;
#X obj 114 236 table 11-Right;
#X obj 15 236 table 11-Left;
#X obj 114 256 table 12-Right;
#X obj 15 256 table 12-Left;
#X obj 114 276 table 13-Right;
#X obj 15 276 table 13-Left;
#X obj 114 296 table 14-Right;
#X obj 15 296 table 14-Left;
#X obj 114 316 table 15-Right;
#X obj 15 316 table 15-Left;
#X obj 114 336 table 16-Right;
#X obj 15 336 table 16-Left;
#X obj 114 356 table 17-Right;
#X obj 15 356 table 17-Left;
#X obj 114 376 table 18-Right;
#X obj 15 376 table 18-Left;
#X obj 114 396 table 19-Right;
#X obj 15 396 table 19-Left;
#X obj 296 179 soundfiler;
#X msg 296 155 read -resize /AUDIO/$1.wav \$1-Left \$1-Right;
#X obj 296 99 until;
#X obj 296 126 f;
#X obj 322 126 + 1;
#X obj 300 57 t b b;
#X msg 298 80 20;
#X msg 341 99 0;
#X msg 300 34 load audio files;
#X floatatom 298 255 5 0 0 0 - - -;
#X obj 315 278 / 60;
#X obj 316 308 int;
#X floatatom 317 339 5 0 0 0 - - -;
#X msg 314 359 set \$1-Left;
#X obj 296 391 tabread4~;
#X text 340 255 Playing position (seconds);
#X connect 41 0 40 0;
#X connect 42 0 43 0;
#X connect 43 0 44 0;
#X connect 43 0 41 0;
#X connect 44 0 43 1;
#X connect 45 0 46 0;
#X connect 45 1 47 0;
#X connect 46 0 42 0;
#X connect 47 0 43 1;
#X connect 48 0 45 0;
#X connect 49 0 50 0;
#X connect 50 0 51 0;
#X connect 51 0 52 0;
#X connect 52 0 53 0;
#X connect 53 0 54 0;
Trigon
Doesn't work:
../onoff/switch bo
... couldn't create
../onoff/switch po
... couldn't create
../onoff/switch jo
... couldn't create
../onoff/switch so
... couldn't create
../onoff/switch mo
... couldn't create
mix 19 0 12 0 (text->hip~) connection failed
mix 19 1 13 0 (text->hip~) connection failed
mix 20 0 12 0 (text->hip~) connection failed
mix 20 1 13 0 (text->hip~) connection failed
mix 21 0 12 0 (text->hip~) connection failed
mix 21 1 13 0 (text->hip~) connection failed
mix 22 0 12 0 (text->hip~) connection failed
mix 22 1 13 0 (text->hip~) connection failed
mix 23 0 33 1 (*~->text) connection failed
mix 24 0 33 0 (*~->text) connection failed
mix 25 0 19 0 (*~->text) connection failed
mix 26 0 19 1 (*~->text) connection failed
mix 27 0 20 0 (*~->text) connection failed
mix 28 0 20 1 (*~->text) connection failed
mix 29 0 21 0 (*~->text) connection failed
mix 30 0 21 1 (*~->text) connection failed
mix 31 0 22 0 (*~->text) connection failed
mix 32 0 22 1 (*~->text) connection failed
mix 33 0 12 0 (text->hip~) connection failed
mix 33 1 13 0 (text->hip~) connection failed