machine learning panel

Panel discussion on neural stuff. Jan is speaking about self organizing maps, which is a talk he gave at brum last term.
He’s making snapshots for presets. It can be used to find similar presets. That are like ones he likes.
It creates a meta controller, which is more high level.
He can use it to make sound objects.
And it’s bewtween top down and bottom up appraoches.
He’s got a graph on how he uses it. He plays with it to make snapshots. The snapshots are fed into the som which generates simlar material, which he can use for a meta controller. He can make a map of material amd then make a path to traverse the map andthen control where he is on the the path with a slider.
Soms can be used to control anything, including each other.
A snapshot can be an array or an event. His examples use ron’s preset library.
it is an unsupervised neural network.
SynthDescLib lets you make a gui with preset. Or maybe this is jan’s code lib. There is a button to generate a som from presets in the gui. And a matrix comes up. Some of them are green, which are the ones he picked. The others are related. As you click on them it saves your path. There is a slider at the top that moves through the path. You can save your state.

now dan stowell is recapping and he has made soms as a ugen. He is showing the thng he did at the london sc meetup. It runs on the server and gets trained in advance by ana;yzing samples.

it imposes the eq of one sample onto another sample. Which works and is impressive. The som has a visua;izer. Pretty. It is not for download. I find his gui is set up kind of in reverse of how i’d think about it.

too much coffee for me. Pee break now. Ok back.

david has a flickr feed live from here

now nick collins is showing his work on the topic. He’s got an som implementation too. With a helpfile. He analyzes midi files. He breaks them up into little bits. He will release his files shortly.

now he’s talking of reenforcement learning, which is a way of considering an agent acting in the world. (See david’s photo of the slide) a state leads to an action, which in turn effects tje world which changes the state. Reenforcement learning looks at how effective actions are. So the program must have an idea of the world. This must also have a way of grading the reward of how good the world is. So you need to decide if something sounds good.

he has sc code to deal with this. LGDsarsa is on his website.

because machine learning is computationally expensive, it’s often farmed out to an external batch process. Or you can run in non rt mode. Dan has a nice ugen for this called Logger. Thete’s code examples on the mailing list. It creates data files which can then be used for machine learning.

he’s got a self similarities table for a pixies track.

ok, on to the more panelly part

how do you get the reward state in sarsa? Physiological monitoring is one way. Or you can ask the audience which has a delay, but propgate backwards. Or you can do it in a model.

jan is doing a project with thom which is similar but will generate full pieces. Nick reccomends tom mitchells book on machine learning.

why is a reward better than a rule? Why is it more interesting to train a net vs creating rules? Answer is that they can be used for different applications. Ron notes that rules are implicitly present in selection of training material and assumptions. Nick is talking about flexibility and creative machines. Dan says that ron is correct, but the number of possibi;itites in even a small data set is huge. Ron says constraints are cool. Te panel says that supercollider is cool

james, or leader, is talking about intent. What if we inverted rewards to make the audience unhappy? Nick points out it’s still hard to gauge cultural preferences.

there’s a question about specificity vs building an overly large tool. Jan agrees this is a trap. Nick says that specificity is more musically effective. He talks about hard coding. There’s too much variation sometimes.

performances with live evoluion. Using a human as a fitness fnction is slow. Nck talks abut a cmputer as an impovisor. His phd does this, whch you can download. He’s switced to midi becaus featurewards extraction is hard. Jan s talking abut having few slders.

neural network and machine learning

