Makin' drum streams



(You may need to brush up on makegens, sampfunc, or algorithms in general. If so, please see the appropriate tutorial.)

Since the examples I showed you in class were . . er, somewhat less than gratifying, I present here some "drum-loop" material I used in the piece of mine that you heard the first day of class. This example is similar to what I was attempting to demonstrate in class, but has a slightly different decision-making process involved in it's algorithms.

We begin with a similar, though simpler, algorithm than that used by the Burundi drums; it simply writes out a steady beat:



Now, that algorithm just creates a straight beat. So, we elect to use a DATA (type 2) makegen to store a "binary listing" of a drum pattern . This looks like yay:

for a "drum-loop" of sixteen beats. In the loop itself, we make a decision for each beat: "are we going to place a hit here or not?" We do that by using the sampfunc statement to get a value from the "drum-pattern" makegen we just created. Then we test that value using an if formulation. As follows:



Also, we now begin to define our music in terms of cycles or, traditionally speaking, measures; that is, each time we go through the pattern, we fill a "measure" of sixteen beats.

Thus, we have to have two loops now: the "inner" one pulls us through an individual measure of sixteen beats, the "outer" loop pulls us through however many "measures" we want to go through. Hence the following set-up will occur (this one assumes [arbitrarily] we want to write 6 measures):

To calculate the start-time for a given beat in the whole output, we need to know what measure it's in and what beat it's on, and apply those to the following equation:

Thus measure is a kind of "offset" to which we add the beat.

Unless our tune is exactly at a tempo of MM60, however, we have to factor in an additional tempo modifier, which we multiply by that final "beat" value we just got, to get the final start-time:

So, with the calculations for start-time under our belt, we can look at the whole darn thang so far:





So, this is the basic idea. I will extend this here one step further to show you a score I used in my recent piece, which also involved more of a specific "style-modeling" approach to the issue. In this case, the style I wanted to cop was that of "military" drumming. You'll remember Prof. Garton's talk about his Irish-guitar-band simulations, and how he spoke of certain "guitar-picking-patterns" that guitarists practice thousands of times in every key, etc.; he used these patterns as material to build up "improvisations" of virtual players. Well, I applied the same idea, in a much simpler way, to "military-style" drumming.

Here is a typical military-drum pattern:

I decided to divide the music into "measures" of a quarter-note's duration. Within each quarter, patterns of sixteenths will appear. There are really only a few patterns of four sixteenths that will appear in this style of drumming, most of them not involving syncopation. (Ya gotta keep the troops marching, not shakin' their booties). Here are the ones I used:

I translated these into a series of makegen commands:

Now, notice that some of these patterns are repeated. Eventually, I'm going to have sampfunc() choose randomly from makegens 10 thru 25, to choose which pattern to use for a given quarter-note "measure." By repeating some of the patterns (for example, "1 1 1 1" occurs a whole bunch of times), I can get a "weighting" of the decision of what pattern to use: "1 1 1 1" is going to appear more than "1 1 0 1".

So, now, in addition to cycling through the beats as before:

We make that "2" into a variable, let's call it whichpattern, and then the following writes a "quarter-note"'s worth of "sixteenth-notes" of sound:

We embed that in a larger loop, which will write us 100 "quarter-notes" worth of sound, and the whole thing looks like this:

Now try listening to the sound examples. First, and least interesting is the source for the snare sounds.

Second, is the snare patterns made with the above algorithm.

Finally, you can hear this in the context of the whole piece. Note that here, the above-created "snare"-drum pattern gets panned way off to one channel of the stereo mix, and another, (much simpler-- (it consists of simple alternation between bass and cymbal)) to the other channel.



Possible expansions (assignments?) to these ideas: