Pd

How to become a Pure Data / GEM Professional

These are materials from a lecture about realtime audio and video programming (using GEM and Pure Data) at the University of Applied Science, FH Joanneum, for the master programme Media and Interaction Design.

Advanced Psychoacoustics 2: Silent Subliminals

Do you want to influence a humans behavior ?
Or maybe induce some thoughts in the brain of all people listening to a specific radio channel ?
Then you found the right blog entry, which will present you a Pure Data program to change the attitude of your desired audience ... Wink

Sound Spatialization in Pd

Year: 
2007
Authors: 
Georg Holzmann
Type: 
Workshop
Publisher: 

Proceedings of the Linux Audio Conference 2007

Abstract: 

The goal of this workshop is to show how to position sound in space (stereo, multichannel and binaural). This should be done from a user point of view, without explaining the detailed mathematics behind the algorithms. Therefore existing and open-source implementations in Pure Data will be used and explained.

Topics:

  • stereo-panning methods
  • vector based amplitude panning (VBAP)
  • ambisonic
  • binaural ambisonic and 3D room simulation

To all topics I will explain the handling of the Pd implementations and the advantages/disadvantages of the specific methods, demonstrated on examples.

All workshop materials can be downloaded below.

Genetische Algorithmen in Komposition und Computermusik

Year: 
2003
Authors: 
Georg Holzmann
Type: 
Technical report
Publisher: 

Internet Publication

Abstract: 

Meist werden komplexe Systeme von Algorithmen in der algorithmischen Komposition
verwendet. Dadurch entsteht eine Vielfalt an Parameter, die die intuitive Steuerung solcher
Systeme erschweren.
Mit Hilfe von Interaktiven Genetischen Algorithmen (IGA) kann man Variationen dieser
unzähligen Parameter nach eigenen ästhetischen Vorstellungen „züchten“, ohne ein Wissen
über die darunter liegende Struktur haben zu müssen und hat trotzdem noch ein hohes Maß an
Kontrolle.
Diese Arbeit bietet einen Überblick von Anwendungen Genetischer Algorithmen in der Musik und präsentiert eine neue Implementation.

VideoIO

Started in: 
2007
Authors: 
Thomas Holzmann
Authors: 
Georg Holzmann
License: 
GNU General Public License (GPL)
Programming language: 
C, C++
Overview: 

This framework should provide a general video input and output system (reading/writing various files and from/to devices) for Pure Data. The interface is platform independent and the needed libraries are checked and loaded at runtime, so the host application (e.g. Gem, Gridflow, PDP) has no compile time dependency on all those video libraries.

At the moment only the interface to Gem is implemented and consists of the following objects: pix_file_read, pix_file_write and pix_devic_read. They use the gstreamer plugins for all these opterations, but alternative libraries, especially on Windows and OSX, should be added in future.

What they can do ATM:

  • pix_file_read: reading audio and video from all formats gstreamer supports (quite a lot), reading from dvd, http, mms, udp streams, ...
  • pix_file_write: writes in some codecs to disk, also streams over udp
  • pix_device_read: can read from camera and DV devices

This project was part of the Google Summer of Code program 2007.
The latest source can be downloaded from the SVN repository, an other (maybe outdated) version can be found in the download section below.

sndfiler

Started in: 
2005
Authors: 
Tim Blechmann
Authors: 
Georg Holzmann
License: 
GNU General Public License (GPL)
Programming language: 
C
Overview: 

A threaded soundfiler for Pure Data using libsndfile for reading uncompressed and libvorbisfile for reading OGG files.

FEATURES:

  • threaded reading of multichannel soundfiles into arrays
  • threaded resize of arrays
  • support for OGG

REQUIREMENTS:

  • pd >= 0.39
  • libsndfile
  • libvorbisfile
  • threadlib

For more information look at the help patch.
See the file INSTALL for installation instructions.

threadlib

Started in: 
2005
Authors: 
Georg Holzmann
License: 
GNU General Public License (GPL)
Programming language: 
C, Pd
Overview: 

C and Pure Data library for threaded patching and threaded PD externals, heavily based on pd_devel code by Tim Blechmann (his detach/join for pd_devel).

PD objects for threaded patching:

  • detach: run part of the patch in a helper thread
  • join: synchronize messages to pd's main thread
  • sleep: blocks the system for a specific time

WARNING:
These objects (especially detach/join) are very experimental and may crash your patches if you use them in a wrong way, because some externals/internals of PD are not threadsafe !!!

Features for PD external programmers:

  • lockfree FIFO from pd_devel
  • callback system like in pd_devel: instead of the idle callbacks, which are not really usable in current main pd, it uses clock callbacks
  • USAGE: you have to link your externals against threadlib - see sndfiler as an example
  • ADVANTAGES: so it's possible to use the lockfree FIFO and sys_callback in main pd (and the same source code for main and devel pd)

