creating a buffer~ object in javascript

Jan 17, 2008 at 6:31pm

creating a buffer~ object in javascript

Hi,

I created a buffer in a patcher, called buf, which I’d like to manipulate in a jsui. I am not sure of the syntax I should use. Can anyone point me what I’m doing wrong in what follows?

var _buf= new Maxobj(“buffer~”, “buf”);

_buf.message(“clear”); // here I’d like to clear the buffer. I assumed that doing _buf.clear() would work but I had an error

_buf.channel = 1;

for (var i = 0 ; i < 100 ; i++)
_buf[i] = -1; // my buffer has 4 channels, I want to write data in the first channel from my jsui file

Thanks

jean-Baptiste

#35423
Jan 21, 2008 at 3:48pm

Can’t create a buffer~ in JS. :(

No MSP.

b

On Jan 17, 2008, at 10:31 AM, Jean-Baptiste Thiebaut wrote:

>
> Hi,
>
> I created a buffer in a patcher, called buf, which I’d like to
> manipulate in a jsui. I am not sure of the syntax I should use. Can
> anyone point me what I’m doing wrong in what follows?
>
> var _buf= new Maxobj(“buffer~”, “buf”);
>
>
> _buf.message(“clear”); // here I’d like to clear the buffer. I
> assumed that doing _buf.clear() would work but I had an error
>
> _buf.channel = 1;
>
> for (var i = 0 ; i < 100 ; i++)
> _buf[i] = -1; // my buffer has 4 channels, I want to write data in
> the first channel from my jsui file
>
> Thanks
>
> jean-Baptiste


Barry Threw
Media Art and Technology

San Francisco, CA
Work: 857-544-3967
Email: bthrew (at) gmail (dot) com
IM: captogreadmore (AIM)

http://www.barrythrew.com

“The greatest of the changes that science has brought us is the acuity
of change; the greatest novelty the extent of novelty.”
- J. Robert Oppenheimer

#120712
Jan 21, 2008 at 4:02pm

Thanks Barry.

C74 devs, any chance that we could manipulate MSP objects with JS?

best
JB

#120713
Jan 22, 2008 at 12:06am

On 21 janv. 08, at 17:02, Jean-Baptiste Thiebaut wrote:

> Thanks Barry.
>
> C74 devs, any chance that we could manipulate MSP objects with JS?

In the meantime, you can use java do achieve that. It’s almost as
simple as JS for those kinda things. Have a look to the buf.Op object,
or to the lists objects in the ejies if you want some examples.

Cheers,
ej

#120714

You must be logged in to reply to this topic.