setting up inlets and outlets

May 18, 2008 at 3:42pm

setting up inlets and outlets

Hi all,

This is a most fundamental of problems and searching the forum for inlets or outlets gives a few unrelated replies.

Max does not like the way I have declared the following because it stubbornly keeps only one inlet and one outlet. Please help.

// some global statements
inlets = 2;
outlets = 2;

function msg_ing(a) {
// some local statements
outlet(1, a); // js: bad outlet index 1
}

Thank you.

#37863
May 18, 2008 at 5:57pm

On 18 mai 08, at 17:42, Glen wrote:

> Hi all,
>
> This is a most fundamental of problems and searching the forum for
> inlets or outlets gives a few unrelated replies.
>
> Max does not like the way I have declared the following because it
> stubbornly keeps only one inlet and one outlet. Please help.
>
> // some global statements
> inlets = 2;
> outlets = 2;
>
> function msg_ing(a) {
> // some local statements
> outlet(1, a); // js: bad outlet index 1
> }

That should work if you write “js yourjsfile.js” in a box, it should
appear with 2 inlets and 2 outlets. How are you instantiating your js
object?

ej

#131131
May 19, 2008 at 9:48am

Yeah, I seem to have path problems. When I loaded MAX at the start of the day, it could not identify the script at all.

When I make a parent patcher referencing my script, that script is missing. However, if I close and reload the parent patcher, my script appears OK.

Could someone please explain because I have an open-book exam in a couple of hours and speeeeeeed is important :(

#131132
May 19, 2008 at 9:59am

Also, *ahem*, if someone could tell me very quickly how to separate values from each inlet I would be super-grateful.

Sorry for not taking time to look this up. I’m swept off my feet with Jitter revision, lol..

#131133
May 19, 2008 at 10:02am

On 19 mai 08, at 11:48, Glen wrote:

>
> Yeah, I seem to have path problems. When I loaded MAX at the start
> of the day, it could not identify the script at all.
>
> When I make a parent patcher referencing my script, that script is
> missing. However, if I close and reload the parent patcher, my
> script appears OK.
>
> Could someone please explain because I have an open-book exam in a
> couple of hours and speeeeeeed is important :(

The simple (quick and dirty) solution is to save the script in the
same folder as your main patch:

MyFolder:
./mypatch.pat (maxpat if it’s Max 5)
./myabstraction.pat
./myimage.jpeg
./myjsfile.js

Then you can just name your [js myjsfile.js] and it will find it,
because the folder containing the main patch is always added
(temporarily) to the search path.

ej

#131134

You must be logged in to reply to this topic.