Many thanks to Tim Blechmann for his code and help!

detach:
Detach is working on control objects only, creates a helper thread and runs all functions of the following objects in this helper thread. If a message from that thread reaches a join object a callback for running the outlet function will be places in the scheduler and run in the next scheduler loop - so you can synchronize the message with pd's main thread again.
Detach is useful if you have a control operation that would be too CPU-intensive and would disturb dsp.

join:
The message to the inlet will be sent to the outlet during the next clock callback of the scheduler. It doesn't matter, which thread the message was coming from. Messages from the main pd thread will be rescheduled.
Join can be used everywhere, where a message has to be rescheduled, this is also useful to place behind any threaded external calling the outlet functions from the helper thread, to make sure the following messages are being run in the main pd thread.

WARNING:
detach/join provide the possibility of threaded patching, beware of the risks:

  • not every pd object is thread-safe (if unsure, look at the source code or ask at the pd-list or me)
  • pd is not completely thread-safe itself
  • everything that is triggered by the detached message will be detached - so don't mix threaded and non-threaded message paths unless you know what you are doing - use the join external to synchronize with the main pd thread!
  • if detach/join crashes pd during a performance, don't complain ...
  • both detach and join have an overhead ... so only use them, if you really need threaded patching, e.g. have a subpatch that has to run for quite some time and would interrupt audio or something else
Release Tarball: 

adaptive

Started in: 
2005
Authors: 
Georg Holzmann
Authors: 
Gerda Strobl
License: 
GNU General Public License (GPL)
Programming language: 
C, Pd
Overview: 

adaptive is a Pure Data external library for adaptive systems and filters.

An adaptive system tries to learn from signals of the past. Mostly it is a simple FIR filter, whoes coefficients can be learned to model or predict an other system.
Some applications: system identification, echo cancellation, linear prediction, interference cancellation, self-tuning control, ...

For a lecture at the TU-Graz we implemented various versions of the LMS and NLMS algorithm (= least mean square and normalized least mean square adaptation algorithm).
We also added a lot of examples (see PD-patches in example folder): system identification, interference cancellation, adaptive equalization, decision-directed equalization, ...

For more documentation look through the help and example patches!

Release Tarball: 

pix to pdp bridge

Started in: 
2005
Authors: 
Georg Holzmann
License: 
GNU General Public License (GPL)
Programming language: 
C, C++
Overview: 

Two main video processing frameworks exist for Pure data: Gem and PDP.

pix_2pdp captures the contents of a Gem pix object and transforms it to a PDP packet (use colorspace YUV for the fastest conversion).
So it's possible to convert from Gem to PDP to Gem to PDP to ... Wink

What can you do with it?

  • use pix_video/pix_2pdp for firewire input in PDP
  • use pix_2pdp/pdp_rec~ to record Gem pixes
  • maybe switch between Gem and PDP all the time
  • ...

pix_2pdp is based on code of gem2pdp by Yves Degoyon and is a part of the gem2pdp package.
Many thanks to IOhannes M Zmoelnig for support!

Implemented colorspaces: RGB, RGBA, YUV, Grey.
For more information how to use it look at the help patch.

PDContainer

Started in: 
2004
Authors: 
Georg Holzmann
License: 
GNU General Public License (GPL)
Programming language: 
C++
Overview: 

::: GOAL OF THE LIBRARY :::

This library was made for algorithmic composition and of course for all other algorithms. I came into troubles with making bigger musical structures in Pure Data with send-receive pairs, arrays, etc. So I tried to make it possible, to have access to some storage in a whole patch.

::: DATASTRUCTURES :::

As storage datastructures, I implemented the C++ STL (Standard Template Library) Containers in PD. Currently following datastructures are available (prefixed with h_): h_map, h_multimap, h_set, h_multiset, h_vector, h_list, h_deque, h_queue, h_priority_queue and h_stack.

::: NAMESPACES :::

For communication I use namespaces. Every Container with the same namespace (and the same container type) has access to the same data. So you can modify and get this data everywhere in the patch. For local namespaces use names with $0.

::: DATATYPES :::

In the containers you can save all of the PD build-in datatypes: lists, floats, symbols and pointers - so it can be also used for PD's graphical datastructures.

::: SAVE/LOAD :::

All the data of all containers can be saved to disk as XML or text files. So you can also manually edit the file with an editor (which is sometimes much faster) and then load it in PD into a container. You can also load data from other containers.
Please use the XML file format if possible, because it's easier to edit in an external editor and the XML parser is much more stable.

For more documentation look through the help patches!

Syndicate content