Klangfarbenmelodie (German for tone color melody) and the synonymous French term mélodie de timbres distributes a melody over several instruments rather than assigning it to just one, the listener's focus becomes timbre rather than pitch.
In a similar way, the algorithmic composition patch we'll build today outputs series of overlapping randomly chosen timbres to create an interesting musical texture.
Jump to the end of the post to hear some sample algorithmic music output from this patch.
Algorithmic Composition with MIDI Timbres
Firstly we'll get a simple MIDI note to play in Max and PureData: add a toggle, a metronome object, a message and makenote and noteout objects. If you're not sure how to do this, work through some of the earlier algorithmic composition tutorials here:
Add random and pgmout objects, this will output a random MIDI program change - each note should now play with a different timbre:
We'll now output a MIDI controller message. MIDI controller #7 controls the volume for that MIDI channel. We'll add a number box in PureData and an integer in Max, this will be connected to our metronome, the makenote duration and a float object. We then use line (to create ramp between tow points) and pipe (to delay a message) - this results in the note fading up in volume for half of its duration and fading out for the other half. Your Max patch should now look like this:
When you turn the toggle on you should now hear random timbres fading in and out. So far we've been triggering only a single note, we'll make the pitches more varied by storing some scales in a coll object:
Coll is used in the same way in PureData to store these four scales:
- Three receive objects: r on, r speed and r scale.
- A loadbang and a '1' message this is used to set MIDI output of pgmout, makenote and ctlout. We could type the channel output directly into these boxes, but this means we only have to set the MIDI channel once and we can change the channel for all 3 objects.
- Add trigger and random objects, these will choose a random length for our note up to the maximum set by the speed send and receive.
Duplicate this subpatch 15 times (select the subpatch and press CMD D on a Mac and CTRL D in windows). Next we'll change the message that currently says '1' (the message connect to the loadbang at the bottom of these subpatches). Change this message so each subpatch is sending out to a different MIDI channel, set the first subpatch to 1, the second subpatch to 2 and so on. Each of the 16 separate subpatches should send out on an individual MIDI channel from 1 to 16. Your main patch window should now look something like this:
Set the speed (try around 10000 to start) and choose one of the four scales. Turning the toggle on should start this algorithmic composition patch running, with 16 MIDI channels fading in and out with different durations and randomly selected MIDI timbres.
Although it's a simple algorithmic composition idea: random timbres, durations and scale notes it can results in some quite pleasing evolving ambient textures.
It's worth trying to build this patch from scratch, but you can also download the complete patches here:
- Klangfarbenmelodie Max Algorithmic Composition Patch
- Klangfarbenmelodie PureData Algorithmic Composition Patch
- Create a master timer and have different sections that vary over time:
- the first minute max duration = 25,000 scale: Harmonic minor
- the next 30 seconds max duration = 5000 scale: Augmented
- the final 30 second max duration = 15000 scale: Major
You can hear some sample output for this patch here
We'll look at other techniques for composing with timbre in future algorithmic composition tutorials using Max, PureData, OpenMusic and more. Subscribe to the RSS feed and check back for more algorithmic composition tutorials soon.