
12a_Random_Drum_Beat_Template.zip
Description
- The program is one of the three template files
provided for the Programming Project.
- The program generates a random drum beat using
instruments from the General
MIDI (GM) Drum Kit. The percussion instruments
available in this kit are shown in this GM
Percussion Key Map. Or you can use the umenu
provided in the patcher.
- The patcher combines the code of two previous
tutorial patchers:
- 10b_GM_Drums
- 07c_Weighted_Random_Rhythm
- The artistic goal is find a set of percussion instruments, tempo, and pulse that create a convincing groove.
- Tempo and pulse:
- The default tempo is 108 b.p.m.
- The default pulse is 1/16 notes.
- The optional arguments to "tempo 108 1 16" were discovered through numerous real-time interactive runs of the program.
- GM percussion instrument selection:
- The left set of random and select (sel) objects work together to map six possible random outcomes (0-5) to six carefully chosen GM percussion instruments: 43, 37, 50, 37, 60, 61.
- A GM percussion instrument umenu shows the name of the GM Percussion Key map so you don't have to look up the instruments elsewhere.
- The list of percussion instruments in the
umenu is shorter than 128, so an offset of –35
is required to make the menu display the correct
instrument name.
- The pitch mapping process in detail:
- The left sel object maps the
incoming random numbers (0-5) to GM percussion
instruments as follows:
- The random numbers 0, 1 & 2 map to to low (43), middle (47) and high (50) toms, respectively.
- The random number 3 maps to Side Stick/Rim Shot (37).
- The random numbers 4 & 5 map to high (60) and low (61) bongos, respectively
- To create a convincing groove, I used a
relatively small number of related percussion
instrument groups. The timbral groups have
following probabilities:
- toms (50%)
- bongos (33%)
- side stick/rim shot (8%)
- The left sel object maps the
incoming random numbers (0-5) to GM percussion
instruments as follows:
- Humanized velocity:
- Using the patcher (p) object, I created a subpatcher called humanize that randomly varies the default velocity 90 by 36% above and below the incoming default value (90). The resulting velocity range 58-122 provides a sense of percussive accent, as well as a much wider palette of timbral variation in the six instruments.
- Weighted random rhythm:
- To change the default isochronous pulse of
bangs that comes out of a tempo
object into a weighted-random rhythm, I added
another set of random and sel objects.
- The right set of random and
sel objects work together to
map four possible random outcomes (0-3) to four
carefully chosen durations: 1/8, 1/16, 1/16,
1/16.
- The probability of choosing an 1/8 note is 1 out of 4 or 25%.
- The probability of choosing an 1/16 note is
3 out of 4 or 75%.
- This creates the impression of a steady stream of 1/16 notes with 1/8 note syncopations on random occassion.
- By using durations based on powers of 2 – that is, 1/16 = 1/(2^4); 1/8 = 1/(2^3)) – I created a very traditional-sounding rhythm. But you may choose any numbers you like. There is an infinite world of rhythmic proportions waiting for you to explore.
- What is more, if you are willing to use two
tempo objects, you could explore the world of
polyrhythms.
- To change the default isochronous pulse of
bangs that comes out of a tempo
object into a weighted-random rhythm, I added
another set of random and sel objects.
Objects
Updated: 10/8/25