Exercise: Music Synth AM/FM

Objective

Demonstrate Frequency Modulation (FM) and Amplitude Modulations (AM) synthesis methods using pure Pd, as well as a qlist sequencer with Python support.

Frequency Modulation Synthesis is a classic technique in computer music for producing complex sounds using a network in which oscillators influence the frequency of other oscillators. The sound generation is controlled by a relatively small number of parameters, but searching the space of these parameters for pleasing sounds can be difficult. This was an especially popular technique when computer memory sizes and storage were small making sample-based methods expensive.

FM and AM are two simple yet rich ways to create complex sounds with very little programming.

The second feature of the exercise is the use of a Pd qlist object as a sequencer to generate messages over time. This object can be complex to use since each output event needs to be programmed in as a separate message. This is aided by a small Python program, imported using the pdpython external. This Python program translates a string of characters specifying a rhythm into the qlist configuration messages.

The pdpython external is available precompiled for OS X and can be easily compiled for Linux and the Raspberry Pi (sorry, Windows). The OS X version is in the course distribution at physcomp-examples/support/Pd-library/pdpython-OSX; this path should be added to your Pd search path. The full pdpython package is available on github.

Steps and observations

  1. Open music-synth-am-fm.pdin Pd-extended or vanilla and follow the instructions.
  2. Open fmsequencer.pd in Pd-extended or vanilla Pd.
  3. Turn on the DSP output and click Start.
  4. Look at fmsynth.pd for more details on the synthesis.
  5. Take a look at utility.py for the transformation function.
  6. Add more transformation rules and create a more complex rhythm. Pd will need to be restarted after the Python changes. You'll need to use a Python program editor to edit the Python code.

Comments

Python is not a real-time language like Pd; if any given function call takes too long, the audio buffers will drain and there will be a glitch in the audio output. But this shouldn't be a problems for small calculations; it's more of an issue for large file I/O.

For a challenge:

Other Files

  1. music-synth-am-fm.pd
  2. fmsequencer.pd
  3. fmsynth.pd
  4. utility.py
  5. utility.pyc