Live blogging the sc symposium
i showed up late for the talk on neural networks, which sucks, but i needed my coffee.
Tje speaker is demonstarting using a neural network to process gestural input from a wiimote. It makes 64 vectors describing the motion of the wimotes. He can train the neural net by making the same gesture over and over.
The auditorium speakers are making a high pitched squeal.
Now he’s talking about continious time recurrent nueral networks. These are used in robotics. They evolve instead of being trained. (Trained ones are called feet forward)
Ollie Brown did some code for this. He sugges that the smoothibg function be rep;aces with hyperbolic tans and become excitation functions and it does not reach equilibrium. You can use this for interactive evolution.
Squeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeazle.
The 60 hz hum has just caused a problem with the demo. The power to the av thing has cut out. Ron is cursing. People in the audience are whistling difference tones to go with the squeal. Somebody od making multiphonics. Now somebody is playing a sine tone on their laptop. Somebody is sampling and granularizing the feedback. The talk has paused. I wish i’d been here for the start because it’s awesome, but without coffee, i’d still have missed it.
A grad student has just come sprinting in with a cable. And the squal has ceased! Applause!
And the source of the squeal was an uniterruptible power supply. Which is why the av input died. Ohhhhhh! We are nearly back online. I wish this disaster had been at the start so i could have seem the whole thing.
The presenter, by the way is Chris Kiefer. Who is now resuming.
He is using a ctrnn to control a synth. And it can be reinitialized and mutated. This sounds cool, but i don’t under stand how it differs from random numbers. Oh, you pick ones you like and evolve from there.
Http://bit.ly/SC-NNs
http://bit.ly/SC-CTRNNS
HTTP://www.olliebrown.com/files/papers/ . . .

Twitter Supercollider App

There are some people twittering supercollider code. They do sound generating apps in 140 characters or less! I’ve just created some code to fetch and play these. It uses a yahoo pipe which looks for tweets tagged with and which seem to contain a playable piece of code. It also does some sanitizing to ignore potentially evil content.
This is a first draft, so it requires a helper script, written in bash, which is called fetch.sh:

#!/bin/bash

curl http://pipes.yahoo.com/pipes/pipe.run?_id=sqg4I0kl3hGkoIu9dPQQIA&_render=r
ss  >   /tmp/rss.xml

The SC code is:


(
r = { 


 Routine.new({
 
  var code, new_code, syn, doc, elements;
  
  inf.do({
  
   "fetching".postln;
  
   "/path/to/fetch.sh".unixCmd;
   
   doc = DOMDocument.new("/tmp/rss.xml");
   doc.read(File.new("/tmp/rss.xml", "r"));
   elements = doc.getElementsByTagName("description");
   
   
   elements.notNil.if ({
   
    new_code = elements.last.getText;
   
    ((new_code == code).not).if ({
   
     code = new_code;
   
     code.postln;
      
     (syn.notNil).if ({ syn.free; s.freeAll; });
     syn = code.interpret;
    });
   });
   60.yield;
  });
 });
 
};

)

r.play;

Replace the path information with the correct one, start the server, select all the code and hit enter. If you find a bug or a way to be evil, please leave a comment.

sc3 keynote

Live blogging sc symposium

keynote

as an aside, david has a tiny sc logo on his badge. Ha ha.

Ron has given an intro and now scott wilson and nick collins are talking about tje supercollider book, coming from mit press. It’s like the c sound book, but for supercollider.

The book is cool. You should buy it.

James McCartney is giving a keynote about single sample code synthesis. He did a 1 sample at a time server in 2001. Synthdefs were c functions. The code is lying around on his website. It doesn’t work and there are missing pieces and is not the same version that he’s talking about.

The current version does block processing. It does a bunch of samples at once. ChucK does single sample, but most do block.

The single sample version of sc has lower performance. And compiling synths took too long. This might not be the case today. It had the same architecture as the current version. There was no distinction between audio rate and control rate, since everything gets evaluated on every sample. You could do one sample feedback.

The whole thing was written in sc. It made c++ code for synthdefs, which was then compiled. He’s showing us what the code looks lile. It looks like c++. Actually, it looks like source for ugens now.

The sc code for ugens returns strings for code generation. This doesn’t need primatives, because the c code is in the sc class. But it’s still c code. This would really not be easier to write, since you wou;d need to know tje structure of the generated code. It would have been beyter to have meta code to describe how the ugen should work.

He’s showing us the source code for his project and now going to tell us why this is a bad idea. This is an unusual keynote. Now he’s telling us about memory issues and registers. Now he’s talking about vectorization and optimation. Now there’s a slid called ‘code pointer swapping.’ Now ‘instruction cacahe’

