What do I know about polyrhythms? Not very much; it seems that this is when two or more rhythms of different sizes are played simultaneously, and they are played at the same time. I will give a picture for clarity.
This technique is used in the ethnic music of the inhabitants of the African continent, as well as by many good drummers. This article will describe the method that I use to generate such rhythms.
Tools
Rhythms can be visualized as a sequence of ones and zeros, where 1 is a beat, and 0 is silence. The total number of elements determines the length of the rhythm. In Max, it is easiest to present the rhythm in this way with the help of messages: ')
In the first rhythm of 16 elements, in the second - 10 . We will play them using the seq ~ object. It works as follows: we consistently hammer in events, for each of which we determine the condition under which it will be displayed. seq ~ receives the audio signal, compares its value with the entered data and, if it matches, displays the saved message. For example, let's make the object generate bang when the value of the incoming signal is 0.5 . To do this, send a message to seq ~(add my_rythm 0.5 bang) . Now, when the value of the incoming signal in seq ~ is equal to 0.5 , the object will issue bang through the left outlet. To facilitate the understanding of the object, I created a small patch with comments, which should help to deal with its work (seqhowto.maxpat) .
We go further. At the moment, we need to drive a sequence of ones and zeros into the seq ~ object. For this purpose, some time ago I created a small abstraction called rtoseq(rhythm to seq ~) . Abstractions in Max are called patches that are created so that they can be used as objects, with programmers this is called a reusable code . Abstractions have the same .maxpat extension and can be added in the same way as objects.
The principle of operation of rtoseq is very simple. It takes a list of ones and zeros, traverses each element, and for each unit forms a message that creates an event in seq ~ . I will not explain in detail his work, since this is an article on polyrhythms, and anyone who is interested, he will be able to make out what happened in 15 minutes. So, take a look at the following patch (polyrhythms01.maxpat) :
When you click on a message, the rtoseq object “clogs” the rhythm into seq ~ objects, the signal from phasor ~ controls the output of messages stored in seq ~ . The message (play 1, seq rtoseq) is required to enable seq ~ (for details, go to the help).
However, setting the rhythm directly through the message is not very convenient, so we will make a small interface (polyrhythms02.maxpat) .
The multislider object with each edit sends a list of values for all sliders through the left outlet . The message (size $ 1) changes the number of sliders. The following changes have been made to the object inspector: • Range: 0. 1. - slider value range; • Slider Style: Bar - the appearance of the sliders; • Sliders Output Values: Integer - sliders will have integer values; • Thin Line Thickness: 2 - create the distance between the sliders. So we turn the multislider into a kind of pattern editor.
Conclusion
This method gives us not only the ability to program any polyrhythms, but also provides rich possibilities for experiments if we control seq ~ objects not with a saw, but with an arbitrary audio signal: a sinusoid, a triangle, white noise, and at least a signal from a linear Entry - many options.
By the way, this is the first article on pattr , which deals with the topic of algorithmic sequencers.