• ### why saw and square 'sound' louder?

Hi good people
I'm building a semi-modular synth in PD, with no prior experience, and step 1 is choosing wave shapes (sine, triangle, saw and pulse/rect). I've seen examples where they've used a lookup wavetable for oscillator waveforms, but I'm just using a single [phasor~] and then some simple maths operations to change its shape. I'm not imagining it, but the saw and square sound way louder and harsher than the other two. Is it common practice to reduce their amplitude and/or apply a low pass filter? Or should I be using a wavetable?

Many thanks for any help
Brendan

• Posts 14 | Views 1824
• @brendanmac lets look at it.

from an electronics perspective it looks like a square wave represents a steady DC signal the closest (meaning if you were to flip the 0 to -1 part it would be a straight line) besides at the crossings and the others look filtered.

Its interesting how there's a subtle difference at the peak of a sine vs a triangle, the sine hits red a little. In vintage analog synths a "dirty" triangle wave could be mislabeled on the synth as tho it is a sine but it looks like it has the least energy. Also from vintage synths if you look at the waves in a scope they look different than you would think, especially something like a 303 (filtering out the DC maybe?). A function generator (which this basically is) is more like what you think of these basic waveforms in your head.

the live electronics tutorial included in [else] is top notch btw (as is the audio section in the help browser, thats supplemented with a free online book on miller's website). a saw has all the harmonics, a square odd, triangle even, and they can be separated or combined. a (co)sine wave is the only signal that can travel through electronics without change phase (which can mess up what you are seeing) one reason why its used to probe inside audio electronics

also to note, the oscope~ on the top was just to show that the [phasor~] normally comes out at 0-1 (normalized float which is easy to use as a looping function) so it has to be stretched out to be used like a sawtooth
testWaves.pd

• Thank you @fishcrystals, I must check out that library.

Brendan

• Hallo
sorry to bang on about this - I have done further reading and cannot find a simple solution to antialiasing a square wave oscillator. There is of course the [square~] object in Purr Data - should I just use that?

Many thanks
Brendan

• I went with this - it is subjectively okay

• @brendanmac The Pd help examples contain two ways to address aliasing. J07.oversampling.pd shows how to use oversampling to create a better alias filter--just replace the phasor with your preferred method of generating square waves. J09.bandlimited.pd replaces the jump with a specific kind of squiggle, but for a sawtooth. If you want to do the same for a square wave, I think all you have to do is replace the phasor~ with the equivalent triangle wave. It's called "transition splicing" in Miller Puckette's book https://msp.ucsd.edu/techniques/latest/book-html/node196.html

• @brendanmac there's some vanilla abstractions (meaning they should work in purr data, plug data as well as PD vanilla, theyre just made out of the most basic pure data vanilla objects), copy these to the same folder you are working in and type os.square~ into an object box aka [os.square~] , then right click the help (or just open the help file) os.square~-help.pd os.square~.pd
these and other goodies are in mkmr to get you going quick in most of the flavors of pd because theyre vanilla https://github.com/MikeMorenoDSP/pd-mkmr
some other good links at https://github.com/MikeMorenoDSP/awesome-puredata

• Thank you so much for these, will get stuck in later today.

xx
Brendan

• from Miller's book " In case you were hoping, subtractive filtering can't remove foldover once it is present in an audio signal."

The learning continues. . .

• there is no need to measure the RMS of a known waveform, since you can calculate it offline much more precise. the energy of a wave/halfwave/periodic vibration is the size of the geometric surface: 1 for square, 0.5 for tri and saw, 0.707 for sinus...

Posts 14 | Views 1824
Internal error.

Oops! Looks like something went wrong!