Manipulating buffers (or jit.buffers~) through jit.gl.lua?

James Bradbury's icon

Hi all,

Is it possible to manipulate the contents of buffers via jit.gl.lua? I see that you can spawn new jitter objects with jit.new, so is it possible to create/destroy and reference jit.buffers~ in this way? Perhaps an easier approach would be to operate on jitter matrices and then turn those into buffers once processing is incomplete. Ideally, I could deal with the data of a buffer directly in some way.

Thanks!

James

Rob Ramirez's icon

jit.buffer~ is a special jitter object due to the requirements of working in both the audio and jitter domains, and therefore can not be instantiated inside of JS / jit.gl.lua. Your second approach of working on matrices in lua and then outputting to a jit.buffer~ in the patch seems correct.

James Bradbury's icon

Cool thanks @Rob. I'll just work on the matrices.

J