Subsections

subpatched sine wave gens

Figure 6 summary

Using subpatches

In this final example we have copied the oscillator subpatch and changed the parameters of the composition a bit to get a more pleasing interval and scale. Multiplying the midi note by a small integer sets the scale interval, and adding to it provides a fixed offset. This way we have a scale of six notes, five semitones apart starting at C3 with the second part playing five semitones higher than the first. The variables that Puredata sees inside a subpatch are the same as those in the main patch, in programming words a subpatch does not provide scope. This means that some patches, especially those that use tables, cannot be subpatched to make them easily copied. For this we use abstractions instead, which will be introduced in the next tutorial.

Figure 6: two-oscillators
\includegraphics[angle=0, scale=1]{/home/zero/PRODUCTION/TEACHING/PD/Composition-000/images/F-two-oscillators-play}
F-two-oscillators-play.pd F-two-oscillators-play.ogg
Andy Farnell
http://obiwannabe.co.uk/