Does anyone else not find the fun in programming...?

Max M maxm at mxm.dk
Sun Jan 18 07:23:11 EST 2004


Dave Benjamin wrote:

> In article <4004f5ac$0$69931$edfadb0f at dread12.news.tele.dk>, Max M wrote:

> What Python libraries do you use to do algorithmic composition? I played
> around with Snack (for Tcl) awhile back but couldn't get decent realtime
> performance so I gave up on the idea for the time being. I'm very interested
> to hear what sort of techniques you use.

First of I don't use realtime...

I create lists of notes::

class Note:

     def __init__(self, time=0, pitch=64, velocity=64, duration=96):
         self.time = time
         self.pitch = pitch
         self.velocity = velocity
         self.duration = duration

     def __str__(self):
         r = []
         a = r.append
         a('time %s' % self.time)
         a('pitch %s' % self.pitch)
         a('velocity %s' % self.velocity)
         a('duration %s' % self.duration)
         return '\n'.join(r)


That are then converted into midi files by a very simple wrapper layer.

This simple structure makes it extremely simple to create 
transformations on a list of notes. I considder each list a "part" like 
you see it in Cubase/Logic.

The idea is then to create a personal library of transformations and 
generators that expres your own musical style. I also have a few 
routines for repeating/extending/sequencing these parts.

I import these midi files into software like Cubase, or Reason or Orion. 
Where they drive either hardware or software synths.

I like to fiddle around with the sounds manually by twiddleling the knobs.

But I don't change the mnusic manually in the sequencer software. Rather 
i change the software and genereate a new midi file, that I reload.

It is a bit like writing code generators. And it is completely flexible, 
creative and fun due to the ease of Python.


regards Max M



More information about the Python-list mailing list