[LAU] Creating evenly spaced sample chains?

Joel Roth joelz at pobox.com
Sat May 4 16:43:12 UTC 2013


Janus wrote:
> 
> Greetings,
> 
> I'd like to chain samples into one new sample such that each input
> sample starts at a multiple of a given time value in the output sample
> (basically an evenly spaced concatenation). All input samples share the
> same format but differ in length. If a sample is longer than the given
> time interval it's tail shall be cut off (overwritten by the next one),
> if it's shorter, silence shall be added to it's end.
> 
> Do you know of a tool or can you think of a command pipeline that would
> establish this (putting the samples on the grid in a DAW to export the
> result is too much work and also would make me feel stupid!)?
> 
> I tried sox so far but it seems that it's not up to the task.

Ecasound can do it, too.

If the fixed spacing is "interval", this could work (untested)

ecasound \
-a:1 -i:playat,<interval*0>,select,0,interval,sample1.wav \
-a:2 -i:playat,<interval*1>,select,0,interval,sample2.wav \
-a:3 -i:playat,<interval*2>,select,0,interval,sample3.wav \
-a:4 -i:playat,<interval*3>,select,0,interval,sample4.wav \ 
...                                                     \
-a:1,2,3,4,... -o outputfile.wav
 
Cheers,

-- 
Joel Roth


More information about the Linux-audio-user mailing list