here’s the function I use to prep a single ir which shows the action: key
(sorry about the formatting!)
Library.put(\functions,\prep,
{|in channel=0 fftsize=4096 | // returns bufnum
var irbuffer, bufsize, spectrum;
var path=PathName(in);
var bufnum = Buffer.new.bufnum;
irbuffer = Buffer.readChannel(s, in, channels:[channel], action: { |buffer|
bufsize = PartConv.calcBufSize( fftsize, buffer);
spectrum = Buffer.alloc(s, bufsize, 1, bufnum:bufnum);
spectrum.preparePartConv(buffer, fftsize);
spectrum.postln;
irbuffer.free;
});
bufnum;
});
if you iterate with a function like this you don’t need a routine or to use s.sync - the function will return the buffernumbers and the buffers will be filled asynchronously