P D M

From Wiki.q.c

Jump to: navigation, search

Perpetual Dance Machine is an attempt to create a procedural dance music generator. It is written in the ChucK programming language, and it perpetually creates not-grooves.

Contents

The Original Idea

The core was that I wanted to simulate the effect of a live band experimenting together. Because of the fact that I wanted to do this procedurally and continuously (instead of, say, by actually paying a band to play until they dropped) I decided to go with dance music, since it is less frowned upon for it to be electronic sounding. Also, dance music requires simple rhythms and long arcs that lend themselves to continuous mild shifting about.

Implementation

The two core aspects of this shifting about are tempo variations and tonal/pitch variations, with a significantly more complex possibility being melodic and even thematic variation. ChucK lends itself extremely well to tempo variations, the language's strong sense of time and variety of methods of working with it (it is a fundamental type, and it is the primary means of making music happen) make it possible to do things naturally and legibly that would require conceptually and syntactically complex code in, for example, python and csound. So I got tempo variation working extremely quickly.

Issues

Of course, creating actual "beats" requires a couple of interesting things: a decent understanding of what the numerical representation of sound looks like and a good (couple of) "thump" sounds. I lack the former and ChucK lacks the latter. There was a frustrating couple of weeks in the beginning of this project where I had a fantastic dialtone simulator, with occasional break into high-gain cracking, and not much else.

So, this led to extremely long periods of time spent doing very little, a few hours getting a sound to not click, another few researching various properties of sound, time spent playing with every single filter and unit generator and virtual instrument in ChucK trying to get something with a little thump. I have, thus, learned more about music and sound in the last three weeks than I did in the entirety of my life so far; so even though the project is not very close to what I was aiming for it has certainly provided me with a great basis for continuing on.

ChucK also has a couple of qualities that make it simply not very friendly to work with: the virtual machine doesn't allow shreds (the jargon for an active script) to communicate between themselves, all variables and objects (except now, and that is just a universal variable) are document local. This extends to mean that there is no equivalent of python's import or c's header files, so all inter-function communication must be contained to one file. That is not impossible to deal with, but it makes semantic groupings of code somewhat hard.

Future Directions

Lots. First things first, make it sound good and party-like. I'm not giving up until this is more than satisfiable. I would also like to fulfill all of my original goals which means the following should all be in place:

  • Variable tempo, and a multitude of different transitions between tempos. Right now this is the most successful bit, and it sort of exists. There are a variety of tempos that can exist, and there are at least 3 different transitions between tempos.
  • Multiple pitches/chords for the "song" to exist in. This is conceptually easy to do, and there are in fact a couple parts of the script that do jump around between octaves and pitches. However, setting up multiple chord structures led to segmentation faults or array_out_of_bound errors in all my implementations. So, I think i'm doing something wrong, although one of my early attempts to mess around with arrays turned out to be me trying to do something that ChucK doesn't know how to do, so I could be wrong about that.
  • A variety of melodies that play at different times. This exists and is basically just a matter of calling functions. Conceptually and structurally easy, if I could make anything that sounds good.
  • Interesting transitions between a variety of melodies. Jerky transitions are pretty easy to pull off, but they are extremely sudden, creating procedural transitions between arbitrary melodies is basically my ultimate goal. This is conceptually and structurally difficult. This does not exist at all.

Links

Personal tools