My Talk at the Sc Symposium

Picking Musical Tones

One of the great problems in electronic music is picking pitches and tunings.

The TuningLib quark helps manage this process.

First, there is some Scale stuff already in SuperColider.
How to use a scale in a Pbind:

(
s.waitForBoot({
     a = Scale.ionian;

     p = Pbind(
          degree, Pseq([0, 1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1, 0, rest], 2),
          scale, a,
          dur, 0.25
     );

     q = p.play;
})
)

Key

Key tracks key changes and modulations, so you can keep modulating or back out of modulations:

k = Key(Scale.choose);
k.scale.degrees;
k.scale.cents;
k.change(4); // modulate to the 5th scale degree (we start counting with 0)
k.scale.degrees;
k.scale.cents;
k.change; // go back

k.scale.degrees;

This will keep up through as many layers of modulations as you want.

It also does rounding:

quantizeFreq (freq, base, round , gravity )
Snaps the feq value in Hz to the nearest Hz value in the current key

gravity changes the level of attraction to the in tune frequency.

k.quantizeFreq(660, 440, down, 0.5) // half way in tune

By changing gravity over time, you can have pitched tend towards being in or out of tune.

Scala

There is a huge library of pre-cooked tunings for the scala program. ( at http://www.huygens-fokker.org/scala/scl_format.html
) This class opens those files.

a = Scala("slendro.scl");
b = a.scale;

Lattice

This is actually a partchian tuning diamond (and this class may get a new name in a new release)

l = Lattice([ 2, 5, 3, 7, 9])

The array is numbers to use in generated tuning ratios, so this gives:

1/1 5/4 3/2 7/4 9/8   for otonality
1/1 8/5 4/3 8/7 16/9  for utonality

otonality is overtones – the numbers you give are in the numerator
utonality is undertones – the numbers are in denominator

all of the other numbers are powers of 2. You could change that with an optional second argument to any other number, such as 3:

l = Lattice([ 2, 3, 5, 7, 11], 3)

Lattices also generate a table:

1/1  5/4  3/2  7/4  9/8
8/5  1/1  6/5  7/5  9/5
4/3  5/3  1/1  7/6  3/2
8/7  10/7 12/7 1/1  9/7
16/9 10/9 4/3  14/9 1/1

It is possible to walk around this table to make nice triads that are harmonically related:

(
s.waitForBoot({

 var lat, orientation, startx, starty, baseFreq;

 SynthDef("sine", {arg out = 0, dur = 5, freq, amp=0.2, pan = 0;
  var env, osc;
  env = EnvGen.kr(Env.sine(dur, amp), doneAction: 2);
  osc = SinOsc.ar(freq, 0, env);
  Out.ar(out, osc * amp);
 }).add;

 s.sync;


 lat = Lattice.new;
 orientation = true;
 startx = 0;
 starty = 0;
 baseFreq = 440;

 Pbind(
  instrument, sine,
  amp, 0.3,
  freq, Pfunc({
   var starts, result;
     orientation = orientation.not;
     starts = lat.d3Pivot(startx, starty, orientation);
     startx = starts.first;
     starty = starts.last;
   result = lat.makeIntervals(startx, starty, orientation);
   (result * baseFreq)
  })
 ).play
})
)

Somewhat embarrassingly, I got confused between 2 and 3 dimensions when I wrote this code. A forthcoming version will have different method names, but the old ones will still be kept around so as not to break your code.

DissonanceCurve

This is not the only quark that does dissonance curves in SuperCollider.

Dissonance curves are used to compute tunings based on timbre, which is to say the spectrum.

d = DissonanceCurve([440], [1])
d.plot

The high part of the graph is highly dissonant and the low part is not dissonant. (The horizontal access is cents.) This is for just one pitch, but with additional pitches, the graph changes:

d = DissonanceCurve([335, 440], [0.7, 0.3])
d.plot

The combination of pitches produces a more complex graph with minima. Those minima are good scale steps.

