I currently have a formula written out in pure data that constantly calculates the distance between a point and the two edges of an oval. The point is constatenly rotating on this oval. I now need to understand how can I take this math and take the distance of three lines and make it into a wave form that is in constant change based on these values. This motion may be familiar to some of you in the attached image below, however my question is merely once the math is done how can it be translated into a waveform that produces audio?
How to make a waveform from a mathematical formula
.. use the value and put it into
[dac~]? (after it's been scaled between -1 and 1)
that may have to be done w/ a
[expr~]or series of math objects or something, you might have to be more specific. (the diagram is somewhat vague and hard to decipher)
the best thing to do is post your current patch with comments, then we can see what's going on
if you have a function or graph with more than one dimension, like in your example or in the usual chaotic attractors, you would simply take these dimensions individually and derive 3 signals from it.
then you can take only one of them, or mix them against each othe, or sum them, or multiply them squared or whatever you wish.
in order to do so, you would simply rebiuld the code so that it produces values betwee -1 and 1, (which can get tricky when used a low resolution arithmecis before), and when it works, you´d make a version with signal objects (which is often simpler than you thought)
You could write the values via a sinesum message to an array
There are several ways you can turn that into audio.
It would help if you could share a screenshot or pd patch of what you have so far because it can be overwhelming to hear a bunch of things just off the top of my head.
Off the top of my head tho
-using [until< to loop through the math you have or if its made at audio rate use two [snapshot~] to sample the x and y - converting the up/down coordinates to -1 to 1 and dynamically put it into an array/table - the table has to be a power of two + 3 samples 131, 259. This is a periodic waveform that you can then play with tabosc4~ (possibly also putting that into sin~) I made something similar but just getting the point it touches the oval
@mikkejos22 rotable.pd sure ⛒ btw - writing to the array and playing it at the same time will basically make every kind of snap, scritch, crackle, pop from sample noise that would need to get filtered or dealt with - oh here's one that gets into how to iterate over an array - lots of examples vintageIteration.pd
Maybe please have a look there :
My Youtube channel // Ma chaine Youtube // Mi canal Youtube // https://m.youtube.com/@laclipcre-oleonisilpleut1986