I’m trying to find a tutorial that will allow me to create sound from an equation.

I now about the expr command but I’ve been unable to find one that creates a simple sound using the sin wave equation with adjustable variables. I know I could just use cycle~ But my equations are a half a page of sines and cosines. Do you know of a simple example like this equation

y = A*sin(w*x)+cos(w*x)+d that will allow me to adjust the variables x,d and A and play the audio file.

Here’s a very small sample of the equations I would like to put into max msp and

have it play, along with some of the adjustable variable names.

y= -0.00000000+VERTOFFmain_1+aad_1

+((AMPmain_1+aaa_1)*0.000000000021538)*cos((FREQmain_1+aab_1)* 1.0 *(t-(((PHASEmain_2-PHASEmain_1)+aac_1)/(FREQmain_1+aab_1))))

+((AMPmain_1+aaa_1)*0.000000302338232)*sin((FREQmain_1+aab_1)* 1.0 *(t-(((PHASEmain_2-PHASEmain_1)+aac_1)/(FREQmain_1+aab_1))))

+((AMPmain_1+aaa_1)*0.000000000086163)*cos((FREQmain_1+aab_1)* 2.0 *(t-(((PHASEmain_2-PHASEmain_1)+aac_1)/(FREQmain_1+aab_1))))

+((AMPmain_1+aaa_1)*0.000000604757095)*sin((FREQmain_1+aab_1)* 2.0 *(t-(((PHASEmain_2-PHASEmain_1)+aac_1)/(FREQmain_1+aab_1))))

+((AMPmain_1+aaa_1)*0.000000000193911)*cos((FREQmain_1+aab_1)* 3.0 *(t-(((PHASEmain_2-PHASEmain_1)+aac_1)/(FREQmain_1+aab_1))))

aloha

Rick

audio rate implementation of y = A*sin(w*x)+cos(w*x)+d

Look at sig~, *~, +~, sin, and cos.

]]>y = A*sin(w*x)+cos(w*x)+d that will allow me to adjust the variables x,d and A and play the audio file. Without using multiple sig~.

Simple Example: One equation with 3 variables

1) use the equation y = A*sin(w*t)+cos(w*t)+d creates the waveform shape

2) can edit the A,w,d

3) plays the waveform.

Is this possible?

]]>If you can code, I would recommend you do that.

Alternatively, you could create an abstraction that would contain

the Max implementation of y = A*sin(w*x)+cos(w*x)+d, then you could

use scripting commands to create as many instances of it as you wanted

with what ever parameters you wanted. And sum them all together.

If you don’t want to go through the learning curve of creating your own external in C you can always try the MSP implementation in Max’s Java environment, mxj. You’ll have to learn Java of course, but it’s probably a bit smaller of a hill to climb…

]]>brad

]]>There’s also a folder there called “mxj~ examples” with source code.

]]>One you may not want to climb.

I think what you need is an external that lets you specify a sine wave

and how many partials and partial strength. Have you looked at oscbank~?

may I suggest using [gen10] from percolate (GEN10 also exists in Csound).

If you opt for SuperCollider as noted above, check the “/b_gen” command in the Server-Command-Reference and DynKlang.ar/Klang.ar!

Finally, you could think of implementing your equations as a [js] (JavaScript) object, sending values to control an (i)oscbank~

Cheers

Panos

1) use the equation y = A*sin(w*t)+cos(w*t)+d creates the waveform shape

2) can edit the A,w,d

3) plays the waveform.

why not [uzi], [expr], then peek~ to write the values to a buffer? I did this in a past project to create buffers out of sin functions, with adjustable coeffs and power functions. Just change the [expr] to whatever function you want, choose how many samples you want to generate, and use the appropriate [scale] to get the range of values you want (probably between -1. and 1.). The calculations aren’t totally smooth but they’re plenty fast to experiment with.

http://www.third-space-mind.com/max/max_classproject_2.htm

The functions are limited, but you can get a lot of interesting sounds out of it, especially when you choose the different sections of the waveforms to play back and the playback rates. You can also record the audio and automate some of the parameters.

]]>