converting lists to tables and vice versa

Mar 3, 2007 at 4:28am

converting lists to tables and vice versa

hey everyone. Im a noob to max and this is my first post. I’ve been working on a sequencer for the past three days for my lemur. I’m amazed at how quickly I’ve been able to grasp this language. its not as scary as i thought. actually i think its easier than reaktor. the way the help examples work for each object is very intuitive.

however there’s one or two things that i haven’t been able to pickup in the reference files or find out and thought i might ask here.

1. what is the easiest way to convert a list to a table and vice versa?

I figure that doing this would also be the easiest way to apply an operation/subtraction etc to each value in a list. is that right?

2. another thing i haven’t been ale to find is how do i make my wires draw at 90 degree angles instead of straight to each object.

3. I’ve been trying to find the best way of creating instanced objects. if i have an object that takes an input and does something with it, and i want 8 exact copies of it, if i do a copy paste, the changes I make in one aren’t saved in the others. i suspect this might have something to do with prototyping? but im not sure.

I hope im not pissing anyone off by asking noob questions but so far i’ve tried my best to figure it out myself.

cheers for any help

#30600
Mar 3, 2007 at 6:34am

>
>1. what is the easiest way to convert a list to a table and vice versa?
>
>I figure that doing this would also be the easiest way to apply an operation/subtraction etc to each
value in a list. is that right?

have a look at Peter Elsea’s Lobjects for easy list-based math:

http://arts.ucsc.edu/ems/music/research/lobjects.readme.html

>
>2. another thing i haven’t been ale to find is how do i make my wires draw at 90 degree angles
instead of straight to each object.

options > segmented patch chords
(also you can fix existing chords by selecting then going to options > align )

>
>3. I’ve been trying to find the best way of creating instanced objects. if i have an object that takes
an input and does something with it, and i want 8 exact copies of it, if i do a copy paste, the changes
I make in one aren’t saved in the others. i suspect this might have something to do with
prototyping? but im not sure.

save the subpatch you wish to copy in the same directory as your main patch. then you can add it to
your main patch just like any other object… [my_subpatch] instead of [p my_subpatch]. now when
you need to edit, just open the subpatch file and edit. every copy of it in your main patch will update.

good luck
david

Need personalized email and website? Look no further. It’s easy
with Doteasy $0 Web Hosting! Learn more at http://www.doteasy.com

#98058
Mar 3, 2007 at 6:57am

thanks for the quick reply david. that all works great!

does anyone know what “error midi_mme: error 4 opening midi input device Maple Midi In(x):5″ means and how to fix it?

im trying to retrive midi clock information and im not sure why my ports wont open.

#98059
Mar 3, 2007 at 7:15am

i forgot to mention, that i was recieving the message 248 – successfully in this setup, and then it stopped. now i cant get it working again.

#98060
Mar 3, 2007 at 7:45am

On 3 mars 07, at 08:15, blairell wrote:

> i forgot to mention, that i was recieving the message 248 –
> successfully in this setup, and then it stopped. now i cant get it
> working again.

The rtin object needs to know the name of the midi device, not the
index in the menu.

Best,
ej

#98061
Mar 3, 2007 at 12:37pm

#98062
Mar 3, 2007 at 3:00pm

Quote: Emmanuel Jourdan wrote on Sat, 03 March 2007 18:45
—————————————————-
> On 3 mars 07, at 08:15, blairell wrote:
>
> > i forgot to mention, that i was recieving the message 248 –
> > successfully in this setup, and then it stopped. now i cant get it
> > working again.
>
> The rtin object needs to know the name of the midi device, not the
> index in the menu.
>
> Best,
> ej
>
—————————————————-

sorry if i dont understand, but how do I give it that?

#98063
Mar 3, 2007 at 3:33pm

On 3 mars 07, at 16:00, blairell wrote:

> sorry if i dont understand, but how do I give it that?

Connect the right outlet of umenu to rtin.

ej

#98064
Mar 3, 2007 at 11:53pm

oh ok, sorry you had to state the obvious. thanks.

its still not working though – im pretty sure the problem lies in the fact that when i activate the midi channel in preferences i get this error -

“error midi_mme: error 4 opening midi input device Maple Midi In(x):5″

what does that mean?

#98065
Mar 5, 2007 at 3:41am

Hello and welcome to Max! ;)

—1. what is the easiest way to convert a list to a table and vice versa?

If you’re using tables you need to access / store the information a piece at a time (unless you’re using vexpr with array notation… I haven’t but it is doable). Use an uzi with the same number of bangs as your table size, then a pack, depending on whether you’re going into or out of the table. For manipulating the data you can use vexpr (scalarmode 1 needs to be told to the object explicity first). Limit of 256 elements. The Peter Elsea objects use javascript to allow more than 256 (I don’t know the limit).

