Swapping values in table

Jul 24, 2011 at 4:03am

Swapping values in table

Is there an easy way of swapping one value with another, as defined by a table or CSV? For example, I want to swap:

1 -> 4
2 -> 6
3 -> 5
4 -> 2
5 -> 1
6 -> 3

The first number would be sent in an inlet, and the second number would be sent from an outlet.

I’m very new to Max, coming from using ControllerMate. Any help is appreciated.

Thanks!

#58165
Jul 24, 2011 at 4:17am

have a look at the coll object. it should do the trick

– Pasted Max Patch, click to expand. –
#208884
Jul 24, 2011 at 4:23am

Perfect, this is just what I needed! Thanks :)

#208885
Jul 24, 2011 at 4:49am

Lo and behold, my first Max patch!

(edit: hold on, making some adjustments)

#208886
Jul 24, 2011 at 4:56am
– Pasted Max Patch, click to expand. –

Now, why are all the notes sounding so short?

#208887
Jul 24, 2011 at 6:22am

they are short because you didn’t give them a length ;)

– Pasted Max Patch, click to expand. –
#208888
Jul 24, 2011 at 6:57am

Well according to the help docs, the duration value isn’t necessary. If duration is not defined, non-zero velocity values hold until the velocity value is zero. I’ve got the notes holding longer here:

– Pasted Max Patch, click to expand. –

What I’m trying to do, is when the key is pressed, the velocity is 127, and then the key is released, the velocity goes to 0. That isn’t happening, however. I think it has something to do with the right-left processing, as when I do this:

– Pasted Max Patch, click to expand. –

it goes back to doing very short notes with the velocity reading 0. Can somebody shed light on this situation? I can’t seem to figure it out.

#208889
Jul 24, 2011 at 9:19am

You don’t really want makenote in this case:

– Pasted Max Patch, click to expand. –
#208890
Jul 24, 2011 at 4:06pm

Wow great, thanks!

#208891

You must be logged in to reply to this topic.