Take the 2-minute tour ×
Music: Practice & Theory Stack Exchange is a question and answer site for musicians, students, and enthusiasts. It's 100% free, no registration required.

I'm looking for a high-level programming language. I did some googling and found a number of examples (some summarized here http://users.soe.ucsc.edu/~sasha/proj/musicpaper.pdf) but haven't found quite what I need.

The key feature I'm looking for is that the language will let me create music based on some input material (a melody), and then lets me specify the rest of the piece as a series of transformations on the initial input material. The types of transformations I'm looking for are fragmentation (specify a subset of the original), transposition (change pitch), augmentation and diminuation (change duration), inversion (change direction of intervals), retrograde (change order).

Does something like that exist?

UPDATE: I'm currently trying with music21 (http://web.mit.edu/music21/). It will probably allow me to do this, but probably not in such a way that it will be straightforward to edit or read.

share|improve this question
    
I'm using c++ on win32. It's not the tool, it's the project you make with it. That's a pretty loosely defined project you got so far... And let's face it. People make way better music than computers ever have. And ever will. –  Stephen Hazel Apr 12 at 2:45
1  
@StephenHazel I am not asking for a computer program that generates music for me. I am asking for a computer program that lets me express a composition as a series of transformations based on my input. Your c++ example does not make sense. Suppose I would be asking for a program that lets me extract substrings based on a text pattern, then surely you would recommend some regexp library to me? Well then, I'm asking for a language that lets me create music based on a series of well-defined manipulations of input music. –  Roland Bouman Apr 12 at 11:49
    
@Roland, What about MIDI? –  Jesus Christ May 5 at 18:12
    
@JesusChrist, yeah what about it indeed? MIDI offers only an encoding. In other words, very much too low-level. –  Roland Bouman May 5 at 20:34

10 Answers 10

up vote 6 down vote accepted

Besides Haskore which is already mentioned in the paper you refer to and the ones mentioned by other, there is "supercollider" and "pure data".

I absolutely understand you question. I've been looking for such a high-level thing myself. Here are my personal thoughts on this:

I haven't found anything good and came to the conclusion, that there are no ready-made generally-accpeted abstractions out there. This is probably because everybody agrees on what a delay, a sawtooth or a butterworth filter is, but there is no generally accepted method to write music.

So your best beet is so find a language which has enough "abstractive powers" so you can write your own abstrations. There is no doubt that haskell is such a beast, but it is difficult (though rewarding) to learn.

I am currently fiddling with supercollider to get there. I only started a few days ago, so I don't know how far it'll get me. The least thing it'll do for me, is liberation from MIDI. I can control the sound anyway I want. Even if you (as you say) are only interested in writing note-sequence-transformations, you may quickly outgrow this approach, because it'll all sound the same. Then you may whish to have more control over the instruments than Midi allows you. At least this is where I am now.

But there are also OSC-Bindings for Haskell, so I may use Supercollider for the sound synthesis and haskell for the composition synthesis. I am also pondering over a player-synthesis which would go between the two.

share|improve this answer
    
Martin, thank you! I'll check out the products you mentioned. Like you said, I'm starting to believe there currently is nothing that matches my requirement. I'm currently looking into cobbling it up with JMusic or JFugue (as I'm comfortable with java). However, I'll be sure to consider your suggestion for Haskell. –  Roland Bouman Apr 13 at 22:27

See this SO question. I'm not sure if this is exactly what you need, but it might help.

Because I'm just linking another question, I'd normally put this as a comment. However I don't have commenting permissions on this site (yet).

share|improve this answer
1  
Thanks! Well that question sure has a lot of answers, many more examples than the paper I linked to. Not sure yet if the thing I'm looking for is in there, but it looks promising. Thanks again! –  Roland Bouman Apr 12 at 0:02

You may be interested in the CHucK programming language.

https://www.coursera.org/course/chuck101

share|improve this answer
    
Can you add a little more information about this language? –  Shevliaskovic Apr 12 at 8:59
2  
Thanks. When I first drafted this question, I stumbled upon CHucK before posting it. I played around with it for a bit, I think it's cool, but it's just a bit too low level for what I have in mind. For instance, in CHucK I have no meter, no scales, not even notes. Just synthesizers and time. So CHuck is one or two layers too far down for what I really need. –  Roland Bouman Apr 12 at 11:52

Getting into tracker software might another approach. You could consider the tracker score notation the programming language, and the tracker player the complier/interpreter.

