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

Dave Benjamin ramen at lackingtalent.com
Sun Jan 18 14:42:58 EST 2004


In article <400a7a92$0$205$edfadb0f at dread12.news.tele.dk>, Max M wrote:
> 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 figured... =)

> 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.

So, a data-flow style more or less... that seems to be a useful model for
music software. Have you ever played around with Max?

> 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.

Yeah, makes perfect sense to me. Do you have any Python-generated songs
available? Sounds really cool.

The thing I was working on was a probabilistic beat generator, based on
statistics of when a certain drum would hit in a beat for a selection of hip
hop songs. I was trying to capture the "feel" rather than the exact sequence
of sounds. I still have the (tcl) source laying around here somewhere. It
worked pretty well on Linux (I could actually get it to beat-match) but in
Windows the performance was terrible. Which is probably because I'd have to
be out of my mind to think I could get realtime performance out of Tcl. ;)

Thanks, Max...

-- 
.:[ dave benjamin (ramenboy) -:- www.ramenfest.com -:- www.3dex.com ]:.
: d r i n k i n g   l i f e   o u t   o f   t h e   c o n t a i n e r :



More information about the Python-list mailing list