## creating waveforms

Jun 24 2008 | 6:24 am
A sawtooth wave form is the representation of all integer harmonics. A square wave represents all odd numbers.
Who could tell me how I could program a wave form based on prime numbers only?
Also, when a sine wave can be geometrically represented as a circle, a sawtooth as a triangle and a square wave by a square. What geometry would a prime number wave take?
What (theoritical?)wave form would a cube have to have?
(Sorry, this is not a 10000 Dollar question...)

• Jun 24 2008 | 7:25 am
Quote: hans.mittendorf@free.fr wrote on Tue, 24 June 2008 08:24
----------------------------------------------------
> A sawtooth wave form is the representation of all integer harmonics. A square wave represents all odd numbers.
> Who could tell me how I could program a wave form based on prime numbers only?
It depends on the amplitude of the partials. The easiest way to test this is to use a oscillator bank or poly~ with sinewaves. But since primes 1, 2 and 3 are going to be most influential on the sound as the lowest partials, I wouldn't have too high expectations. You could make the choice to start a higher primes.
> Also, when a sine wave can be geometrically represented as a circle, a sawtooth as a triangle and a square wave by a square.
Here you mix two types of representation. A circle can be constructed with a sine for the y-axis and a cosine for the x-axis.
> What (theoritical?)wave form would a cube have to have?
A cube is three dimensional. I don't understand the question.
_
johan
• Jun 24 2008 | 1:36 pm
Hans Mittendorf schrieb:
> (Sorry, this is not a 10000 Dollar question...)
would 10 be enough?
I came up recently with this to play around:
--
Stefan Tiedje------------x-------
--_____-----------|--------------
--(_|_ ----|-----|-----()-------
-- _|_)----|-----()--------------
----------()--------www.ccmix.com
• Jun 24 2008 | 7:27 pm
wow, really not bad. It makes clicks, I think it needs quantizing....
• Jun 24 2008 | 7:35 pm
On Jun 23, 2008, at 11:24 PM, Hans Mittendorf wrote:
> Who could tell me how I could program a wave form based on prime
> numbers only?
I have an example, that may prove interesting, called PartialWorkshop,
that I did many years ago. It allows for manipulation of the first 64
harmonics of a sound.
-C
Chris Muir
cbm@well.com
• Jun 25 2008 | 8:19 am
Hi Chris,
that's well done!
I made a prime number wave. It works well. When I used TestSnap it did not store the waveform in the buffer. How do I record it into buffer?
Thanks
• Jun 25 2008 | 11:03 am
while we're on this subject... did anyone try to make a general
solution for constructing anti-aliased waveforms? i was thinking
thought..
if anyone could share some insight, i would greatly appreciate it!
/m
25 jun 2008 kl. 10.19 skrev Hans Mittendorf:
>
> Hi Chris,
>
> that's well done!
>
> I made a prime number wave. It works well. When I used TestSnap it
> did not store the waveform in the buffer. How do I record it into
> buffer?
>
> Thanks
• Jun 25 2008 | 4:30 pm
On Jun 25, 2008, at 1:19 AM, Hans Mittendorf wrote:
> I made a prime number wave. It works well. When I used TestSnap it
> did not store the waveform in the buffer. How do I record it into
> buffer?
You should be able to record it by editing the patch to add a record~
or sfrecord~ system pretty easily. Hang it off of either the gain~
slider or the subpatcher "theSines."
If I was making this patcher today, I would probably use the CNMAT
-C
Chris Muir
cbm@well.com
• Jun 25 2008 | 4:40 pm
On Jun 25, 2008, at 4:03 AM, Mattias Petersson wrote:
> while we're on this subject... did anyone try to make a general
> solution for constructing anti-aliased waveforms? i was thinking
> thought..
In my PartialWorkshop patch, because it's additive and each sine is
controlled individually, I do a simple calculation: if the sine
frequency is > 20KHz, don't play it. It's antialiasing, albeit sort of
crude.
-C
Chris Muir
cbm@well.com
• Jun 25 2008 | 9:17 pm
>> hile we're on this subject... did anyone try to make a general
>> solution for constructing anti-aliased waveforms? i was thinking
>> thought..
>
>
> In my PartialWorkshop patch, because it's additive and each sine is
> controlled individually, I do a simple calculation: if the sine
> frequency is > 20KHz, don't play it. It's antialiasing, albeit sort
> of crude.
thanks! it's a nice patch!
but as you wrote, this works because it's additive. i'm more
interested in using arbitrary soundfiles or randomized data in
buffers as waveforms. but i still would like to get rid of the aliasing.
/m
• Jun 25 2008 | 10:10 pm
On Jun 25, 2008, at 2:17 PM, Mattias Petersson wrote:
> but as you wrote, this works because it's additive. i'm more
> interested in using arbitrary soundfiles or randomized data in
> buffers as waveforms. but i still would like to get rid of the
> aliasing.
As far as I know, once you're in the digital domain, just about the
only way to get rid of aliasing when changing the rate/pitch of audio,
is through oversampling & digital filtering (fancy interpolation) in
the rate change process. I don't think that you can just create anti-
aliased buffers.
-C
Chris Muir
cbm@well.com
• Jun 26 2008 | 8:37 pm
Chris Muir schrieb:
> As far as I know, once you're in the digital domain, just about the only
> way to get rid of aliasing when changing the rate/pitch of audio, is
> through oversampling & digital filtering (fancy interpolation) in the
> rate change process. I don't think that you can just create anti-aliased
> buffers.
With waveforms you could create additional filtered waveforms in
additional buffer. Then switch to a different buffer if you get higher
in pitch... To get steep filters use fft, and zero the higher bins, then
rerecord outside of the fft.
save as fftbricks~
save as whatever...
--
Stefan Tiedje------------x-------
--_____-----------|--------------
--(_|_ ----|-----|-----()-------
-- _|_)----|-----()--------------
----------()--------www.ccmix.com
• Jun 27 2008 | 11:18 am
> With waveforms you could create additional filtered waveforms in
> additional buffer. Then switch to a different buffer if you get higher
> in pitch... To get steep filters use fft, and zero the higher bins,
> then
> rerecord outside of the fft.
thanks Stefan! this seems to be the best way to go for me.
/m
• Jun 29 2008 | 7:21 pm
Chris,
Thanks a lot for the Partial Workshop. This will no doubt be great for a relative newbie like me to study. One question has arisen for me, looking at the "Partial" subpatch. What is the advantage of running phasor~ into the phase inlet of cycle~ rather than simply running the frequency straight into cycle~ itself?
• Jun 29 2008 | 7:48 pm
On Jun 29, 2008, at 12:21 PM, Jay Bodley wrote:
> What is the advantage of running phasor~ into the phase inlet of
> cycle~ rather than simply running the frequency straight into cycle~
> itself?
Because all the oscillators for the partials are free-running, I
needed a way to sync them. Using the phasor~ allowed for this.
I know I keep saying this, but if I was doing this patch today, I
would probably be using some of the additive stuff from CNMAT, FWIW.
-C
Chris Muir
cbm@well.com
• Jun 29 2008 | 7:54 pm
And why can this not be done in the right inlet of cycle~? I am under the impression it serves the same function as phasor~'s right inlet.
• Jun 29 2008 | 8:45 pm
On Jun 29, 2008, at 12:54 PM, Jay Bodley wrote:
> And why can this not be done in the right inlet of cycle~? I am
> under the impression it serves the same function as phasor~'s right
> inlet.
I don't think that that's true:
Chris Muir
cbm@well.com
• Jul 16 2008 | 11:45 am
O.K Stefan, your patch is convincing. I agree on the \$10 reward!