Forums > MaxMSP

### [expr] help

Feb 19 2009 | 1:20 pm

OK. I am very tired and I need some help.

I’m trying to write a function with expr that will turn the following values:

880 -> 0.84
440 -> 3.1
220 -> 7.65
110 -> 16.73

and everything in between of course.

Anyone got any ideas on coming up with a general formula from a series of values?

Feb 19 2009 | 1:50 pm

mathematicians might hate this but…

— Pasted Max Patch, click to expand. —

p

Alex Mesker wrote:
> OK. I am very tired and I need some help.
>
> I’m trying to write a function with expr that will turn the following values:
>
> 880 -> 0.84
> 440 -> 3.1
> 220 -> 7.65
> 110 -> 16.73
>
> and everything in between of course.
>
> Anyone got any ideas on coming up with a general formula from a series of values?
> —
> x37v.com
>
>
>

Feb 19 2009 | 6:41 pm

If you Google on ‘method of least squares’ you will probably find an applet somewhere that will generate a polynomial for you.

You might, however, be looking for a hyperbolic function, something like k/x.

What is it you’re trying to model? I’m tired, too, so it’s not immediately obvious here.

Feb 23 2009 | 2:31 am

Thanks both for the replies.

pure, that’s not a bad place to start actually, but in order for this to work I would have to map all frequencies.

Peter, I am trying to create something along the lines of a Karplus-Strong string-synthesis-style pitch generator. I know there are a couple of objects out there designed for this, but I have a couple of things in mind that I would like to do differently.

The numbers I posted before were frequencies and the corresponding delay times in ms required to match that frequency.

It’s days later and I still haven’t figured it out. Least squares method looked promising, but I am thinking that this curve is hyperbolic or logarithmic as you suspected.

Back to crunching some more numbers.

Feb 23 2009 | 6:00 am

X37V wrote on Sun, 22 February 2009 20:31

Back to crunching some more numbers.

Probably this won’t give you an answer, but it might give some ideas, and it’s interesting to mess with… change the expr and scaling etc. to suit. Possibly some combination will at least get you close to what you’re looking for.

— Pasted Max Patch, click to expand. —
Viewing 5 posts - 1 through 5 (of 5 total)

Forums > MaxMSP