It might be ok to do single samples once in a while despite performance issues.

There’s a question about faust. He says its interesting and good.

Q: demand ugens can do single sample feedback as a hack, but its inefficient. Te solution is to write your own ugens in c because non block stuff is slow.

Another faust question. Functional programs parallelize better. But faust has no variable names but prefer not to. It makes me a bit dizzy, faust does.

Ron is asking a question about demand rate and jit code and other things that i don’t know how to use. Now ron is asking about synths that change rate on the fly. It’s hard.

Can you set the block size to 1 on sc now? Yes, but then you have chuck.

Unpopular Music

Once in a while, I get the idea of doing algorithmic pop music and labor intensely on it and then come up with something and then walk away horrified. So, um, if anybody’s interested, here’s the latest incarnation of this cycle: S’onewall.
The samples are recordings of the largest-ever transgender rights protest in the UK, which took place last month. And then there are drum beats. The bassline uses a subset of the Bohlen-Pierce scale, in just intonation, with notes chosen according to a variation of Clarence Barlow’s “digestibility” formula. To determine the relative consonance of two ratios, divide one by the other and then take the result and add the numerator to the denominator. A lower number indicates greater simplicity of the result and thus a higher degree of consonance. There is ugly code, available for your perusal. Quick examples are at the bottom of this post.
This is not on my podcast because I’m not so into it. I have ideas of what might fix it, but I suspect those ideas are wrong and it’s taken up so much time already. However, as un-enthused as I am, I think somebody, someplace might want to remix this. Or maybe I’m flattering myself.
I wish I could offer the pieces sent to different tracks, but, ha ha, the only way I could get this to record was with Audio Hijack, because there’s a logic problem somewhere in the code which causes it to hang right at the end and chasing that bug is just more trouble than it’s worth.

Code Example

Ok, using the ScaleLattice: First declare a scale with some ratios in it:

 ~scale = ScaleLattice([[1, 1], [11, 9], [9,7],  [7,5], [5, 3], [9, 5], 
     [11,5], [7,3], [27, 11], [27, 25],  [25, 9]], 3);

That’s not the scale from the piece, but it’s also a nice one. We can then try to construct a melody, by getting some step-wise motion:

 ~melody = ~scale.getNsteps(4);

And them maybe jump to the most consonant note from the tonic, followed by one step down:

 ~melody = ~melody ++ ~scale.getIstepsBelowJconsonance(2, 0);

Um, and then let’s get the most consonant pitch from the last one in the melody:


 ~melody = ~melody ++ ~scale.consonanceAtFloat(0, ~melody.last);

Yeah, this probably sound bad, but we could play it:


 Pbind(dur, 0.3, freq, Pseq(~melody * 440, 1)).play;

I have a hypothesis that with the combination of relative consonances and stepwise motion, you could abstract music theory to the point where you could construct a meaningful melody from an arbitrary scale. Such that the program doesn’t know the scale ahead of time. The missing piece is notes that are too close to each other, which I suspect will have very high relative dissonance. I may think on this further, or I might go back to doing whatever else it is that I do.

It’s Alive!!

Remember, back in 2004 – 2005 I was working on the SuperCollider tutorial of doom? It was going to be my thesis, but, alas, it was not meant to be.

It turns out that writing tutorial chapters is actually a great way to procrastinate. It sort of feels like I’m working on music, but without actually making any sound (alas, this has a lot in common with certain pieces I’m writing). So the project is alive right now.
If you are interested in alpha-testing these chapters as I write them, please leave a comment. The intended audience is people who have never programmed before (and MAX users). If you have never before used SuperCollider in your life, I have the tutorial for you! Or, if you’ve tried and become confused. Or if you just want to see a different way of approaching the language.
Alas, most music professors have never taught (or taken) a regular computer science class. My goal is to convey all the important CS concepts, but in a way that’s immediately useful to musicians. Hopefully, if you follow the tutorial, at the end you’ll not only be able to make some cool sounds in SuperCollider, but you’ll be able to quickly grasp other object oriented languages, like Java (which is actually a very useful second language for SC programmers who want to add visual components to their work).
I’m re-writing them to be more sound focussed than last time. I’m starting users with Pbinds, which are a way of handling note creation and timing and are fast and easy despite being kind of weird. So I need n00bs. Pass it on.

