Saturday, 20 March 2010

Tutorial - PD2: Random Major Scale Pitches

Following on from our last PureData tutorial that played random chromatic pitches, we'll make our patch a little more melodic by choosing our pitches from a major scale.

If you haven't already work through the last PureData algorithmic composition tutorial or download the PureData patch here.

Our last patch looked like this:


  1. Open our last patch from tutorial one. You can see the finished version of the patch at the bottom of this post.
  2. We'll store the pitches of our major scale in a message: create a new message [PD: CTRL 2, Mac: CMD 2] and type this is into the message ; majorScale 0 0 2 3 5 7 9 11 12
  3. This defines the intervals of a major scale. We need to store this in a table, create a new object [PD: CTRL 1, Mac: CMD 1] and type 'table majorScale' into this object box
  4. Come out of edit mode [PD: CTRL E, Mac: CMD E] and click on the message to store the scale to the table.
  5. We'll set the patch up so the scale is stored automatically when the patch loads. Enter edit mode [PD: CTRL E, Mac: CMD E]. Create a new object [PD: CTRL 1, Mac: CMD 1], type 'loadbang' into the object and connect it to the message.
  6. Break the connection between the 'random' object and the '+' object. Create a new object and type 'tabread majorScale' into this object.
  7. Optional: create two new number boxes [PD: CTRL 3, Mac: CMD 3] and connect everything up as shown in the screenshot below. The numbers aren't strictly necessary as they don't actually do anything, they just display the current number.
  8. Previously we were choosing from 12 random pitches. Now we only have 8 notes to choose from in our scale, so we now need to change the number in our random object to 8.
  9. Come out of edit mode [PD: CTRL E, Mac: CMD E], click on the toggle and you should hear random notes from the C Major Scale.


Remember to make sure you have set a MIDI output in preferences/Midi settings.

It's definitely worth building the patch yourself to get used to working with the program, but you can also download the patch here.

No comments:

Post a Comment