Category Archives: Tools

String harmonics, multiphonics and partials map {Processing}

double-bass-E1-string-harmonics-snip

There is some excellent research on performance techniques over at CelloMap.com on a variety of subjects, but the area of most interest to me lately has been string multiphonics. A criminally overlooked and beautifully fragile technique.
It seems a slightly murky area (a lot folk-lore, hearsay, speculation), but an interesting one that I hope people continue to plug away at. The two best resources I’ve found so far are Ellen Fallowfield and Thomas Resch’s aforementioned Cello Map project, and Seth Josel and Ming Tsao’s excellent new book The Techniques of Guitar Playing (2014; Bärenreiter, pp.118-24). Both map out the location of their partials in similar ways. Despite the different instruments the authors address, we are ultimately just dealing with a vibrating string and as such should not be too difficult to figure out…

double-bass-E1-string-harmonics

A recent composition of mine, yet another example of the porousness of certain borders (score .pdf, 15mb) for solo double bass uses quite a few multiphonics, and as part of the composing process I created a little Processing script which uses the Cello Map scheme. The script allows one to calculate and map out (theoretical) partials for a string of any tuning (my piece was initially going to feature some evolving scordatura but this was written out early on).

The benefit of coding this out that you can quickly generate a partial map of any tuning and as many partials as you like (though by default this is capped at 15, past then it gets tricky to find what you’re looking for). This becomes pretty helpful when searching for and identifying clustered sounding partials within multiphonics. It is worth noting however, that this is all fairly theoretical, and that real-world physics may not play as nicely on your string of choice…

You can find the script on my GitHub page. The script requires Processing, a free, open-source programming language.

My thanks to the Cello Map project for doing all the hard work on this and many other subjects.

 

Networked Performance Stopwatches [Application]

For some forthcoming recording sessions, I figured it might be useful for performers to have personal clocks which are all synced. It saves everyone craning necks to see one on the wall, or using ill-synced stopwatches…

slave_timer

Here is a little quick and dirty Processing sketch using Sojamo’s brilliant OscP5 library to multicast.

One computer runs the ‘Master’ clock, while the others run as ‘slave’ clocks. The Master can start, stop/reset to all clocks on the same network/port. WARNING: this isn’t a particularly clever/efficient design, it may well drop out, miss times, get out of sync, etc…

The processing files are up on GitHub: master / slave

For non-Processing users, you can download pre-compiled versions (approx 6MB each) of the app:

Master clock
MacOSX
Windows
Linux

Slave clock
MacOSX
Windows
Linux

I’m also working on an Android version for something that sits a little better on music stands for those not already using laptops…

EDIT: The Android version is now online and freely available on the Google Play store! Its just the slaved clock at the moment, but you can read off your phone or tablet perched on the edge of a music stand or something!


Android app on Google Play

Rounding-off spectra… [Python]

A handy little tool I knocked up last night to round-off a generated harmonic series to the nearest semi-tone (and output as a named note (C,C#,D,…) to a .txt file. Written in python, give it a root frequency, and the length of the number of partials you want to calculate.

[sourcecode language=”python”]

Handy tool for generating a harmonic series above a given root,

and then rounding out to the nearest 12-TET semitone.

owmtxy, 2013

python v.2.7.5

import math

root = input("Root frequency: ")
length = input("Spectra length: ")
freqSpectra = []
noteSpectra = []

Write out to a .txt

file = open(‘harmonic_spectra_’+str(root)+’Hz.txt’, ‘w’)

Define note names

noteName = [
‘C’, ‘C#’, ‘D’, ‘D#’, ‘E’, ‘F’,
‘F#’, ‘G’, ‘G#’, ‘A’, ‘A#’, ‘B’]

convert freq to pitch method (inc octaves)

def freq2pitch(freq):
pitch = 12 * math.log(freq/261.626) / math.log(2) #calculate relative to middle C4
note = noteName[int(round(pitch)) % 12] #get name
octave = (int(round(pitch)) / 12)+4 #get octave, offset from C(4)
return str(note + str(octave)) # no. semitones relative to C4

for i in range(1,length+1): #give >length< partials above root
freqSpectra.append(rooti)
noteSpectra.append(freq2pitch(root
i))

print out data to .txt

print(‘Spectra as frequency (Hz) / closest note:’)
file.write(‘Partial t Freq t Note n’)
for i in range(length):
txt = str(i+1)+"t"+str(freqSpectra[i])+"t"+str(noteSpectra[i])+"n"
print i+1, "t",freqSpectra[i], "t", noteSpectra[i]
file.write(txt)

file.close()

[/sourcecode]

GitHubbed here.

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 were being faced with a probabilistic decision… being that musicians are not computers (shame), 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
# 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 %
        return(int(randomVal))

    randomX = makeRandom()
    print(randomX)

# 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

Compare Spectra

A neat little way of visually comparing two harmonic spectra.

spectra_83.53125-105.6

EDIT: As you may have noticed – the comparison is somewhat flawed due to my method of scaling. [what a fool]. Sit tight until I change this!

Unfortunately, I’ve had to depreciate the logarithmic scale used in the image below as it was causing some problems with the comparisons. The new version (pictured above) now works on a linear scale. :'(

spectra_122.03125-78.1

Move the mouse to alter the fundamentals of each spectra (X-axis is the ‘top’ spectrum).

Hit “S” to save the comparison as a .pdf file.

Processing files: compare_Spectra.zip

 

Serial Matricies and GitHub stuff

Just a quick .js for Max to generate a Serialist matrix based on a given tone-row. I’ve setup a little github (I’ve never done this before, so apologies if something isn’t quite there). The plan is to use this in conjunction with the Magic squares stuff mentioned in the last post.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Serialist Transposition Matrix
// owmtxy
// Create a Serialist transposition matrix based on initial tone row (input via message list)
// for Max/MSP [js] – add a message for tone row: pitches in numerical format 1-12
inlets = 2;
outlets = 2;
this.autowatch = 1; // auto-comile script when saved
var toneRow;
var serialMatrix = [];
var n;
function matrix(){
n = toneRow.length;
for(var i=0; i<n; i++){
for(var j=0; j<n; j++){
var x = toneRow[i] + toneRow[j];
serialMatrix.push(x%12); // wrap values at 12
}
}
}
function list(){
toneRow = arrayfromargs(arguments);
}
function bang(){
serialMatrix = [];
matrix();
outlet(0,serialMatrix);
}
// output into a jit.fill >> jit.matrix >> jit.cellblock or something.