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:
- Open our last patch from tutorial one. You can see the finished version of the patch at the bottom of this post.
- 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
- 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
- Come out of edit mode [PD: CTRL E, Mac: CMD E] and click on the message to store the scale to the table.
- 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.
- Break the connection between the 'random' object and the '+' object. Create a new object and type 'tabread majorScale' into this object.
- 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.
- 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.
- 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.