auto-edit audio via scripting

Ad.'s icon

Hi all.
I have a folder full of 3sec audio tracks.
I need to (auto)make one track with a random order of these tracks.
Is there a solution via scripting to do this ?

Thx,
Ad.
(mac 10.5)

AudioMatt's icon

You need to describe what you want to do in detail. "(auto)make one track with a random order of these tracks." doesn't help much.

In general, scripting is not what you need. editing audio files is not max's forte. MXJ might be able to do the job but you're better off loading all three files and using [mxj buf.Op]

Ad.'s icon

I want to make one audio file of one hour, which contains 3 sec files I have in my folder, and the order must be chose by random.
I know max is not the best to do that, but maybe something like ffmpeg for audio for instance, I don't know…
That's why I talk about script and not max.

Hope this is clear.
Ad.

Ben Bracken's icon
Max Patch
Copy patch and select New From Clipboard in Max.

there might be an easier way to do this, and you might want to do it in java (take a look at mxj buf.Op for an example on buffer operations), but here is one possible way to do it:

Ad.'s icon

Thx !!
I'm going to check the buf.Op, my files won't be always 3sec long.
Thx.
Ad.

Roman Thilenius's icon

you could just do it in realtime using half a dozen play~ and buffer~

Ad.'s icon

Nope because I have to make some loop with the new track, would have been too simple.

Ad.'s icon

Here's my final patch: it does take by random every entire files of one folder to make one audio track stored in one buffer:
Thx to Ben, who does almost the whole patch !

Max Patch
Copy patch and select New From Clipboard in Max.

`
Ad.