Calculation Frame Size --\> Latency issues
Hi everybody,
I use PD as part of my PhD project. Since audio/haptic asynchronity is an issue I have to keep latency down. My test subjects have to press buttons and virutally instantly hear the sound they triggered. The sounds are stored in arrays and played back using tabplay~
I have just checked the delay between the press of a button and the resulting sound. The buttons are connected to my computer using a custom microcontroller board which is quite common at my university and send the trigger command to a PD comport object. The baud rate is set to 230400 bps and only one byte is needed as command. Latency of the entire button-microcontroller-serial output should be way below 1 ms.
For sound output I use a Lexicon Lambda USB interface at 96000 kHz and 5 ms latency.
When I monitor the delay between physical trigger and output I get latency times ranging from just under 10 ms to over 25 ms. More annoyingly, this latency is not stable but but changes every time I trigger.
Since my "hardware" latency should be just over 5 ms and PD adds up to 20 ms to this I assume PD interally processes things at a certain framerate which should be arround 50 Hz or 20 ms. Is it possible to increase this framerate in any way?
The system runs on Ubuntu Studio 8.04, it would be possible to switch another audio interface (RME Hammerfall).
Any ideas are greatly appreciated.
Alex
How do I get dumpOSC, sendOSC and outher Opens Sound objects to work?
I think I have the same problem, on the Mac OSX 10.5.2. I downloaded the source tarball off sourceforge (0.39-3), went to the oscx directory, did ./configure with no problem I noticed, and then make. With make I got this output:
June -d, 2008 @ 01:39:42AM: ~/Documents/projects/boogiepants/Pd-0.39.3-extended/externals/OSCx
[jstoner@erzulie]> make
cd libOSC && make
cc -c -g -O2 -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O3 -I../libOSC -I../../pd/src -I../../../pd/src -I../src -I../libOSC -I../../pd/src -I../../../pd/src -I../src OSC-client.c
OSC-client.c: In function ‘CheckTypeTag’:
OSC-client.c:341: warning: implicit declaration of function ‘printf’
OSC-client.c:341: warning: incompatible implicit declaration of built-in function ‘printf’
ar srv libOSC.a OSC-client.o
ar: creating archive libOSC.a
a - OSC-client.o
rm -f OSC-client.o
cc -c -g -O2 -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O3 -I../libOSC -I../../pd/src -I../../../pd/src -I../src -I../libOSC -I../../pd/src -I../../../pd/src -I../src OSC-timetag.c
ar srv libOSC.a OSC-timetag.o
a - OSC-timetag.o
rm -f OSC-timetag.o
cd src && make
cc -g -O2 -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O3 -I../libOSC -I../../pd/src -I../../../pd/src -I../src -I../libOSC -I../../pd/src -I../../../pd/src -I../src -c -o sendOSC.o sendOSC.c
cc -g -O2 -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O3 -I../libOSC -I../../pd/src -I../../../pd/src -I../src -I../libOSC -I../../pd/src -I../../../pd/src -I../src -c -o htmsocket.o htmsocket.c
cc -g -O2 -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O3 -I../libOSC -I../../pd/src -I../../../pd/src -I../src -I../libOSC -I../../pd/src -I../../../pd/src -I../src -c -o OSC-system-dependent.o OSC-system-dependent.c
OSC-system-dependent.c: In function ‘fatal_error’:
OSC-system-dependent.c:65: warning: implicit declaration of function ‘exit’
OSC-system-dependent.c:65: warning: incompatible implicit declaration of built-in function ‘exit’
cc -bundle -bundle_loader ../../../pd/bin/pd -flat_namespace -o sendOSC.pd_darwin sendOSC.o htmsocket.o OSC-system-dependent.o -lc -lm ../libOSC/libOSC.a
ld: file not found: ../../../pd/bin/pd
collect2: ld returned 1 exit status
make[1]: *** [sendOSC.pd_darwin] Error 1
make: *** [all] Error 2
any ideas?
Gridflow compile ubuntu hardy
I'm trying to compile Gridflow on Ubuntu 8.04 Hardy on a Pentium4 laptop.
Has any one succesfully comiled on ubuntu?
I have been able to get so far using the synaptic package manager to find most missing things, (when I do it again on my desktop I'll write down all the packages I needed and post it here for others) but I am stuck on a couple for things that I can't find info on in the forum. I have PD-extended which I installed using the deb installer.
When I run ./configure I get
This is the GridFlow 0.9.2 configurator
[gcc3] GNU C++ Compiler 3 (or 4): --------------------------------------------> found
[stl] C++ Standard Template Library: -----------------------------------------> found
[gcc64] GNU C++ in 64-bit mode: ----------------------------------------------> missing (runtime error)
[pentium] Pentium-compatible CPU: --------------------------------------------> found
[mmx] MMX-compatible CPU (using NASM): ---------------------------------------> missing (return false)
[x11] X11 Display Protocol: --------------------------------------------------> found
[x11_shm] X11 acceleration by shared memory (XSHM plugin): -------------------> found
[sdl] Simple Directmedia Layer (experimental support): -----------------------> found
[objcpp] GNU/Apple ObjectiveC++ Compiler: ------------------------------------> missing (where is objc/Object.h ?)
[quartz] Apple Quartz/Cocoa Display: -----------------------------------------> disabled (would need objcpp)
[aalib] Ascii Art Library: ---------------------------------------------------> found
[netpbm] NetPBM 10 Library: --------------------------------------------------> found
[jpeg] JPEG Library: ---------------------------------------------------------> found
[png] PNG Library <libpng12/png.h>: ------------------------------------------> found
[videodev] Video4linux Digitizer Driver Interface: ---------------------------> found
[mpeg3] HeroineWarrior LibMPEG3 <libmpeg3/libmpeg3.h>: -----------------------> found
[quicktimeapple] Apple's QuickTime: ------------------------------------------> missing (gcc compilation error)
[quicktimehw] Plaum's LibQuickTime (try #1) <lqt/quicktime.h>: ---------------> missing (gcc compilation error)
[quicktimehw] Plaum's LibQuickTime (try #1) <quicktime/quicktime.h>: ---------> missing (where is quicktime/quicktime.h ?)
[quicktimehw] Plaum's LibQuickTime (try #2) <lqt/quicktime.h>: ---------------> missing (gcc compilation error)
[quicktimehw] Plaum's LibQuickTime (try #2) <quicktime/quicktime.h>: ---------> missing (where is quicktime/quicktime.h ?)
[puredata] PureData (or DesireData): -----------------------------------------> found
[desiredata] DesireData: -----------------------------------------------------> missing (gcc: error: 'gobj_subscribe' was not declared in this scope)
[gem09] PureData GEM (source code) with m_holdname: --------------------------> missing (gcc: error: 'm_holdname' is not a member of 'CPPExtern')
[gem08] PureData GEM (source code) without m_holdname: -----------------------> missing (gcc compilation error)
[opencv] Intel OpenCV: -------------------------------------------------------> missing (gcc compilation error)
[fftw] FFTW (Fastest Fourier Transform in the West): -------------------------> found
What I can't figure out is:
I have a Pentium 4 with mmx, I have installed NASM and I found a package called intel2gas but it didn't help. No idea what to try next.
I have a quicktime.h in /usr/include/lqt so not sure why it doesn't find it. I haven't edited the configure file and the INCLUDE_PATH is already set to /usr/include.
Where do I need to put the gem source files? I downloaded the gem files and I have the src folder with all the source files in it...
Whats the benefit of getting openCV? Do I need the dev packages too?
And I have gobjc++4.2 installed which says its a GNU Objective C++ compiler, is this what I need, + how do I get gridflow to find it?
I had a look at the configure file but couldn't make sense of it.
Please can any one offer any hints? I really want the '#labeling' thing I read about here http://createdigitalmotion.com/2007/01/18/open-source-motion-tracking-with-multiblob-for-gridflowpd/
ps the article says to get pure:dyne, but it doesn't have the latest version of gridflow but I do know its getting a big update and switching to debian installer soon
Linux/RUBY/Gridflow Compilation problem
I had luck with changing 'ruby' to 'ruby1.9'
I've installed all the libs (-dev versions too...) Here is the output of ./configure:
This is the GridFlow 0.9.0 configurator within Ruby version 1.9.0-2006-06-08
[gcc3] GNU C++ Compiler 3 (or 4): --------------------------------------------> found
[stl] C++ Standard Template Library: -----------------------------------------> found
[gcc64] GNU C++ in 64-bit mode: ----------------------------------------------> missing (runtime error)
[libruby] Ruby as a dynamic library: -----------------------------------------> missing (gcc: error: ‘rb_rescue’ was not declared in this scope)
[librubystatic] Ruby as a static library: ------------------------------------> missing (gcc: error: ‘rb_rescue’ was not declared in this scope)
[pentium] Pentium-compatible CPU: --------------------------------------------> found
[mmx] MMX-compatible CPU (using NASM): ---------------------------------------> missing (return false)
[x11] X11 Display Protocol: --------------------------------------------------> found
[x11_shm] X11 acceleration by shared memory (XSHM plugin): -------------------> found
[sdl] Simple Directmedia Layer (experimental support): -----------------------> found
[objcpp] GNU/Apple ObjectiveC++ Compiler: ------------------------------------> missing (where is objc/Object.h ?)
[quartz] Apple Quartz/Cocoa Display: -----------------------------------------> disabled (would need objcpp)
[aalib] Ascii Art Library: ---------------------------------------------------> found
[netpbm] NetPBM 10 Library: --------------------------------------------------> missing (where is pam.h ?)
[jpeg] JPEG Library: ---------------------------------------------------------> found
[png] PNG Library <libpng12/png.h>: ------------------------------------------> found
[videodev] Video4linux Digitizer Driver Interface: ---------------------------> found
[mpeg3] HeroineWarrior LibMPEG3 <libmpeg3/libmpeg3.h>: -----------------------> missing (where is libmpeg3/libmpeg3.h ?)
[mpeg3] HeroineWarrior LibMPEG3 <libmpeg3.h>: --------------------------------> found
[quicktimeapple] Apple's QuickTime: ------------------------------------------> missing (gcc compilation error)
[quicktimehw] Plaum's LibQuickTime (try #1) <lqt/quicktime.h>: ---------------> found
[puredata] PureData (or DesireData): -----------------------------------------> disabled (would need libruby or librubystatic)
[desiredata] DesireData: -----------------------------------------------------> missing (gcc: error: ‘gobj_subscribe’ was not declared in this scope)
[gem09] PureData GEM (source code) with m_holdname: --------------------------> disabled (would need puredata)
[gem08] PureData GEM (source code) without m_holdname: -----------------------> disabled (would need puredata)
[opencv] Intel OpenCV: -------------------------------------------------------> missing (gcc compilation error)
[fftw] FFTW (Fastest Fourier Transform in the West): -------------------------> found
PureData support is required (since GridFlow 0.9.0)
generating ./config.make
generating config.h
See ./config.log if you want the details of the configuration tests.
If you are satisfied with that configuration, you may go on,
and do "make". "make install" is not needed anymore,
just move your gridflow directory to "lib/pd/extra".
If you get stuck, you could contact the author about it,
but first make sure you read "doc/install.html".
I understand that I may need to update the CPLUS_INCLUDE_PATH or LIBRARY_PATH, but I amo not sure how to do this inclusively, for all this various libraries. Is it done in the .bashrc file? I'm going to go ahead and 'make' and see what happens.
TUIO/Reactivision getting PD/GEM to recognize fiducials
Hello
So, I've been successful in running Reactivison with PD and can control loops in Ableton Live with fiducials using my built in iSight on my Intel Macbook.
My problem is getting that information shared with the visual patch (visual_patch.pd) to display the position of the fiducials in GEM. I open the patch and the GEM window is rendered with the small white circle in the middle, but no recognition of the fiducials, even though I know the TUIO patch is getting the information from Reactivision.
I am running version 0.39.3-extended. I suspect it's a problem with pmpd but I can't get PD to run with pmpd. I keep getting these types of errors:
lia2D $1-lia 0 10 2.5 1
... couldn't create
lia2D $1-lia 0 10 2.5 1
... couldn't create
lia2D $1-lia 0 10 2.5 1
... couldn't create
masse2D $3-masse 50 $1 $2 -3.8 3.8 -3.8 3.8
... couldn't create
masse2D $3-masse 50 $1 $2 -3.8 3.8 -3.8 3.8
... couldn't create
masse2D $3-masse 50 $1 $2 -3.8 3.8 -3.8 3.8
... couldn't create
masse2D $3-masse 50 $1 $2 -3.8 3.8 -3.8 3.8
... couldn't create
masse2D $3-masse 50 $1 $2 -3.8 3.8 -3.8 3.8
... couldn't create
using default port 3333
error: float: no method for 'destroy'
... you might be able to track this down from the Find menu.
GemwinMac: width - 500 height - 500
GemWindow Activate err = 0
GEM: Start rendering
added: 4
removed: 4
I've tried moving the stuff from the extras folder around as mentioned in a previous post but no success.
Can somebody please help me along with this? I am lost.
All the best.
Problem compiling external on Windows
Great tutorial, very detailed!
Thanks for this addition..
Sorry for coming later on this subject but I'll try to add few lines about
compiling externals in Win without going through MSVC Express
edition (by the way: what are the limitations of the express edition
w.r.t. the full package?).
Even if MSVC offers an integrated environment for developing there
can be some good reasons for giving a try to the old-man "unix" way of
compiling, which in windows is best represented by MINGW32 and
cygwin. Both offers linux-like environments (i.e. command line tools)
for compiling and other shell tasks which, sometimes, in windows are
a pain in the ass.
There are at least three good reasons for giving a look at mingw:
- gives strong linux compatibility on external compilation
(almost same command lines arguments etc.) - there is the possibility to use makefiles in an almost straightforward way
(with minor modifications to linux makefiles). - no dependency on expensive MS programs (except for the
small, bug-free Operating System
I did this exercise by porting the E. Lyon "LyonPoutpourry" externals for win
(http://www.sarc.qub.ac.uk/~elyon/LyonSoftware/Pd/). Give a look at
the win source package: inside there is a makefile for darwin (MAC)
linux and win. I added the latter, and as you can see the modifications
are minor.
----------- 1. Prelude: compilation environment ------------------
First of all we have to set once for all the compilation environment.
Let's forget for the moment cygwin and concentrate on mingw32 (http://www.mingw.org/). The following is taken from (H.C. Steiner's wiki http://www.puredata.org/docs/developer/mingw)
Download the MinGW package installer and run it:
(http://prdownloads.sourceforge.net/mingw/MinGW-5.1.1.exe)
Choose the Candidate distribution. Install the defaults and add the g++ compiler, g77 compiler, and MinGW make or you can just download my MinGW install, MinGW-Pd.tar.bz2, and uncompress it so that its installed into C:\MinGW.
Then we need MSYS which is a shell (an interpreter of the commands, like a
colorful dos prompt
http://prdownloads.sourceforge.net/mingw/MSYS-1.0.10.exe
Now you will be using the MSYS shell that was installed from the MSYS installer. You can launch it from the Desktop shortcut or Start -> Programs -> MinGW -> MSYS -> msys
----------- 2. Allegro: compilation trial ------------------
a. open MSYS
b. at the prompt type:
cd c:
(or the drive you whish to go for the pd external compilation)
c. go to the external directory (note the backslashes instead of slashes !),
mine is external-compiling. Inside I have helloworld.c
cd alberto/backup/PureData_Archive/patches/AlbertoZ/external-compiling/
d. copy m_pd.h (from the PD distribution directory) into external-compiling
(or whatever is its name)
e. type:
gcc -c helloworld.c -o helloworld.o
f. type:
ld -export_dynamic -shared -o helloworld.dll helloworld.o c:/Programmi/pd039e
xt4/bin/pd.dll
(this is the linker step. note that I linked to a particular version of pd.dll - 0.39 extended test 4, so probably (I'm not sure about this) the external will
run on 0.39 only. Can someone confrm this?)
g. If everything was ok then you should have a helloworld.dll in your
directory. Move it on the extra folder of your pd distribution
(I assume that extra folder is in the pd predefined path) and make a
new patch with the helloworld object. Again, if everything is correct,
you should have a "Hello world!!" printed on the console.
----------- 3. Adagio: makefile ------------------
A makefile can be used for compilation. Even if a simple helloworld
application does not need it, complex programs may do.
The makefile.win is attached with this post. Modify it according to your
path in
Make sure you have
helloworld.c
m_pd.h
makefile.win
in your directory. Now type at MSYS prompt:
make -f makefile.win
This will automatically produce:
the object, the linker step (the dll) and will copy the helloworld.dll
in the extra folder of you pd distribution (overwriting the existing one .
----------- 4. Allegro con brio: conclusions ------------------
Why not give a try to the old-man compilation on Win?
----------- 5. Minuetto: greetings ------------------
I apologize if I said some crap somewhere, just let me know if it
doesn't work. Have fun!
Best regards,
Alberto
Gridflow on agnula demudi ?
arrrrrgggg:
This is the GridFlow 0.8.0 configurator within Ruby version 1.8.2
[fast] Compile for speed (and not debuggability): enabled
[gcc3] GNU C++ Compiler 3: missing (undefined method `<' for nil:NilClass)
[stl] C++ Standard Template Library: missing (gcc compilation error)
[gcc64] GNU C++ in 64-bit mode: missing (gcc compilation error)
[libruby] Ruby as a dynamic library: missing (gcc compilation error)
[librubystatic] Ruby as a static library: missing (gcc compilation error)
[pentium] Pentium-compatible CPU: missing (gcc compilation error)
[mmx] MMX-compatible CPU (using NASM): disabled (would need pentium)
[simd] SIMD (MMX/SSE/Altivec) (using GCC): disabled (would need pentium)
[profiler] profiler (speed measurements): disabled (would need pentium)
[usb] USB Library: missing (where is usb.h ?)
[ieee1394] IEEE1394 Libraries for Linux (raw1394/dc1394): disabled (by author)
[x11] X11 Display Protocol: missing (where is X11/Xlib.h ?)
[x11_shm] X11 acceleration through shared memory: disabled (would need x11)
[sdl] Simple Directmedia Layer (experimental support): missing (where is SDL/SDL.h ?)
[objcpp] GNU/Apple ObjectiveC++ Compiler: missing (where is objc/Object.h ?)
[quartz] Apple Quartz/Cocoa Display: disabled (would need objcpp)
[aalib] Ascii Art Library: missing (where is aalib.h ?)
[jpeg] JPEG Library: missing (where is jpeglib.h ?)
[png] PNG Library <libpng12/png.h>: missing (where is libpng12/png.h ?)
[png] PNG Library <png.h>: missing (where is png.h ?)
[videodev] Video4linux Digitizer Driver Interface: missing (gcc compilation error)
[mpeg3] HeroineWarrior LibMPEG3 <libmpeg3/libmpeg3.h>: missing (where is libmpeg3/libmpeg3.h ?)
[mpeg3] HeroineWarrior LibMPEG3 <libmpeg3.h>: missing (where is libmpeg3.h ?)
[quicktimeapple] Apple's QuickTime: missing (gcc compilation error)
[quicktimehw] HeroineWarrior QuickTime4Linux (or LibQuickTime) (try #1): missing (gcc compilation error)
[quicktimehw] HeroineWarrior QuickTime4Linux (or LibQuickTime) (try #2): missing (gcc compilation error)
[xine] Xine movie decoder: disabled (by author)
[puredata] Miller Puckette's Pure Data: disabled (would need libruby or librubystatic)
generating ./config.make
generating config.h
creating Makefile
humm.... it will probably compile but seem will could do not much without jpeg png video4linux X11 etc....
will wait a .deb package...
Loopback devices, virtual audio devices?
i'm looking for a free solution too. i don't think my original idea is going to work out because i don't have the time to implement it. maybe some of you have ideas for the problem i am trying to solve.
the problem is this:
i am helping a professor with some research. for his research he is doing a case study on 3 composers. he is asking them to record a narrative of there thoughts on the composition process as they compose. for this, the composers will be working an a mac studio workstation putting the composition together in logic. a second computer, a pc , running audacity will be used to record there sounds. when the composer reaches what they consider a significant change in the program, we are asking them to save their project to a new file (so we end up with a series of files showing the various stages of the composition). we would like a way, however, to map the timestamps of those files to the 'timeline' of their narrative.
here are a few solutions that are not exactly desirable:
a. do not stop the recording at all and make a note of what time the recording started. this means that you can calculate what time speech is taking place by adding the number of minutes and seconds (and hours) to the time at which the recording started. the problem with this is that it will yield very large files which are not very practical, especially considering that we have to transcribe these files.
b. have the composers start each segment of narration with a timestamp: "it is now 9:15 on tuesday...." as part of the research methodology, this creates problems with the flow of a more natural narrative of the compositional process.
c. have the composers save each segment of narration as a seperate time-stamped file. the problem here is that this takes more time, and could create a lot of files that would be very annoying to work with when it comes to transcribing.
c. my idea was to have, instead of just input from the microphone, 2 streams of audio input,one on the left channel and one on the right channel. on the left, would be the recorded narrative. on the right, would be an audio signal that encodes a time stamp. i was think of simply convert a number such as DDMMHHMM (day, month, hour, minute) into DTMF tones. these could then be translated back into a timestamp. an 8-tone dtmf sequence would be generated every 10 seconds or so. this way, as long as the narrative segment was longer than 10 seconds, it would contain a timestamp. the problem with this is that i have no way to mix such a signal with the input from the microphone.
any suggestions would be greatly appreciated. thanks.