This class is currently optimised for FM, but subsequent versions will calculate spectra for Ring Modulation, AM Modulation, Phase Modulation and combinations of all of those things.

(

s.waitForBoot({

 var carrier, modulator, depth, curve, scale, degrees;

 SynthDef("fm", {arg out, amp, carrier, modulator, depth, dur, midinote = 0;
  var sin, ratio, env;

  ratio = midinote.midiratio;
  carrier = carrier * ratio;
  modulator = modulator * ratio;
  depth = depth * ratio;

  sin = SinOsc.ar(SinOsc.ar(modulator, 0, depth, carrier));
  env = EnvGen.kr(Env.perc(releaseTime: dur)) * amp;
  Out.ar(out, (sin * env).dup);
 }).add;

 s.sync;

 carrier = 440;
 modulator = 600;
 depth = 100;
 curve = DissonanceCurve.fm(carrier, modulator, depth, 1200);
 scale = curve.scale;


 degrees = (0..scale.size); // make an array of all the scale degrees


// We don't know how many pitches per octave  will be until after the
// DissonanceCurve is calculated.  However, deprees outside of the range
// will be mapped accordingly.


 Pbind(

  instrument, fm,
  octave, 0,
  scale, scale,
  degree, Pseq([
   Pseq(degrees, 1), // play one octave
   Pseq([-3, 2, 0, -1, 3, 1], 1) // play other notes
  ], 1),

  carrier, carrier,
  modulator, modulator,
  depth, depth
 ).play
});
)

The only problem here is that this conflicts entirely with Just Intonation!

For just tunings based on spectra, we would calculate dissonance based on the ratios of the partials of the sound. Low numbers are more in tune, high numbers are less in tune.

There’s only one problem with this:
Here’s a graph of just a sine tone:

d = DissonanceCurve([440], [1])
d.just_curve.collect({|diss| diss.dissonance}).plot

How do we pick tuning degrees?

We use a moving window where we pick the most consonant tuning within that window. This defaults to 100 cents, assuming you want something with roughly normal step sizes.

Then to pick scale steps, we can ask for the n most consonant tunings

t = d.digestibleScale(100, 7); // pick the 7 most consonant tunings
(
var carrier, modulator, depth, curve, scale, degrees;
carrier = 440;
modulator = 600;
depth = 100;
curve = DissonanceCurve.fm(carrier, modulator, depth, 1200);
scale = curve.digestibleScale(100, 7); // pick the 7 most consonant tunings
degrees = (0..(scale.size - 1)); // make an array of all the scale degrees (you can't assume the size is 7)

Pbind(
 instrument, fm,
 octave, 0,
 scale, scale,
 degree, Pseq([
  Pseq(degrees, 1), // play one octave
  Pseq([-7, 2, 0, -5, 4, 1], 1)], 1), // play other notes
 carrier, carrier,
 modulator, modulator,
 depth, depth
).play
)

Future plans

  • Update the help files!
  • Add the ability to calculate more spectra – PM, RM AM, etc
  • Make some of the method names more reasonable

Comments

Comments from the audience.

  • key – does it recalc the scale or not? Let the user decide
  • just dissonance curve – limit tuning ratios
  • lattice – make n dimensional
  • digestible scale – print scale ratios

Sc symposium – chris brown – ritmos

software to explore perception and performance of polyrhythms
inspired by afro-cuban music
ritmos can play in polyrythmic modes and can listen to a live input. It deals with a difference between a player and a clave.
this was first implemented in HMSL!! As a piece called Talking Drum.
Branches is in sc2 and is in the same series of pieces.
so now there’s a new version in sc3.

classes

RitmosPlay defines a voice stream heirachy and scheduling
RitmosCtlGUI
RitmosSeqGUI
RitmosSynthDefs
RitmosXfrm F interaction algorythms
MIDIListener
he uses a genetic algorithm to balance between the specified clave and the input.
he’s got presets and sequences that deal w current settings.
he’s going into a lot of detail about how this works. It’s complex.
this has an impressive gui. And indeed an impressive functionality. And sounds great.
graphics library… I wish i’d caught the name of…