There are plenty of music modules (songs) you can load and play with. These are shared all the time.

You can use tracker software out of the box to edit your 'input music' (E.g. OpenMPT).

There are lots of open-source libraries that allow you to play music in this format e.g: http://xmp.sourceforge.net. So getting your hands on the source code to a player may get you to ahead in manipulating aspects of a song via your programs.

This is how many computer games played music (especially older, arcade games where memory was limited and could not afford whole sample data of final songs to exist).

Many tracker module players already allow crude song control; mute instrument, swap instruments, mute track, change tempo, jump to song position. Games can already execute crude song control in real time in synchronisation with in-game events (jump to same pattern position in a different set of patterns or unmute channels whilst the game character is using an invincibility power-up, or for the end-of-level fight against the big boss man).

Many tracker editors are also open source (MilkyTracker, OpenMPT) and will have functions for transposing parts of the song (since they're keyboard shortcuts within the application) as well as playing the songs (since the song editors also play the songs).

Hopefully, this might give you some ideas. Despite not being a traditional programming language.

share|improve this answer
    
Cheers, thanks for the suggestion. –  Roland Bouman Apr 15 at 19:05

Give a try to OpenMusic, a visual programming language for symbolic music. It’s a bit frightening at first, but the tutorial should get you going pretty quick.

share|improve this answer
    
Hey that looks really interesting. Thanks! I'll take a look. –  Roland Bouman Apr 12 at 11:50

One can consider Lilypond to fit in this mold: although it is more focused on typesetting music, it can output a MIDI representation of the score. However, I find that, in terms of basic usage, it is not easy to achieve expressive effects in the midi output. In addition, it has no real-time capabilities. I mention it primarily since it may provide ideas (or code) for implementing a high-level interface if you end up rolling your own system.

share|improve this answer

I am not sure if they include all of the features you require. But the java jmusic library is quite extensive, I think that would be your best shot.

Otherwise other options would be JFugue, music21 (python) or the visual programming language CSound, from ircam, also very extensive.

share|improve this answer
1  
Dorien, dankjewel! Ik ga het denk ik idd eerst maar eens met jmusic proberen. –  Roland Bouman Apr 15 at 19:45
    
Graag gedaan. Het is de meest uitgebreide bibliotheek die ik al ben tegengekomen. Als je nog iets beters vindt laat zeker weten. –  dorien Apr 16 at 19:53

Édouard mentions OpenMusic, somewhat similar, and descendant of PatchWork is PWGL (http://www2.siba.fi/PWGL/). Looking at what you need from a language it might be useful especially 'constrains' part of PWGL. Learning curve is steep (LISP) but well worth your time. Some great external libraries for rhythm manipulation too. good luck

share|improve this answer

I think Overtone has what you're looking for and more. It's a Clojure library that acts as a powerful front-end to SuperCollider. It may take a while to learn how to use it (especially if you're new to Clojure), but once you do, it's quite powerful and flexible. You can do things like define a melody as a sequence of scale intervals, and then combine that with any particular scale and sequence of note duration values, which gives you a lot of freedom to play around with variations on a theme. It's worth checking out, even if you're not familiar with Clojure!

FWIW, I'm working on developing my own front-end to Overtone (I know; it would be a front-end to a front-end) that lets you leverage much of what it's capable of, but using a much simpler syntax aimed more towards musicians/composers than programmers. It's nowhere near usable at the moment, but hopefully will be someday in the near future. Until then, I heartily recommend Overtone :)

share|improve this answer
    
That sounds pretty interesting. Thanks! –  Roland Bouman Apr 15 at 19:45

Sounds like you want to do something similar to Andrew Sorensen, which is amazing. He uses a language called Extempore, similar to Lisp with a bit of C in it, which allows you to define and play stuff in real time. You can see this in action in this video, where he performs a piece doing live coding.

share|improve this answer
    
Thank you! Yes, I did see that Tedx talk, but it seemed like a pretty low level language to me - more about sound manipulation than symbolic (notation) manipulation, which is what I'm looking for. Thanks anyway! –  Roland Bouman Sep 19 at 19:47
    
I suppose you can build something on top of that, just some more structures like scales, so you can manipulate scales instead of having to work directly with semitones all the time. –  Chochos Sep 19 at 22:14
    
probably one could. But I'm looking for something that already has that. From what I've seen so far, music21 is closest to what I'm looking for. –  Roland Bouman Sep 19 at 22:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.