News for hackers. Stuff that matters.

Ask HN: Music Processing Pipeline?

I had the thought today that music effects processing has a model similar to a functional programming or a unix pipeline. (inputs passed through filters or transforms).

Does anyone know of a library that would allow one to compose music in this paradigm?

What I'm thinking of is something that would let you define a sequence that represents the notes, and then send them through/apply effects to that sequence before they are output.

example: given a forward pipe operator |> in Haskell or Ocaml/F#: f |> x = x f (similar to a Unix | in operation)

where notes are represented somehow textually as a sequence (maybe letter and number for octave?) something like:

[4a, 4b, 4c, 3g#, 3d, 4a, 4f] |> high_pass_filter |> phaser |> output

I have no idea if this exists, but think it might be an interesting way to compose music. If anyone knows of library/application/language that works something like this, I'd be interested to hear.

( 7 comments | 6 points | on HN )
Re:Ask HN: Music Processing Pipeline? by altrus on Thursday January 06, 2011 @04:02PM (#2077160)
Have you read about ChucK? It's a real time language for synthesis, composition, and audio programming.

The name of the program comes from their 'chuck' operator, which works similarly to what you've described.

If you look at the wikipedia page, it looks exactly like what you are proposing - I was looking to use it myself for a different project involving music analysis.

http://en.wikipedia.org/wiki/ChucK#Code_example

http://chuck.cs.princeton.edu/

Re:Ask HN: Music Processing Pipeline? by sea6ear on Thursday January 06, 2011 @04:48PM (#2077386)
This looks very similar to what I was thinking about. I'll take a look at this.
Re:Ask HN: Music Processing Pipeline? by retroafroman on Thursday January 06, 2011 @03:24PM (#2076990)
This is an interesting concept. I've never thought of using Unix pipes style text syntax for musical effects. I know that some of the visual music programming environments work in a similar fashion, where effects are defined and then linked together in chains (see Supercollider or PureData, both open source). Perhaps some of the livecoding musical langauges work similarly, I haven't dived in to see how the syntax on them functions (like Impromptu http://impromptu.moso.com.au/).

Keep us updated if you make anything cool in this space.

Re:Ask HN: Music Processing Pipeline? by zck on Thursday January 06, 2011 @06:05PM (#2077714)
You might want to check out the custom DSLs made by livecoders. There's an old Wired article about them (http://www.wired.com/science/discoveries/news/2006/07/71248), and this is a livecoding wiki: http://toplap.org/index.php/Main_Page . I can't find it now, but I recall seeing a really in-depth Lisp language for livecoding. There are screencasts you can check out.
Re:Ask HN: Music Processing Pipeline? by jonjacky on Thursday January 06, 2011 @03:31PM (#2077020)
'Functional music composition' is chapter 20 in the book 'The Haskell School of Expression: Learning Functional Programming Through Multimedia' by Paul Hudak.
Re:Ask HN: Music Processing Pipeline? by sea6ear on Thursday January 06, 2011 @04:49PM (#2077392)
Thanks, I think I have that book, I'll try to find it in my stacks and take a look at that chapter.
Re:Ask HN: Music Processing Pipeline? by Loginid on Thursday January 06, 2011 @07:33PM (#2077994)
Csound works similarly to this

http://en.wikipedia.org/wiki/Csound