Forums > MaxMSP

JS in Max

October 21, 2006 | 11:52 am

Hi,

I’d like to learn programming in javascript for my Max patches. What is a good way to do this, where to start? Of course JS is not only for Max use, so i wondered if there are books that could be useful and which of them fits the best for scripting in Max.

poul


October 21, 2006 | 2:10 pm


October 21, 2006 | 3:47 pm

I also recieved my recomendation from JKC. I am not a word person.
Because of some brain stuff, I read with one fifth the speed and
comprehension as a normal person. (I still read its just an uphill
battle) I had attempted to learn written programming languages many
times over. but couldn’t get through the books.

After about 3 days of JavaScript The Definitive Guide, I would say I
had gained three quarters of my current knowledge of javascript. and
I have been using for years. it also separates the HTML junk from
language itself. so much so, that I still don’t know how to use it
in my browser. I have it sitting right here, it’s been through hell
and back.

I know everyone hates O’REILLY books but if I can actually sit down
and read it (which I did), thats got to be something. I don’t care
for all the vein attempts at making things "cute" that other
programming books include. it just slows things down.

-matt


October 21, 2006 | 5:10 pm

While we are on the subject, I was wondering if anyone has
done any analysis on the efficiency of implementing things in
JS versus plain Max objects. Are there instances where you
definitely would or would not want to use JS? Obviously
string manipulations are easier in JS, but what about passing
data back and forth?

Anthony

—– Original Message —–
From: "matthew aidekman"

To:
Sent: Saturday, October 21, 2006 10:47 AM
Subject: Re: [maxmsp] JS in Max

> I also recieved my recomendation from JKC. I am not a word person.
> Because of some brain stuff, I read with one fifth the speed and
> comprehension as a normal person. (I still read its just an uphill
> battle) I had attempted to learn written programming languages many
> times over. but couldn’t get through the books.
>
> After about 3 days of JavaScript The Definitive Guide, I would say I
> had gained three quarters of my current knowledge of javascript. and
> I have been using for years. it also separates the HTML junk from
> language itself. so much so, that I still don’t know how to use it
> in my browser. I have it sitting right here, it’s been through hell
> and back.
>
> I know everyone hates O’REILLY books but if I can actually sit down
> and read it (which I did), thats got to be something. I don’t care
> for all the vein attempts at making things "cute" that other
> programming books include. it just slows things down.
>
> -matt


October 21, 2006 | 5:35 pm

On 21-oct.-06, at 19:10, Anthony Palomba wrote:

> While we are on the subject, I was wondering if anyone has
> done any analysis on the efficiency of implementing things in
> JS versus plain Max objects.

File I/O are very slow.

p


October 21, 2006 | 7:08 pm

I like the idea of storing various patcher variables in JS and
retrieving them as needed. Do you take a big performance hit
transferring data when you cross over from the Max native
world to the JS world?

Anthony

—– Original Message —–
From: "Anthony Palomba"
To:
Sent: Saturday, October 21, 2006 12:10 PM
Subject: Re: [maxmsp] JS in Max

> While we are on the subject, I was wondering if anyone has
> done any analysis on the efficiency of implementing things in
> JS versus plain Max objects. Are there instances where you
> definitely would or would not want to use JS? Obviously
> string manipulations are easier in JS, but what about passing
> data back and forth?
>
>
>
> Anthony
>
>
>
> —– Original Message —–
> From: "matthew aidekman"

> To:
> Sent: Saturday, October 21, 2006 10:47 AM
> Subject: Re: [maxmsp] JS in Max
>
>
> > I also recieved my recomendation from JKC. I am not a word person.
> > Because of some brain stuff, I read with one fifth the speed and
> > comprehension as a normal person. (I still read its just an uphill
> > battle) I had attempted to learn written programming languages many
> > times over. but couldn’t get through the books.
> >
> > After about 3 days of JavaScript The Definitive Guide, I would say I
> > had gained three quarters of my current knowledge of javascript. and
> > I have been using for years. it also separates the HTML junk from
> > language itself. so much so, that I still don’t know how to use it
> > in my browser. I have it sitting right here, it’s been through hell
> > and back.
> >
> > I know everyone hates O’REILLY books but if I can actually sit down
> > and read it (which I did), thats got to be something. I don’t care
> > for all the vein attempts at making things "cute" that other
> > programming books include. it just slows things down.
> >
> > -matt


October 21, 2006 | 7:58 pm

speaking of js in Max:
I’m reading the code for the ‘jsui_3ddial.js’ in the jsui-library
directory
I want to make the background white square transparent so I can see a
graphic underneath

I added a opacity value of 0.0 to the brgb tuple but it had no effect
the manual says:
> OpenGL also supports the use
> of an alpha channel for transparency and other types of blending
> modes. Colors with
> alpha channel values may be specified as RGBA, for example, green
> with 25% opacity
> would be (0.,1.,0.,0.25). If there is no alpha channel value
> present, it is assumed to be 1.–
> i.e. 100% opaque.

any jscripters point me in the right direction?


October 21, 2006 | 9:10 pm

On 21 Oct 2006, at 18:35, Patrick Delges wrote:

>
> On 21-oct.-06, at 19:10, Anthony Palomba wrote:
>
>> While we are on the subject, I was wondering if anyone has
>> done any analysis on the efficiency of implementing things in
>> JS versus plain Max objects.
>
> File I/O are very slow.

And JavaScript-in-scheduler support is iffy, so it’s only really
usable outside interrupt.

– N.

nick rothwell — composition, systems, performance — http://
http://www.cassiel.com


October 21, 2006 | 10:40 pm

speaking of js in Max:
I’m reading the code for the ‘jsui_3ddial.js’ in the jsui-library
directory
I want to make the background white square transparent so I can see a
graphic underneath

I added a opacity value of 0.0 to the brgb tuple but it had no effect
the manual says:
> OpenGL also supports the use
> of an alpha channel for transparency and other types of blending
> modes. Colors with
> alpha channel values may be specified as RGBA, for example, green
> with 25% opacity
> would be (0.,1.,0.,0.25). If there is no alpha channel value
> present, it is assumed to be 1.–
> i.e. 100% opaque.

any jscripters point me in the right direction?


October 21, 2006 | 11:29 pm

This feature is apparently implemented only deep in the dark corners
of the cycling74 office. not in any official release. I too am
aching for it. apparently in this super secret version of max, all
UI objects have an alpha channel.

so fricking yummy.
-matt


October 22, 2006 | 12:36 am

Anthony Palomba wrote:
> While we are on the subject, I was wondering if anyone has
> done any analysis on the efficiency of implementing things in
> JS versus plain Max objects. Are there instances where you

The app I’ve been working on uses scripting to create certain important
uzi-driven processes. Some of these create waveforms, so efficiency is
very obvious given larger sample counts. These processes can be created
as either a regular abstraction or as js. There are two reasons to
welcome both.

1. The js is often easier and faster to write, and javascript’s textual
goodness means that others can easily create plugins for the system even
if they don’t own/know Max. It’s not prohibitively slow if waiting
three or four seconds is acceptable.

2. The native stuff is significantly faster in my situation – about 1.5
s for the same operation on the same processor. The native stuff can
also run at control+audio rate in order to distribute the load over time.

When js appeared, I was very happy and was almost prepared to ditch the
previous all-native stuff. The speed issue made me keep it. The Max-js
border could easily be the major limit for me – the result sets are far
too large to do anything other than send each result individually.


Viewing 11 posts - 1 through 11 (of 11 total)