Which audio synthesis environment should I focus on?
August 4, 2012 9:32 PM   Subscribe

Which audio synthesis environment should I focus on? I need to be able to read the contents of a folder and select a sample at random, but can't confirm that functionality before diving in.

I have been comparing features of audio synthesis environments, and reading up on all of the major ones like PureData, Max/MSP, SuperCollider, C/Nsound, etc.

They are all rather massively powerful workhorses, but I have yet to confirm that any of them can do a basic task I am hoping to perform, in addition to all of the other wonderful things they do.
The basic task I have modeled for my test of each: Can I make a patch that... opens a folder, reads a list of files, selects one randomly, plays it, and then repeats?

I am having a very hard time finding concrete examples of this kind of file i/o for any of these, and I want to confirm that this rudimentary operation is possible before I fully commit to any of these environments.

If it matters, I am on a PC and am not adverse to commercial suites vs free ones.
posted by Theta States to Computers & Internet (10 answers total) 3 users marked this as a favorite
 
Supercollider can absolutely do it! Stand by for code...
posted by phrontist at 10:45 PM on August 4, 2012


Best answer: Okay, I'm kind of drunk, but I just tested this under reasonable conditions, and it does what I think you want. That is, it chooses a random file from the directory and plays it, then moves on to the next one as soon as the last is finished.
~path = "~/Desktop/foo/*"; // Note, this can be a regular expression if you want.
~sounds = ~path.pathMatch.collect {|file| Buffer.read(s, file);};

Task({
    inf.do({ arg i;
	var randomly_chosen_sound = ~sounds.choose;
        randomly_chosen_sound.play;
        randomly_chosen_sound.duration.wait;
    });
}).play;
Not only is Supercollider vastly superior to your other options from a technical standpoint, the SuperCollider community/mailing list is very welcoming and helpful.
posted by phrontist at 10:56 PM on August 4, 2012 [3 favorites]


Argh, the "arg i" line is totally superfluous.
posted by phrontist at 10:57 PM on August 4, 2012


Supercollider: you can do your taxes with it!

(you seriously can)
posted by victory_laser at 11:10 PM on August 4, 2012 [1 favorite]


Best answer: I've done some quite complicated stuff in Max, SuperCollider and PureData. It's a matter of personal taste to a large degree. Yes, SuperCollider is very powerful, but it's programming style is obtuse and it can be quite hard to get to grips with the event model. Max is fun and you can get stuff made very quickly. PureData has the advantage of being free (although getting used to inlet order and triggering can be a pain) and libpd means you can port your code to mobile apps, which is great.

If all you want to do is this one task, any will do - go for a free one and you'll be able to get it done quickly. If you're in it for the longer term I'd say try SuperCollider and pd and see which one you like more.

Another things to consider is the underlying code. SuperCollider is Java, pd is C. Personally I prefer C by a mile but ... yours may vary.
posted by iotic at 11:48 PM on August 4, 2012


No part of SuperCollider is written Java. The language interpreter (sclang) and synthesis server (scsynth) are written in C++.

As far as SC being obtuse, I think the code above speaks for itself, one way or another.
posted by phrontist at 12:05 AM on August 5, 2012 [1 favorite]


I stand corrected. I guess to me it felt very java-live looking at the codebase, which I find one always has to dip into with these things once a project goes past a certain level of complexity. Maybe I just saw a bunch of stuff like "com.collider.super.math.simple.addTwoNumbers" and though, ugh. I don't know.

Anyway not to put you off, SuperCollider is amazingly powerful and great for things like granular synthesis. It's mainly the programming style of working out what's in a constant loop, what gets fired once etc, which I find annoying.

PureData is more intuitive, I would say, and making extensions is easy. But they all have their quirks and pure data is arguably less powerful for being a visually-oriented system with less opportunities for traditional programming devices - even such basic things as performing synthesis within logical control structures can get quite complex.
posted by iotic at 12:49 AM on August 5, 2012 [1 favorite]


Response by poster: phrontist, The fact that a supercollider fan came in right away and drunkenly recommends it is very heartening. :)

I had a hard time sift through SC documentation looking for that kind of file interfacing, and by looking at your code fragment I was totally looking for the wrong keywords!

My programming background is Perl and C++, so I was not expecting it to look like that, which is probably why I couldn't find that.
posted by Theta States at 8:11 AM on August 5, 2012


Response by poster: I definitely like the visual click-and-go nature of pd and Max, but can probably adapt to the coding of supercollider since I have some programming background. The random SuperCollider screenshots I looked at had some nice visual elements, so hopefully I can twist it to do all of the things I want, and have the eventual visual interface I'd want as well.

thanks, everyone!
posted by Theta States at 8:29 AM on August 5, 2012


iotic: "Anyway not to put you off, SuperCollider is amazingly powerful and great for things like granular synthesis. It's mainly the programming style of working out what's in a constant loop, what gets fired once etc, which I find annoying."

This and the relative CPU inefficiency are why I switched back to csound. But you don't get too far in csound before you need to pull in another language (either a frontend language to do programming logic in a sane way, or c to implement plugins, if not both).
posted by idiopath at 10:01 PM on August 5, 2012


« Older productive social justice   |   Compressible Feet Newer »
This thread is closed to new comments.