HIDden Options

I’m trying to plug a new joystick into SuperCollider. I got a Logitech Attack 3 joystick which I want to do a short act with, maybe next week at a drag king bar. But I can’t get SuperCollider to talk to it.

The newer version of SC broke all of my joystick code. That’s fine, except I can’t get the newer stuff to work. When I try running the examples under GeneralHID, it can see my joystick and knows about all the buttons and the XYZ stuff, but it doesn’t seem to notice when I push one of those buttons or wiggle the stick. I tried the joystick briefly with JunXion, so I know it works, but SC just isn’t getting data from it.
I wonder if there’s some sort of trick or secret to this? I had to switch my audio stuff to an aggregate device to read in and out. Is there something like that for HIDs? Some secret magic?

Algorithmic dance music generation

Nick Collins

His laptop is signed by Stockhausen.

He wrote a techno generator 10 years ago, which was silly. So he’s trying it again, but with synthpop. The new project is called Infno.

When you press play, you want something that’s different every time in a significant way. (This sounds like old school video game music.)

Whoah, it really is different everytime! Still video-gamey, though. This has garnered applause from the audience.

The lines all know about each other and share data. The order of generation matters.

This is really cool.

Also, he has the idea of generative karaoke! Ooh, now there is audience participation. More applause.

This is the coolest thing ever.

There is a computer-written pop song from 1956. Kako will be singing the lyrics from that song. The melody here is not known in advance.

This sounds like jpop. Also like drunken karaoke. Wow, a lovely disaster. I am in love with everything about this. The singer is muddling through. Wow, now she’s getting it, sorta.

Applause and cheering.

Now he’s playing techno.

More applause.

Algorithmic lyric generation is next!

A paper will be forthcoming.

Loris: a supercollider implementation

Scott Wilson

Loris is an additive sound modelling method.

A sines plus noise approach. Noise is assigned to partials, modulating partials with a filtered noise source. This is a lossy process but is perceptually accurate.

Loris is a class library which can do some interesting things with partials. The python api is very good.

Data is exportable in several formats. Spear, a piece of free software, is nice for editing some of these file types. Also the command line tools are good.

Loris was not developed for real time use. It’s not fast to compute this kind of analysis. Sometimes, you must change params to get a good analysis, which can be a problem for real time. Also, in real time might not want to listen to every partial, but that’s also computationally expensive.

Analysis yields a partial list with envelopes for freq, amp, bandwidth, phase, etc.

Scott sticks analysis results in an sc object. There are 4 classes. Some ugens, data-holding classes, an oscillator.

The oscillator does all the partials. Can do some spectral difusion.

Can stretch stuff, mess with bandwidth, do funny things with different partials to move them around. This may work with prevois topic.

New release forthcoming. This is cool.

Dissonance curves

Jaaun Sebastian Lach

Roughness or beating is equal to hz difference betwwen two sounds. Has to do with physical properties of the ear and the critical bandwidth- which is the width of hearing of discrete sounds. You can only hear one sine wave per critical bandwidth. The bark scale climbs the critical band.

Disonance is perceived from bark scale and also cultural factors. Bark scale also applies to partials and overtones. Helmholtz held that acceptable amounts of roughness are cultural.

This speaker has a Disonance class, which looks to be very interesting. Also has method barkToHerz

Tenney thought that consonance and dissonance meant diferent things in different contexts. The terms have a functiona; usage depending on how music is composed: hisorical systems.

Barlow has some fancy-sounding theories. He imagines a consonance-disonance axis.

The Dissonance class can be used to derive scales. I must have this class!!

Sethares holds that tunings are related to timbres of instruments. Scales are derived according to roughness of partials present in the instruments used.

Computer composers can use a tmbral grammar. The presenter has some real-time analysis. He’s been doing this stuff while i’ve been navel gazing about it. Awesome.