[PD] get sinusoid from a sine and a cosine oscillator

Charles Z Henry czhenry at gmail.com
Thu Jan 30 17:36:08 CET 2014

That's the point I was making.  By (x,y)->x  I mean that you'd just use the
x (cosine table) for example.  The easiest projection is to throw away axes

If you're making shapes as repeated paths in 2-D, then taking a projection
(along an axis  x y or any rotation of x,y) will generate a signal that
makes sense and generalizes, creating simple sinusoids for circles and
complex tones for different shapes.
The pitch would vary by how fast the path is repeated, and the timbre would
vary according to the shape.  The amplitude would vary by the size of the
shape.  Those are simple rules--and may not be what you're interested
in--but it would be consistent.  For example, using a square in it's normal
rotation and projecting along x or y alone, you'd get a "square wave".

If you want to use a contribution from both of your axes, you can just sum
them together.  (x+y)*sqrt(2)/2 is just a projection along the line x-y=0

On Thu, Jan 30, 2014 at 10:17 AM, Alexandros Drymonitis <adrcki at gmail.com>wrote:

> In the case of the circle I could just use one of the tables, since one
> has the cosine and the other the sine, and output that as an oscillator,
> but if I want to combine functions to create shapes, e.g. one function for
> the x axis and another for y, how can I combine these two dimensions in one?
> I don't really get what you mean by (x,y)->x or (x,y)->y, or the equation
> you wrote (tried it but didn't sound as expected, maybe my implementation
> was wrong).
> On Thu, Jan 30, 2014 at 6:06 PM, Charles Z Henry <czhenry at gmail.com>wrote:
>> You  don't want fft~/ rifft~ for that.  It's a mapping between large
>> structures on blocks and single-samples (and vice-versa).
>> To get a single sinusoid from a path-defined circle, you just project
>> onto a single dimension.  For example, (x,y)->x  or (x,y)->y  or (x,y)->
>> (sqrt(3)/2*x+1/2*y).  In the case of a circle, all the axes you would draw
>> through the circle work equally well.
>> Chuck
>> On Wed, Jan 29, 2014 at 2:44 PM, Alexandros Drymonitis <adrcki at gmail.com>wrote:
>>> Yeah, well I'm trying to create shapes in Gem (say a circle) and create
>>> the sound they make. So, to make a circle, I'm making a ramp from 0 to 1,
>>> multiply it by 2pi and send it to [cos] and [sin] and store these values in
>>> two tables, which I then read for every instance of a [circle] (using
>>> [repeat] and [separator]). So, since for any shape, you need two
>>> coordinates, x and y, my thought was to use these two coordinates as the
>>> real and imaginary part of an FFT, merging the two dimensions in one.
>>> After the sinusoid, I'll try to make other shapes too, but I wanted to
>>> start from that to make sure that I hear exactly what I see.
>>> On Wed, Jan 29, 2014 at 10:30 PM, Charles Z Henry <czhenry at gmail.com>wrote:
>>>> What you seem to be doing is creating a spectrum which has magnitude 1
>>>> everywhere, and the phase is varying at a constant rate vs frequency.  That
>>>> means it has a constant group delay.
>>>> So... my guess is that you'd get an impulse in each block, whose timing
>>>> depends on the rate of the phasor.  When you vary the phasor frequency, it
>>>> will coincide with the peak of the hann window at some point and be its
>>>> loudest.
>>>> Should be a periodic complex tone.  I don't understand your goal:
>>>> you've got sinusoids in the patch... to generate sinusoids?
>>>> Chuck
>>>> On Wed, Jan 29, 2014 at 9:12 AM, Alexandros Drymonitis <
>>>> adrcki at gmail.com> wrote:
>>>>> Say I have a full sine and a full cosine cycle stored in two tables.
>>>>> I'm trying the following to get a sinusoid from [rifft~] but it doesn't
>>>>> work.
>>>>> [phasor~]
>>>>> |
>>>>> [*~ sizeOfTable - 3]
>>>>> |
>>>>> [+~ 1]
>>>>> |\
>>>>> | \
>>>>> |  [tabread4~ sine]
>>>>> |   \
>>>>> [tabread4~ cosine]
>>>>> |      \
>>>>> [rifft~]
>>>>> |
>>>>> |    [tabreceive~ hann]
>>>>> |    |
>>>>> [*~ ]
>>>>> |
>>>>> [/~ 1536]
>>>>> I've set the block size to 1024 in this subpatch, and there's a hann
>>>>> window in the parent patch as well. The tables have three guard points,
>>>>> that's why I'm multiplying [phasor~] by the size of the table minus three
>>>>> and then add one.
>>>>> The output of this is a waveform with very low amplitude that kind of
>>>>> bounces up and down within a sine like mask. Don't know if I'm making my
>>>>> self clear. My main question is, how do you get a sinusoid out of a sine
>>>>> and a cosine? Also, what's wrong in my approach?
>>>>> _______________________________________________
>>>>> Pd-list at iem.at mailing list
>>>>> UNSUBSCRIBE and account-management ->
>>>>> http://lists.puredata.info/listinfo/pd-list
>>>> _______________________________________________
>>>> Pd-list at iem.at mailing list
>>>> UNSUBSCRIBE and account-management ->
>>>> http://lists.puredata.info/listinfo/pd-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20140130/b8554ce5/attachment.htm>

More information about the Pd-list mailing list