Replacing values from a table with values from another table


#1

i'm trying to make a patch that replaces note values in note on/off MIDI messages.
(this should work as alternative layouts for my input devices.)

there are 2 tables/arrays, the values from the 1st are to be replaced with values from the second, in strict order, e.g. 1st element from one table/array is replaced with the 1st element from another, 2nd with 2nd, etc.

so far, i've managed to write those 2 arrays, and stuck.

now ... what? how can i do the replacement itself? any examples or tips?

thanks in advance.


#2

Maybe try rbrts object called rbrt/data/tcopy.

You can use it to copy from one table to another, it can do exactly what you describe above and more than that :slight_smile:


#3

cool! will fiddle with it right now.
(i suspected that this patch will use rbrt's objects, because it is primarily for my new shiny launchpad :grinning:


#4

unfortunately, still can't figure out how tcopy works, and how to get output from it.
must invent another approach.


#5

If you post your patch, or atleast a picture of it, its a bit easier to help you out.

We don't know what is going on in your patch and how its set up, so it a hard to give you some concrete feedback.

I use tcopy and it works great. But we just need to see the patch, to be able tell you how it can be implemented into your patch, which changes you need to make, etc..


#6

well, the problem is there's no patch, because i don't understand now to connect it.
i also tried to find any existing patches with any use of tcopy, but with no success.


#7

I am just referring to that you mentioned that:

So I thought you all ready had patched some thing and you only needed to implement the tcopy object. You need to have the 2 tables that you want to copy "from" and "to"... And then you use the tcopy object to actually copy the content from one table to the other table. So the basic patch needs to be made, before you can start trying using the tcopy.


#8

at last, found an example patch using tcopy, so now i almost got how it works.