A nice alternative to tables is the multislider with a size of as many points as you want. I find them easier to work with generally, plus they aren’t separate files like tables. (Though the line tool in the table is nice.) Multisliders can give a more customizeable appearance and size too; they are also presettable and can be used with pattr (do yourself a favor and learn pattr, I cannot stress that enough, I regret not using pattr from the beginning!!)

–2. another thing i haven’t been ale to find is how do i make my wires draw at 90 degree angles instead of straight to each object.

As said, you can choose segmented patch cords from the menu. Alternatively, when you are about to draw a connection, hold shift. This lets you click the points (up to 8) of your cord. (Most corners or angles can then be dragged around too.) Release the shift before connecting to the destination object. Using Shift like this also lets you easily connect one object to multiple ones (keep holding after you make a connection and you can make as many more as you want). If you’re really into it, look up the Max Toolbox which has easy ways to make crazy multiple connections with one command, plus distribute horizontal / vertical for selected objects. Well worth it.

As far as the instances vs. subpatches: don’t think that you need to choose one or the other at any given point (they each have advantages and disadvantages). For development, use a subpatch, as you can make changes right there and there’s no separate file. Once your subpatch is the way you want, do a Save As… and presto, you have your object that you can make instances of, then alter the original file as needed and all the instances will reflect the change. Presets stored with the object file will be accessible by any instance–HOWEVER, new presets made in instances will NOT SAVE with the original object. To change these you need to save new presets in the original file. Any objects you make in this way need to be accessible to the patch that uses instances of them (probably just always keep right with the file).

Remember that you can always copy/paste stuff into new subpatchers: so, you can have the accessibility of the subpatch while developing, then save as your new object. Also, you may want to use an object you made, but with some slight modifications for a particular situation. Don’t change the original prototype: just copy / paste the patch into a subpatch, then make your additions / changes. Very flexible this way.

-CJ

#98066
Mar 6, 2007 at 2:16am

lots of awesome info there. thanks a lot. ill be trying it all out a bit. I’ve been looking at that pattr object but i still dont know what it allows you to do that is so special compared to just using send/recieve, coll or a few other methods.

#98067
Mar 6, 2007 at 5:23am

hmm now i can see its starting to make sense. however the way reference paths work doesn’t seem to work for me when i implement it in my file, and it isn’t covered thoroughly in the documentation.

i tried just copying the help file straight into a new file and the reference works.

but when i copy and paste it into my workspace, it doesn’t work at all.

#98068
Mar 6, 2007 at 5:39am

Are you referring to pattr / pattrstorage? Should be fine, be sure you’ve set your File Preferences in Options so that Max knows where to search. This is also often needed for locating loops, video clips, pictures, etc. Note that pattrstorage lets you save your settings into an .xml file and the contents are NOT otherwise saved with the patch.

I’m no expert on pattr, but you should name your pattrstorage something new when you make a new one. Then store your settings and use a line or a slider to interpolate between them (this is the real beauty of pattr–automatic interpolation). Note that if you save a setting that has a different number of elements, the interpolation doesn’t work as expected (I think)—at least with multislider, is one setting has an 8-element multislider and one has 16, they will just jump from one to the other. So keep them consistent if you want that slide.

And that slider you use to scroll between presets? You can automate that with mtr…

–CJ

#98069
Mar 7, 2007 at 6:44am

blairell schrieb:
> oh ok, sorry you had to state the obvious. thanks.
>
> its still not working though – im pretty sure the problem lies in the
> fact that when i activate the midi channel in preferences i get this
> error -
>
> “error midi_mme: error 4 opening midi input device Maple Midi
> In(x):5″
>
> what does that mean?

I am not on Windows, I didn’t know you would need to activate anything.
But out of the error message, which seems an OS specific one, I’d guess
it means what it says, you might have deactivated something…

If it worked before, you just should go back.
(And never change a winning team… ;-)

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com

#98070
Mar 7, 2007 at 10:57am

thats the thing, i didn’t change anything. no clue. only channel 3 works as a midi input for max. every other app is fine though.

#98071
Mar 8, 2007 at 2:08am

I was working on a subpatch, and i saved it before i did something i thought might crash it.

but when i open up the original parent patch, the saved subpatch isn’t in there. how can i replace the out of date subpatch with the saved patch?

cheers again

#98072
Mar 8, 2007 at 2:56am

At 1:08 PM +1100 3/8/07, blairell wrote:
>but when i open up the original parent patch, the saved subpatch isn’t in there. how can i replace the out of date subpatch with the saved patch?

Open the parent patch
Open the saved sub-patch
Copy the saved sub-patch
If the old sub-patch “shell” exists in you parent patch then open it, else create new sub-patch.
Paste into the existing/new sub-patch
Save parent patch

-C


Chris Muir | “There are many futures and only one status quo.
cbm@well.com | This is why conservatives mostly agree,
http://www.xfade.com | and radicals always argue.” – Brian Eno

#98073

You must be logged in to reply to this topic.