i’m looking for a way to do this in max:
does anybody know what the formula is (or where to find it)?
i need something that takes inputs for fundamental freq, nr of partials and partial stretch and returns a list of freqs.
Your browser probably allows you to see the source code.
For example with firefox : menu : view->page source
And you’ll see the js code.
The [mtof] object does most of the work, then its just a matter of multiplying by the partial number. Here’s a patch to illustrate, half of it is just formatting for the [jit.cellblock] display.
----------begin_max5_patcher---------- 1888.3oc2b10bahCEF9ZmeELdyNSaWWuHIP.6Ua2Ouq6NydYmcxfskSngOx. 3zz1o+2Wgjvl3.0GK.Q2jLiIFifCObNuRmijymuX17UYOvJla8SVuyZ1rOew rYhcUsiYp2OadR3CqiCKDG170YIIrzx4KjeVI6gRw9+6v7xnvXq2tKYEKu9i uKmUvO5vxnrzqxYqKkWJjWvR6EVHpa0l.T0qX6k1V+qpco6Rx1UFyJEWT65y VX45ahRutwYhDPEMF4tjv+A625oqoYT0NjZ+ayRKSCSXh6f2jys+ZCOZiXeY qd+qQH77FGeQzmDGOBuz9f0FkVarnp88kKtn5kECDT+mxbF+VGHUcD.vm1ap hBr2S0VNc8jp1SEU+q0kg2y.BSjW0Fmf9CS5AWzVNc8Cl19SEL+kvBl0ayJA xy.R0qTu9iSG6NNS8jjzwljIrhhvqYOgj4Yenv5Rz7VAR8MgbWke7NljFyme 399orhhENudhMtBYAjeCTADINmCRvZfjT1G3WomPjOEaEUxxs5fI3NYxhSvE t3ivsQBlVhFABFxDAFtK9crzMVErRK6gzgQAFBUrw2QOvDDL1wPcwkv02ZYa YubLXBwWvDWccVrmHmk0Y6RKOLjrGiDmtPRTkVuJTZg7sPfDRHN6QzERnyAR tCGjJsVYs8LkYVEldcEa1FmEBhN3.GUXkqdzAOUwUMzaFzNnv1TYOT8SuwcZ 0aJFCj3Hka7zDIzmypM0LB2K0l.uITrIVSwFPbw1QkAnV5LA9eCHyfGzXpff F9KZKy3LwCqYLPxdWE8PB4YsLijQDebejY7ClPYlHMkYfhFUhBt5oz3OUJMi 7v8vhjDPDQm2DrlvgNQvgSiB11n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B1IQatKiiMkU3IlAMm.rzAKX+6jEe7 Id.PsVeHF6w2RmzZCDcPI+BOIs7p+tmlZvXvUhs+3.1p094fasUecxFEqsZN nsvmzM.8ni5ol65r3rbYKD5FMeA6ZG3uusGciYByOv6+yVe0p05aRqGCIrTb KdFN5CAQQmvlpJxrosoSqzRLpQU8MhYvUo5oMcLC5hTXCaU1.rpi343aTHPn x1vVEFP3mzpPF1prA0Gm4XU0JU4zdU9lUTvGviupuHGF7oW.HN4ZVNAQQ+HC 2HO6rgLRHCZSPzyCLamL9f7wIF0G2GRmwADyyIaHiM0fijBRpU9lUyzGzXVN Ss.rqHcOjq7eQA38uou.jBv42yrhofJDA1rCjwmNBOTQDmQ4gpOjGpUyzqAU zvPhJ7MaOjHHpr9NlW83jO6bL5yNHCtwmX3DKfTpAiZRvJepY6dDhpE0rp6T HBAdlUHfBYXDTy5NQgD0QMLmfTiApgUBfvIrYEwwfpEiY8mDCNACYPAFjS1i vnpFBaBA4YmAKXkKnpnYdaZn6ui3HmtP02lR252zWaET895S+f727kK9OOVq n4. -----------end_max5_patcher-----------
@ thereishopeforus : i can see how mtof could be involved but that still doesn’t give me the formula to create a natural harmonic series. mtof is based on midi notes, which represent a tempered scale. in a real harmonic series an octave is not exactly an octave anymore when you go up a few steps. nevertheless i’m curious about your patch, only i’m still on max 4.6 so i can’t open it. could you post a 4.6 friendly version?
thereishopeforus, very neat!
Here’s a screenshot, you should be able to piece the patch back together in max 4. The [coll] contains 0, C; 1, C#; etc up to 11, B; Hopefully you can make out that the first "bang" of the [trigger] object below the [vexpr] is going to all centre inlets of the [counter]s to reset them. If you have any questions feel free to ask.
very cool patch, thanks hope! nicely organized too, very clear.
@xaf: look to the js object. If you’re familiar with programming in something like Flash, this might be familiar too. In Flash you access all your objects by Instance Name, whereas in Max you don’t usually need to, but you can. If you give your objects Scripting Names (in the Inspector) then you can get/set properties through js, and also through scripting messages to [thispatcher]. It’s just that for most things, you use patch cords or send/receive. So you can do it in a bunch of ways. Try some of the js examples to get a feel for it. Then maybe you can grab the code from the website and mangle it to fit.
Then again, you can see that the Max objects in the example patch are doing something similar to the code, so there are lots of approaches. Sometimes a snippet of code is just the thing to make life easier or less messy, but you’ll find that you can accomplish most things with regular objects and cords too.