Synthesis

Shape's icon

Hi !

I created this patch to reproduce a sawtooth and control the parameters individually. I think the max patch is correct but... the graphical representation does not correspond to a sawtooth at all!

Does anyone know the reason?

Thanks for your help

Macro Patch:

Max Patch
Copy patch and select New From Clipboard in Max.


Poly~ Subpatch:

Max Patch
Copy patch and select New From Clipboard in Max.

Roman Thilenius's icon
Shape's icon

Thanks Roman for your answer. You are right, this is a good way to make a sawtooth.

I was looking to reproduce a sawtooth from sine wave addition. It is for this reason that I use the "Poly~" object .

In more detail, here are the characteristics that I tried to reproduce:
- Additive synthesis: addition of sine wave to reproduce a sawtooth.
- Amplitude: The amplitude is equal to 1 / n where n is equal to the partial number (2nd partial = 1/2, 3rd = 1/3, 4th = 1/4, ...)
- Phase: Each harmonic partial phase shifted by 180 °. The object "expr Si1 & 1" allows me to output a 1 for odd numbers and 0 for even numbers. The "sel" object then selects the corresponding phase. (1st partial = 0, 2nd = 0.5, 3rd = 0, 4th = 0.5, ...)

The patch respects the characteristics of the sawtooth (if there is no error). But the visualization shows something totally different. I do not understand why...

👽!t W∆s ∆lienz!👽's icon

few things here make it difficult to explain the whole problem, but two basic things to focus on first:
1) you wrote: "amplitude is equal to 1 / n"
if you have many voices at once(particularly at such an experimental stage), they add up quickly:
1st = 1/1 + 2nd = 1/2 + 3rd = 1/3 + 4th = 1/4 == 25/12 = 2.0833333..(with only a few partials so far we have a possible total amplitude of 2.083333)... still need to scale the amplitude beyond that(i took a guess in my patch, but you can be more exact)

2) you wrote: "Each harmonic partial phase shifted by 180 °. The object 'expr $i1 & 1'...." ...a good efficient equation for detecting odd-numbers, but setting cycle~ object by an 'event' in its right-inlet will not synchronize all cycle~ objects properly at sample-rate(a better way is to drive all cycle~ objects with the same phase-signal... probably best sent from outside the poly~... and then add offsets to that within the poly~...)...

here's my version of your patches(in .zip so they can load up easily without having to reconnect the main patch after saving by appropriate names, etc.), i've limited it to only 512 voices because you don't really need too many to start seeing how the waves add:

SumCyclesInPoly.zip
zip 5.75 KB

hope it helps 🍻

Roman Thilenius's icon


ah, and i was wondering what you are doing there.

yeah, like raja said, dont forget the phase shift - which in the case of +- 180 can be reached by [*~ -1]

1024 is lots, btw.

and... i wouldnt do any of the math inside the poly. it is enough to do it once.