tags:

views:

138

answers:

6

Note: this is NOT a "music for programming" question.

My question is:

I want to write a computer program that can synthesize repetitive beats (which I can control via the command line) to pipe music into my ears.

I'm curious if there are existing tools to do this (and if not, what libraries to use).

The general idea is:

1) the computer knows what I'm doing (by the commands I'm running -- whether I'm in Vim, whether my programs are compiling, etc ..)

2) the computer knows my general mood (count number of compiler failures due to 'make'; number of segfaults, non zero exit codes; number of git commits)

3) the computer knows my brain state (depending on typing rate; I'm either coding or thinking)

I'd love to utilize them for some type of bio-feedback for controlling music.

This is also why the music needs to be programatically synthesized (rather than just some existing tracks).

Thanks!

+4  A: 

Hi,

For the actual music side of things, check out Chuck. It lets you programmatically synthesize sounds. Here's a YouTube video showing an example of Chuck at work. Another video highlighting how Chuck works and how to produce basic sounds.

keyboardP
+1 for ChucK...ideal for a proof of concept since it is available in open source. Although the devs appear to openly admit that it could blow up, you have the opportunity to see what you're working with and would be able to make improvements.
dboarman
I just wish my sound card wasn't broken so I could hear the YouTube clips... :/
dboarman
+3  A: 

archaeopteryx is probably pretty close to the beat generation part.

ergosys
+4  A: 

You have to :

  • collect the input data that you will base your music on.

  • decide how those input variables would affect the music

  • come up with the algorithms to create the melodies and rhythms

  • code it all up in a music synth package

Your items "know your mood" and "know your brain state", are probably open research problems worth a PhD if you were to make significant progress on them!

Once you get to that last step, I suggest Csound .

Csound is a sound design, music synthesis and signal processing system, providing facilities for composition and performance over a wide range of platforms. It is not restricted to any style of music, having been used for many years in the creation of classical, pop, techno, ambient, experimental, and (of course) computer music, as well as music for film and television.

As an aside, I once had the vision that the server room should should ambiently reflect the status of the servers. So I setup cricket chrips with frequency based on load average, wolf howls for login events seen tailing the system log, and owl hoots for (at that time relatively infrequent) web page hits...

In that case it was just slapped together in Python with some basic log scraping....

Joe Koberg
A: 

I don't know how I'd do it, but I might take a look at Bootchart, which does a bunch of process monitoring. It's possible that could be helpful in figuring out what's happening right now.

Ken
A: 

Check out Boodler, the "the open-source soundscape tool".

lost-theory
+1  A: 

JFugue is an open-source library (Java/JVM) for "programming music without the complexities of MIDI." see article

It is easy to start, and might serve as a base for your program, both for rhythms and melody.

Michael Easter
In fact, JFugue has a Rhythm class that may provide exactly what you need.
David