2

[To anyone who recognizes the following setup as shamelessly derived from musique concrète and Cage's music: apologies for the gross simplifications]

Setup: I have a project in which I need to programmatically read audio samples, possibly manipulate their features (applying envelopes, reversing, reverb, speed up/down, etc), and combine them in sequences.

Basically, I need to programmatically control the effects I would have available in a tool like Audacity or its equivalents.

Question: Which types of tool could I look at to achieve this? I have briefly looked into supercollider and pure data (= read a couple of tutorials), but they seem mainly oriented to sound synthesis, even though reading samples from files is possible. The sound synthesis orientation seems also to introduce a lot of unneeded complexity for a project as simple as mine. Besides, pure data (and its siblings) are visually oriented, and I would prefer a text-based environment if possible.

Perhaps there are sound manipulation libraries that would allow access to "Audacity-like" effects from within a standard programming language (a tool that would be like a "Audacity bindings" for language X, for lack of a better term)?

5
  • do you need any real-time capabilities, or is this all a question of doing offline processing? Commented Feb 19, 2018 at 18:53
  • 1
    This question is off topic here because we have decided not to discuss recommendations for hardware or software. You might try it over at softwarerecs.stackexchange.com instead. Commented Feb 19, 2018 at 19:47
  • Stefano - would you be happy with recommendations for a type of tool, rather than specific tools? Commented Feb 19, 2018 at 19:55
  • @topomorto: I only need offline processing. Also, suggestions about the recommended class of tools are welcome. in fact they are even more welcome than suggestions about specific tools. I basically need to know where to look
    – stefano
    Commented Feb 19, 2018 at 21:35
  • I've edited the question to make that clear - hope the edit's OK. (questions asking for suggestions for specific tools are off topic here - but hopefully as now worded it's OK.) Commented Feb 20, 2018 at 1:06

1 Answer 1

2

One way to go would be simply to use a general-purpose programming language - almost any will do - to read the audio samples in, do any processing, and write out the piece to disk. Reading and writing WAV format is quite straightforward even if you need to parse it yourself. Some of the manipulations you mention - applying envelopes, slowing audio down - are very easy to code; convolution reverb is fairly easy. Speeding audio up can be a bit more difficult as you have to do it in a way that avoids aliasing. http://musicdsp.org/ is one resource for audio algorithms you can implement yourself.

Of course you might prefer to get a third-party audio library to do some of the work for you so you don't have to do all this low-level work. The choice of these would depend on the language you are using.

Another option would be a language that has good audio support built in to its standard libraries - for example JavaScript is actually pretty capable with audio if you use it in a browser that supports the Web Audio API. This API supports all the things you've mentioned, and you could even get some interesting interactive things happening in the web browser (and of course put your interactive works on the web!).

Then we get to dedicated audio programming languages, which are often dialects of general programming languages with audio library support built in as standard. One that I saw a great demo of recently is Sonic PI (which uses supercollider under the hood) and is oriented around live coding - though you can just as easily render your work to disk. This would be one of my personal recommendations for a straightforward starting point, though I'm not an expert on it.

You might also consider using some command-line audio tools and writing a batch / PowerShell / other script file to drive them to do some processing. Sox is an example, and rubberband is an interesting little tool too.

1
  • Thanks. That's exactly what I was looking for: a taxonomy of available toot types (with the correct terms to enable search).
    – stefano
    Commented Feb 20, 2018 at 15:02

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