Thursday, 24 September 2015

VART3492 :: Advanced Studio Technologies 2 - Bjorklund Algorithm for Arduino

int steps = 8;
int pulses = 5;

int remainder[16];
int count[16];
int level;
int stepstatus=0;
char pattern[16];
float currentmicroTime;
float currentmicroTime2;

char trackArray[8][16];


void setup() {
 Serial.begin(9600);
}

void loop() {
 
 delay (3000);
 
 currentmicroTime = (float)micros();
 
 compute_bitmap(steps,pulses);
 
 currentmicroTime2 = (float)micros();
 
 Serial.print("For ");Serial.print(steps);Serial.print(" steps and ");Serial.print(pulses);Serial.print(" pulses, "); Serial.print("the pattern is:");
 Serial.println();

 
 for (int i = steps-1; i >= 0 ; i--) {
     Serial.print(trackArray[1][i]);
 }
 
 
 Serial.println();Serial.println();
 Serial.print("Bjorklund took ");Serial.print(currentmicroTime2-currentmicroTime);Serial.print(" microseconds.");
 Serial.println();Serial.println();Serial.println();Serial.println();
 delay (5000);
 
     
}
void compute_bitmap (int num_slots,int num_pulses)  {
 
 //int remainder[16];
 
 if (num_pulses > num_slots) {num_pulses = num_slots;}         
 int divisor = num_slots - num_pulses;
 steps = num_slots; pulses = num_pulses;
 remainder[0] = num_pulses;
 level = 0;
 do {
   count[level] = divisor / remainder[level];
   remainder[level+1] = divisor % remainder[level];
   divisor = remainder[level];
   level = level +1; }
   while (remainder[level] > 1);

   count[level] = divisor;
   build_string (level);

}


void build_string (int level)  {
 if (level == -1) {

 //Serial.println('0');
   trackArray[1][stepstatus]='0';
   stepstatus=stepstatus+1;     
 }
 else if (level == -2)  {   

 //Serial.println('1');  // Debug
   trackArray[1][stepstatus]='1';
   stepstatus=stepstatus+1;    
 }
 else {
   for (int i = 0; i < count[level]; i++)
   build_string(level-1);
   if (remainder[level] !=0)
   build_string(level-2);
 }

}

Thursday, 10 September 2015

VART3492 :: Advanced Studio Technologies 2 - Bjorklund Algorithm & World Music


A new family of musical rhythms has been described, called Euclidean rhythms, which are obtained by using Bjorklund’s sequence generation algorithm, which has the same structure as the Euclidean algorithm. It was shown that many rhythms used in world music are Euclidean rhythms. Some of these Euclidean rhythms are also Euclidean strings [11]. The three groups of Euclidean rhythms listed in the preceding section reveal a tantalizing pattern. Those Euclidean rhythms that are also Euclidean strings (the first four of group one) are favoured in classical, jazz, Bulgarian, Turkish and Persian music, but are not popular in African music. The Euclidean rhythms that are neither Euclidean strings nor reverse Euclidean strings (the first two of group three) are used only in subSaharan African music. Finally, the Euclidean rhythms that are reverse Euclidean strings (the second group) appear to have a much wider appeal. Finding musicological explanations for the preferences apparent in these mathematical properties raizes an interesting ethnomusicological question. The Euclidean strings defined in [11] determine another family of rhythms, many of which are also used in world music but are not necessarily Euclidean rhythms, as for example (1221222), an Afro-Cuban bell pattern. Therefore it would be interesting to explore empirically the relation between Euclidean strings and world music rhythms, and to determine formally the exact mathematical relation between Euclidean rhythms and Euclidean strings.

The Euclidean Algorithm Generates Traditional Musical Rhythms - Godfried Toussaint (School of Computer Science, McGill University 2005)

Max/MSP implementation of Bjorklund algorithm

Max/MSP implementation of Bjorklund algorithm - Circular pulse distribution (Model for Elements Installation)



Thursday, 3 September 2015

VART3492 :: Advanced Studio Technologies 2 - Further Polymeter research




Let us begin with a look at the music of Steve Reich, specifically one his seminal works, Drumming (1970-71). The piece was composed over the course of roughly one year following Reich's return from Ghana, where he studied drumming with Ewe master drummer Gideon Alorworye2. Reich recorded each lesson with Alorwoye and afterward played the tapes back at a slow enough speed so as to be able to transcribe the individual patterns. By doing so he noticed that different instrumental patterns present in Gahu music, although rhythmically compatible either by a simple or polyrhythmic relationship, were not bound by any sort of attachment to the first downbeat of each measure. 
The way in which Reich has established the measure lines for each pattern in his transcription is a clear indication of his perception of meter in this type of music. Rather than simply dropping all of the patterns into 4/4, Reich maps the relationship between each instrument in a polymetric, albeit very closely related, way. The top gong gong line is an eight quarter note long phrase, whereas the rattle part directly below is exactly half the length at four quarter notes. The third line, a one quarter note long kagan pattern, is basically the tactus of the whole piece but displaced by one eight note. The bottom three lines are all four quarter notes long but displaced by one and a half quarter notes (kidi), one quarter note (sogo), and a sixteenth note (agboba), respectively. This rhythmic displacement is where we start to see the influence of Reich's time in Africa on his compositional approach to Drumming. The variability of the displacement is crucial to our understanding of Drumming and how the underlying process of rhythmic phasing works. 






Midi transcription of 'Drumming'



The sense of becoming fixed in time (to paraphrase Gretchen Horlacher) frequently goes hand-in-hand with the sense that two separate motives are actually fused into a single pattern. Put another way: because displacement dissonances do not challenge our sense of metrical periodicity (though they may challenge our sense of downbeat), two ostinati that form a grouping dissonance are far more likely to be differentiated as separate motivic strains than are two ostinati that form displacement dissonances. By intermingling these two types of metrical dissonance — often willy-nilly — Adams projects a freer relationship between two textural lines. This is one feature that sets his minimalist technique apart from that of Steve Reich or Michael Torke, who generally don’t oscillate between metrical dissonance types quite so readily. 

The Sonic Illusion of Metrical Consistencyin Recent Minimalist Composition - Michael Buchler Florida State University 2006
















Titles to check out:
Hearing in Time: Psychological Aspects of Musical Meter by Justin London
Meter as rhythm by Christopher F. Hasty New York and Oxford: Oxford University Press, 1997.