Sc symposium – lily play – bernardo barros

music notation with supercollider
he used to use OpenMusic, but then moved to linux.
OpenMusic is IRCAM software in common lisp for algorithmic music composition. It looks like max, but makes notation.
SC can do everything om can do except the notation visualisation.
he uses LilyPond. INScore might be faster.
LilyPond is free and cross-platform. It’s simple.
He’s done 3 projects? superFomus and LilyCollider.

Fomus

Uses fomus (fomus.sf.net). Works with events and patterns. It outputs to lillypond and mjusescore
this is cool
he’s showing a useage case with xenakis’s sieves. He’s got some functions as sieves and then does set operations.
this doesn’t work well with metric structures. You’re stuck wrt bar lengths.

LilyCollider

division and addition models of rhythm
rhythm trees can represent almost all kins of rythm. It’s an array of duration and division that can be nested.
he is using a syntax that i don’t know at all… Someone in front of me has a help file open on list comprehensions.
he’s got a very compelling looking score open.
in future he wants to use spanners by abjad to handle some markings. And also he wants some help and feedback for future versions.

questions

can you use this to get from MIDI to LilyPond? Yes, with Fomus.
what about includes? You can make a template.

Live blogging the sc symposium – ron kuivila

naming is the fundamental control mechanism of supercollider (unnamed gets garbage collected).
‘play’ generates instances. It returns a new object of a different class, which confuses n00bs. What you see on the screen does not give you a clue.
The object that defines the work gets misidentified as the one doing the work.
jIT lib’s def classes solves this problem. It makes it easier to share code. Play messages go to the def class. The def classs gives it all a name.
node proxies give you a gui for free also and is also useful pedagogically.
PatternConductor is a interactive control easier than EventStreamPlayer. It deals better with sustain issues.
CV is a control value constrained by an associated Spec. CV can bbe applied to several different contexts simutaneously. Touch is a companion class that does something complex about a CV’s value.
Ron is rewriting Conductor and I should talk to him about this.
yield is a bummer for beginners writing co-routines.

x=(x**i).yield

is confusing.
Pspawnern is a class that seeks to be less confusing syntactically. It does something with Prouts that’s slightly confusing….
Syntactic convience yields conceptual confusion…
he’s asking if Pspawnern is a good idea.
Pspawner is a hybrid between patterns and Routines. One of my students would have loved this. He says it’s a compositional strategy about notation and direction in scores. I may also come to love this class.
And he took no questions!

Live Blogging Sc Symposium – Guitar Granulator by Martin Hünniger

He’s got a stomp box that granulates – he has a software and hardware version of this.
2 granulators, fx chains, midi controller knobs, patches etc in software
The hardware version has one granulator and some knobs.
It’s built on a beagle board. And an Arduino Uno for pots, leds
He uses SC running the BeagleBoard linux distro form Stanford. Works out of box. Satellite CCRMA
Granular synthesis is cool. He uses a ‘ring buffer’ because it’s live sampling. This is a buffer that loops.
This is really cool.

Live Blogging the Sc Symposium – Flocking by Colin Clark

Flocking – audio synthesis in javascript on the web

flockingjs.org
github/colinbdclark/flocking

audio synthesis framework written in javascript

specifically intended to support artists

Inspired by SC

Web is everywhere

programming environments that have graphical tools

Flocking is highly declarative

Synth graphs declares trees of names unit generators – you write data strictures, not code

Data is easy to manipulate

flock.synth({
  synthDef: {
    ugen: "flock.ugen.sinOsc",
    freq: 440
    mul: 0.25
  }
})

He skips the Rate:”audio” because that’s the default.
Modulation:

