Hexahedral vertex permutations [Max]

Spent the weekend reading analyses of Xenakis’ Nomos Alpha, so I knocked up a little hexahedral permutation program instrument. Vertices are parsed out as x,y,z and can be hooked up as parametric controls based on the hexahedron’s position in 3D space! Hooray!

Xenakis uses isomorphic permutations of a cube to order elements of a set using pretty standard permutations (rotate 90º, rotate 180º, etc). His process is much more based in boolean logic and set theory, but I took the basic principal ofusing the isomorphic permutations as parametric controls, but running in real time. So you can drag the cube about, or animate it, and it spits out a bunch of numbers which you could use to control anything. (ie. bow technique, dynamic, durations, pitch, or whatever digitally!).

A Thomas DeLio article on Nomos Alpha largely ignores Xenakis’ use of hexahedral vertices and looks at the set more simply: thats worth looking at:http://www.jstor.org/discover/10.2307/843739?uid=3738032&uid=2&uid=4&sid=21102363132331

Code is here (albeit in an awkward, copy-and-paste-into-Max kinda format)


Beeblebrox and the Infinite Improbability Drive {Python}

Trying to deal with an issue in my first string quartet, where performers are faced with a probabilistic decision… being that musicians are not computers, I’m looking at pre-calculating these probabilities, whilst trying to find a way to keep my score system indeterminate (more on that later). Some code I knocked up today to calculate probabilities for weighted edges in a graph network.

### Weighted outcome calculator for Network #1 (String Quartet #1)
# owmtxy, feb 2013 - python, v.2.7
# Input up to 5 probability percentages, and calculate a weighted outcome

import random

elapsed = 0
duration = 0 #int(input("Enter duration: "))

while(elapsed < 840): # While the elapsed time is < 14 minutes
    print("nEnter probabilites, smallest first (0 for unused edges)...")
    # Enter each (accumulative) probability weighting (%)
    val1 = int(input("Weighting A: "))
    val2 = val1 + int(input("Weighting B: "))
    val3 = val2 + int(input("Weighting C: "))
    val4 = val3 + int(input("Weighting D: "))
    val5 = val4 + int(input("Weighting E: "))

    def makeRandom():
        randomVal = random.random() # Generate a random 'deciding' value
        randomVal = round(randomVal*100) #Scale it to a %

    randomX = makeRandom()

# Compare the randomX value to the probability boundries:
    if(randomX <= val1): print("Outcome A") elif (randomX > val1) and (randomX <= val2): print("Outcome B") elif (randomX > val2) and (randomX <= val3): print("Outcome C") elif (randomX > val3) and (randomX <= val4): print("Outcome D") elif (randomX > val4) and (randomX <= val5): print("Outcome E") # Add the duration of the selected edge to the elapsed time duration = int(input("Enter duration: ")) elapsed += duration print("Elapsed time: ", elapsed/60) # Repeat until we reach > 14 minutes

Magic Squares

Sitting in on some undergraduate composition lectured this year, using it as a chance to brush up on some things I was never formally taught. This is particularly beneficial to my knowledge of acoustic contemporary composition (as opposed to the electroacoustic side of things). Yesturday I sat in on a lecture on Maxwell Davies’ use of Magic Square number patterns in Ave Maris Stella (1975; chamber ensemble). I wrote a little python script to generate any odd-order sized square (n), and a the values with modulo wrap (where modulo = n):

# solves magic square for odd-ordered grid sizes
# owmtxy 17/10/2012
# for python v.2.6.6

n = int(input("Enter (odd) order size (n): "))
square = []
def calculateSquare(row,col):
val = n*((row+col-1+(n/2))%n) + ((row + (2*col)-2)%n)+1;
return val

#Create Array
print "Magic",n,"*",n,"Square Array:"
for i in range(n):
for j in range(n):

# Print array in a nice n*n grid
for k in range(n):
print square[k*n:(k*n)+n]

print "n Modulo",n,"Array:

#Create Array of modulo values
modSquare = []

for i in range(n):
for j in range(n):
modulo = (calculateSquare(i+1,j+1)%n)

# Print array in a nice n*n grid
for k in range(n):
print modSquare[k*n:(k*n)+n]

To model Maxwell Davies’ use somewhat, a regular n x n grid is drawn up, and a melody of length n is written to the top row of the grid. Each row is then transposed (using the interval of that top-line melody), the pitch of cell i comes from cell i-(n-1). In a 7×7 grid, the starting pitch of the second row (cell 8), comes from cell 2. Our magic square layout is then used to re-map these cells into a new order, giving us a magic square of pitch classes.

My plan is to use this grid in conjunction with some form of cellular automata to select or ‘activate’ cells of the magic square.