this seems super obvious, but I can't figure it out.

I am trying to plot a curve on an array with certain points.

when x = 0, y = 38.89

when x = 6, y = 41.2

when x = 11, y = 43.65

I'm calling this array pitches1

in a message box i'm putting this

;pitches1 0 38.89 6 41.2 11 43.65

i also tried this

;pitches1 0 38.89, 6 41.2, 11 43.65

when using [tabread pitches1] and i input a 0 I get 38.89, a 1 outputs 6, a outputs 41.2, a 3 outputs 11, 4 outputs 43.65. Not the desired outcome.

what i want is 0 outputs 38.89, 6 outputs 41.2 and 11 outputs 43.65. and if I input a number like 3 it will be on the curve between 38.89 and 41.2. Does this make sense? So I want to plot a curve along several given points, but I don't want to input every value of x, only certain ones like 0, 6 and 11, and I want Pd to figure out the in between values.

Is this possible? And how would I format a message box to achieve this?

thank you!

]]>this seems super obvious, but I can't figure it out.

I am trying to plot a curve on an array with certain points.

when x = 0, y = 38.89

when x = 6, y = 41.2

when x = 11, y = 43.65

I'm calling this array pitches1

in a message box i'm putting this

;pitches1 0 38.89 6 41.2 11 43.65

i also tried this

;pitches1 0 38.89, 6 41.2, 11 43.65

when using [tabread pitches1] and i input a 0 I get 38.89, a 1 outputs 6, a outputs 41.2, a 3 outputs 11, 4 outputs 43.65. Not the desired outcome.

what i want is 0 outputs 38.89, 6 outputs 41.2 and 11 outputs 43.65. and if I input a number like 3 it will be on the curve between 38.89 and 41.2. Does this make sense? So I want to plot a curve along several given points, but I don't want to input every value of x, only certain ones like 0, 6 and 11, and I want Pd to figure out the in between values.

Is this possible? And how would I format a message box to achieve this?

thank you!

]]>For populating the indexes in between I have patched this that seems to do that.

Hope it helps.

]]>i found a function that matches your values here: http://www.xuru.org/rt/PR.asp#CopyPaste and put it in a patch: array-test.pd.

]]>Thank you both for your help.

@ingox this isn't really a function, it's values from a sensor so that won't really work because it's not consistent.

@weightless, thanks for this patch. This does exactly what I was trying to acheive.

A couple questions. I am on vanilla, and I don't have [list-seek]. I searched for it in deken and can't seem to find it. It's not that big a deal though, because I know in the end my list will be 127 values and I can resize it in the properties of pitches1.

Also, I can't seem to find the [once] object. where can i find that object? also what is that part of the patch doing? maybe I can work around it.

But thank you! This is a great help and I'm sure I can modify this or make it work some how.

]]>a vanilla once: once.zip

]]>

The part where there is [once] basically skips the calculations for the first value, since there is nothing to calculate but just write the first value at index 0. This is why I used once, because after that you need to calculate the numbers in between the last 2 values. Does that make sense? I realise the patch is pretty messy but I couldn't think of a more elegant way to do it.

EDIT: also the list and list-split that come after [once] only output after the second float they receive, so that's why I put them that way. The first float (needs to be the value for the 0 index) goes to the once object, the others to the list-split which concatenates the last two floats.

]]>Ok this is excellent. Thanks for the vanilla [once], now the patch is working perfectly.

Also, I do have [list-seek], but I have to format it like this; [list-abs/list-seek]

Seems like a very useful object.

Thanks again and I think this issue is solved.

]]>Looks like I spoke too soon about this problem being solved.

The patch @weightless uploaded worked, but as soon as I started adding items to the array plot the values weren't being calculated correctly.

I'm gonna keep working on this, but if anyone has any ideas please let me know. It looks like when you get to 15 the calculations break down, and aren't being input correctly, or are being calculated correctly.

Let me know if anyone sees the problem.

thanks, Nick

]]>The last, longer list still doesn't work because the indexes are not in ascending order. I'm not sure whether my approach could be made to work if the indexes in the list are scrambled, and I'm a bit too tired now to try and figure that out. Maybe a possible solution would be to sort the indexes before sending the list, making sure that the first is always 0, and the others are in ascending order.

]]>thank you for posting these. I think this one will work, and the sorting patch helps too.

I'm sort of surprised there's not an easy way to do this at it's such a great way to use an array. In Max I use the "function" object. Anyway this is very helpful and thanks for you patches.

]]>When you posted this I was also convinced there would be an easy (or built-in) way to do this, and I'd be very curious to know if there is, also to calculate the in-between values with different curves.

]]>Limited to 42 triples, but that is actually quite a lot.

It can be accessed in Vanilla though just by pointing Pd at the library.

Serious work could be done in extended, that is now difficult (osc and bp~) or impossible (pmpd, Gem except windows) in 64bit Vanilla.....

...... which could be why Apple Mac's were prone to overheating...... (only joking? a bit?.... maybe not?).

David. ]]>