updating buffer~ contents from javascript

asabin@gmail.com's icon

Hi All,

Question: Does anyone know of a way to use values generated in a js object to fill a buffer~ object?

I am working on a patch where I:

(1) determine FIR coefficients in a javascript file
(2) load those coefficients into a buffer~ object
(3) use the buffir~ object to apply the filter

I am having a hard time with (2). It seems that buffer~ can only be filled by loading a file (wave, raw .. etc).

Thanks!

volker böhm's icon

you can try to output the values from the js object as a list and use [listfunnel] and [peek~] to write into a [buffer~].
vb

andrea agostini's icon

can you do some Java instead of JavaScript? it's not much more complicated, and you gain direct access to buffer~ (see the buf.Op example) - plus much greater speed!

hth
aa