it’s quite easy (didn’t someone already do this?)
quick untested sketch of a new Engine_Glut method that could be wrapped in a new command:
// one-shot record to entire buffer, with optional overdub
recordBuf { arg bufIdx, adcChannel=0, preLevel=0.0;
if(buffers[i].notNil, {
{
RecordBuf.ar(SoundIn.ar(adcChannel), buffers[i].bufNum,
preLevel:preLevel, doneAction:Done.free);
}.play(Server.default);
})
}
possible and straightforward improvements include:
- keep a persistent recording synth for each buffer, to punch in/out
- rec/pre envelopes for cleaner punch in/out
- use server and i/o busses from the AudioContext