flock.synth({
  synthDef: {
    ugen: "flocl.ugen.sinOsc",
    freq: 440
    mul: {
      ugen:flock.ugen.line"
....
  }
})

It handles buffers and whatnot, but not multichannel expansion.
Scheduling is unreliable…but works

Renate Wiesser and Julian Rohrhuber: Meaning without Words

Last conference presentation to live blog from the sc symposium
A sonification project. Alberto de Campo is consulting on the project.
A project 7 years in the world, inspired bya test from the 70’s. You can distinguish educated and uneducated background based on how they speak. Sociologists picked up on this. There was an essay about this, using Chomsky’s grammar ideas. Learning grammar as a kid may help with maths and programming. Evidence of how programmers speak would seem to contradict this . . .
But these guys had the idea of sonifying grammar and not the words.
Sapir-Whorf: how much does language influence what we think. This also has implications for programming languages. How does your medium influence your message?
(If this stuff came form the 70’s and was used on little kids, I wonder if I got any of this)
Get unstuck form hearing only the meaning of words.

Corpus Linguistics

don’t use grammar as a general rule: no top down. Instead use bottom up! Every rules comes with an example. Ambiguous and interesting cases.

Elements
  • syntax categories – noun phrases, prepositional phreases, verb phrases. These make up a recurive tree.
  • word positon: verb, nouns, adverb
  • morphology: plural singular, word forms, etc
  • function: subject object predicate. <– This is disputed

The linguistics professor in the audience says everything is disputed. “We don’t even know what a word is.”
They’re showing an XML file of “terminals,” words where the sentence ends.
They’re showing an XML file of non-terminals.
Now a graph of a tree – which represents a sentence diagram. How to sonifiy a tree? There are several nodes in it. Should you hear the whole sentence the whole time? The first branch? Should the second noun phrase have the same sound as the first, or should it be different because it’s lower in the tree?
Now they have a timeline associated with the tree.
they’re using depth first traversal.
Now the audience members are being solicited for suggestions.
(My though is that the tree is implicitly timed because sentences are spoken over time. So the tree problem should reflect that, I think.)
Ron Kuivila is bringing up Indeterminacy by John Cage. He notes that the pauses have meaning when Cage speaks slowly. One graph could map to many many sentences.
Somebody else is recommending an XML-like approach with only tags sonified.
What they’re thinking is – chord structures by relative step. This is hard for users to understand. Chord structures by assigning notes to categories. They also though maybe they could build a UGen graph directly from the tree. but programming is not language. Positions can be triggers, syntax as filters.
Ron Kuivila is suggesting substituting other words: noun for noun, etc, but with a small number of them, so they repeat often.
They’re not into this, (but I think it’s a brilliant idea. Sort of reminiscent of aphasia).
Now a demonstration!
Dan Stowell wants to know about the stacking of harmonics idea. Answer: it could lead to ambiguity.
Somebody else is pointing out that language is recursive, but music is repetitive.
Ron Kuivila points out that the rhythmic regularity is coming from the analysis rather than from the data. Maybe the duration should come how long it takes to speak the sentence. The beat might be distracting for users, he says.
Sergio Luque felt an intuitive familiarity with the structure.

Martin Carlé / Thomas Noll: Fourier-Scratching

More live blogging
The legacy of Helmholtz.
they’re using slow fourier transforms instead of fft. sft!
they’re running something very sci-fi-ish, playing FM synthesis. (FM is really growing on me lately.) FM is simple and easy, w only two oscillators, you get a lot of possible sounds. They modulate the two modulators to forma sphere or something. You can select the spheres. They project the complex plane on the the sphere.
you can change one Fourier thing and it changes the whole sphere. (I think I missed an important step here of how the FM is mapped to the sphere and how changing the coefficients back to the FM.)
(Ok, I’m a bit lost.)
(I am still lost.)
Fourier scratching: “you have a rhythm that you like, and you let it travel.”
Ok the spheres are in fourier-domain / time-domain paris. Something about the cycle of 5ths. Now he’s changing the phase of the first coefficient. Now there are different timbres, but the rhythm is not changing.
(I am still lost. I should have had a second cup of coffee after lunch.)
(Actually, I frequently feel lost when people present on maths and the like associated with music. Science / tech composers are often smarter than I am.)
you can hear the coefficients, he says. There’s a lot of beeping and some discussion in german between the presenters. The example is starting to sound like you could dance to it, but a timbre is creeping up behind. All this needs is some bass drums.
If you try it out, he says, you’ll dig it.
Finite Fourier analysis with a time domain of 6 beats. Each coefficient is represented by a little ball and the signal is looping on the same beat. The loops move on a complex plane. The magnitude represents something with fm?
the extra dimension from Fourier is used to control any parameter. It is a sonfication. This approach could be used to control anything. You could put a mixing board on the sphere.
JMC changed the definition to what t means to exponentiate.
Ron Kuivila is offering useful feedback.

Alo Allik: Audiovisual Composition with Three-Dimensional Continuous Cellular Automata

Still live blogging the supercollider symposium
f(x) – audio visual performance environment, based on 3d cellular automata. Uses objective X, but he audio is in scserver.
the continuous cellular automata are values between 0 and 1. The state at the next time step is determined by evaluating the neighbours + a constant. Now, a demo of a 1-d world of 19 cells. All are 0 except for the middle which is 1. Now it’s chugging a long. 0.2 added to all. The value is modulus 1, to just get the fractional part. Changing the offset to 0.5, really changes the results. Can have very dramatic transitions, but with very gradual fades. The images he’s showing are quite lovely. and the 3d version is cool
Then he tried changing the weight of the neighbours, This causes the blobs to sort of scroll to the side. The whole effect is kind of like rain drops falling in a stream or in a moving bit of water in the road. CAn also change the effect by changing the add over time.
Now he’s demoing his program and has allowed us to download his code off his computer. Somehow he’s gotten grids and stuff to dance around based on this. “The ‘World’ button resets the world.” Audience member: “Noooo!”
Now an audio example, that’s very clearly tied in. Hopefully this is in the sample code we downloaded. It uses the Warp1.ar 8 times.
This is nifty. Now there’s a question I couldn’t hear. Alo’s favourite passtime is to invent new mappings. He uses control specs on data from the visual app. There are many many cells in the automata, thus he polls the automata when he wants data and only certain ones.
More examples!

Julian Rohruber: Introducing Sonification Variables

More sc symposium live blogging

sonification

Objectivity is considered important in the sciences. The notions of this have changed quite a bit over the last 50 years, however. The old style of imaging has as much data as possible crammed in, like atlas maps. Mechanical reproduction subsequently becomes important – photos are objective. However, perception is somewhat unreliable. So now we have structural objectivity which uses logic + measurements.
We are data-centric.
What’s the real source of a recording? The original recording? The performer? The score? The mind of the composer?
Sound can be just sound, or it can just be a way of conveying information or something in between. You need theory to understand collected data.
What do we notice when we listen that we wouldn’t have noticed by looking? There needs to be collaboration. Sonification needs to integrate the theory.
In sonfication, time must be scaled. There is a sonification operator that does something with maths. Now there are some formulas on his slide, but no audio examples.
Waveshaping is applying one function to another.
Theoretical physics. (SuperCollider for SuperColliders.) Particles accelerate and a few of them crash. Electrons and protons in this example. There’s a diagram with squiggly lines. Virtual photons are emitted backwards in time? And interacts with a proton? And something changes colour. There’s a theory or something called BFKL.
He’s showing an application that’s showing an equation and has a slider, and does something with the theory, so you can hear how the function would be graphed. Quantum Mechanics is now thinking about frequencies. Also, this is a very nice sounding equation
Did this enable discover anything? No, but it changed the conceptualisation of the theory, very slightly.
apparently, the scientists are also seeking beauty with sonification, so they involve artists to get that?
(I may be slightly misunderstanding this, I was at the club event until very late last night (this morning, actually).)
Ron Kuivila is saying something meaningful. Something about temporality, metaphilosophics, enumeration of state. Sound allows us to hear proportions w great precision, he says. There may be more interesting dynamical systems. Now about linguistics and mathematics and how linguistics help you understand equations and this is like Red Bird by Trevor Wishart.
Sound is therefore a formalisation.