## [expr] help

Feb 19, 2009 at 1:20pm

# [expr] help

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?

#42396
Feb 19, 2009 at 1:50pm

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
>
>
>

http://www.trblnc.org

#151744
Feb 19, 2009 at 6:41pm

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.

#151745
Feb 23, 2009 at 2:31am

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.

#151746
Feb 23, 2009 at 6:00am

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. –
#151747

You must be logged in to reply to this topic.