Programming Electronic Music in Pd

By Johannes Kreidler.

An amazing resource for Pd programming, with downloadable examples.

http://www.pd-tutorial.com/english/index.html

Abstract

Pd was initiated by American software engineer Miller Puckette, who previous co-developed the well known and similarly structured software Max/Msp. Pd is not commercial software; i.e., it was not developed by a corporation and is not for sale. Instead, it is “open source”: its source code is not the (patented) property of a corporation, but is rather freely available to all. One drawback to this is that a detailed operating manual for users who lack programming experience has not existed until now. In contrast to a corporation— which has a monetary interest in ensuring that first-time users can easily operate new software—the open source movement lacks such a driving force to make itself accessible. This book is an attempt to fill that gap.

This tutorial is designed for self-study, principally for composers. It begins with explanations of basic programming and acoustic principles then gradually builds up to the most advanced electronic music processing techniques. The book’s teaching approach is focused primarily on hearing, which we consider a faster and more enjoyable way to absorb new concepts than through abstract formulas.

The patches described are available for download.

 

FM, AM, and SSB modulation/demodulation in Max

This is a radio – but also a modem, in a literal sense of the word. You may be familiar with AM and FM. Have your tried using them backwards?

In this patch, an audio signal is modulated using SSB, AM, and FM then frequency shifted to about 1/4 the nyquist frequency. Then the process is reversed revealing the original audio.

notes

Have improved and simplified FM and AM detection. There is no frequency shift prior to detection. This eliminates some phase distortion.

Pd Version. (runs at 44.1 kHz, because I was too lazy to figure out how to do audio file playback which detects the SR of the audio file.

FM detection: The DC offset and makeup gain levels are sensitive to carrier frequency and SR. Will need to automate these corrections to prevent audio output problems.

download

max-projects: https://github.com/tkzic/max-projects

folder: demodulation/max

  • modem3.maxpat
  • obama.aiff

folder: demodulation/pd

  • modem-pd.pd
  • freqshift-abs~.pd
  • obama.aiff

 

libpd, Leap Motion, and Osc, in Openframeworks

On Mac OS 10.8 using Xcode 5, and openframeworks version 8

  1. Install and test openframeworks from http://www.openframeworks.cc/download/ 
  2. Install and test libpd https://github.com/danomatika/ofxPd (you should be able to run the example programs)
  3. Install and test leap motion https://github.com/ofTheo/ofxLeapMotion  (you should be able to run the example programs)
  4. Install Pd (I installed pd-extended, even though this project is limitied to Pd ‘vanilla’) http://puredata.info/downloads

Note: The Osc addon is already provided with openframeworks distribution. At this point you have everything you need to run the test example.

  • Download the project: http://zerokidz.com/downloads/leadPdTest5.zip
  • Copy the leapPdTest5 folder into the ofx8/addons/ofxLeapMotion folder
  • Launch the xcode project: leapPdTest5.xcodeproj
  • plug in a leap and turn up the volume
  • Compile and run (you may need to compile the openframeworks scheme first)

Notes: