full spectral sound

thegoldenfool's icon

hello!

I want to build a patch wich produces the full frequency range from 60 to 20.000 HZ. but not white noise. I want to play all the frequencies at the same time, not randomly. like a big buzz.

I mentioned an additive synthesis object, where I put just specify the frequency range and the offset between the frequencies.
does something like that already exist?

thanks a lot!!!!

Tim Lloyd's icon

Have a look at oscbank~ and ioscbank~ and the CNMAT objects sinusoids~ and oscillators~. I've never tried any of those objects with as many frequency components as you would need - they might not support that many. I'm not sure how different that would sound to the noise~ object, because the end result is basically the same thing as I understand it. Noise~ (I'm guessing) uses an equation and you would be using 19,940 wavetable oscillators, which you'll find to be veeeery cpu heavy.

thegoldenfool's icon

ok I'll try all wat you said.

noise~ white noise is very moving

what I need is a static buzz

yes I need a lot of oscillators but actually I dont want to modulate the sound, so I could split it in many frequency bands and to compute one after an other, record them and mix it at the end all together.

I just dont want to build 19,940 oscillators by clicking and typing in MAX

sinusoids~ looks good, I'll try it

thank you!

Chris Rolfe's icon

Wouldn't he end up just approximating an impulse response? IE, a single big click. Probably easier just to make the click, man.

Jean-Francois Charles's icon

uzi (a real one, not the max object)

Chris Rolfe's icon

Pedagogy's not really my thing, but the thought of someone summing 19,940 sine tones is just too awful to let it pass.

If you sum every frequency from 0 Hz to the Nyquist, the result is a click of length one-sample. It's called an impulse response and contains all the frequencies. If that's what you want, use click~

Chris Muir's icon

I think that the concept of "all the frequencies" is sort of bankrupt. There are an infinite amount of frequencies in any given range.

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

Here's an approach that loops a shortish buffer of noise and plays it as an oscillator. It's certainly nasty, but I have no idea if this is the sort of sound you're going for.

Chris Rolfe's icon

Well, in a discrete signal you have the Nyquist and it's harmonic series which can represent any frequency between 0 Hz and the Nyquist. So not quite a bankrupt notion in discrete terms. The error he's making is assuming that additive synthesis ad infinitum will make a complex sound.

Chris Rolfe's icon

No, I take that slightly incoherent bit of DSP back. It assumes an infinite length sample.

In your example above, though, the fundamental is determined by the period of the loop w/ harmonic components at levels determined by the noise. Probably closer to what the original poster intended.

My main point was that summing 19+ thousand sine tones was going to give a trivial result.

Chris Muir's icon

Summing 19K sines would result in something somewhat like white noise, anyway, I think.

I agree that my example had a buffer-length fundamental, but the original poster wanted a "buzz" which implies a fundamental to me. If the original poster wants to extend this to playing back a couple buffers of different lengths/frequencies, they could achieve different spectral weightings.

As far as "all the frequencies" goes, the original post asked to fill the 60 Hz to 20 KHz range by playing "all the frequencies." But what frequencies? 60 Hz then 61 Hz then 62 Hz? What about all the frequencies between 60 and 61?

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

Here's one more take on the somewhat ill-defined problem that plays eight octaves of each of twelve pitches.

Chris Rolfe's icon

Train~ with a narrow pulse width would accomplish a flat spectrum of sines, spaced by the fundamental (period).

Again, a perfectly flat spectrum from 0 Hz to the Nyquist is an impulse response, i.e., a single sample at full amplitude. It contains all frequencies.

I.E. all frequencies (yes, including all the one's between 60 and 61) from 0 to Nyquist = ... 0 0 0 0 1 0 0 0 0 ....

19k sines would come close to approximating an impulse response. It would not sound like white noise, but a click. Put a little space in between frequencies (like train~) and you'll get a buzz.

AlexHarker's icon

"Summing 19K sines would result in something somewhat like white noise, anyway, I think."

Actually it's a little more complex than that - It depends on which sine tones and their phase alignment.

If you consider the FFT of a single sample impulse and 'idealised' white noise you will note that they are identical in terms of amplitude spectrum - both are totally flat across the entire representable frequency range (up to the Nyquist). In the phase spectrum however the appearance is quite different - with the phases of the impulse depending on where the impulse falls in the analysis window.

A third scenario for equally spaced harmonics (as in the FFT model) is total phase alignment, where all components are phase aligned every window. This creates a fairly tedious harmonic buzz which you could make like this (needs to be hosted in a pfft~ with overlap 1 - the fundamental depends on the FFT size):

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

Of course, in a case where the sine waves are not equally spaced in the linear frequency domain (as is the case with the FFT model) then the results will be potentially more difficult to predict, according to how the sine tones are organised in terms of freq, amplitude and phase. It could produce a very complex sound, or one that is less so.

In terms of the original post a "big buzz" is a bit vague - the buzz from equal amplitude, equally spaced sines is almost certainly more piercing than is appropriate (too much high frequency content) and white noise or an impulse are obviously not what is required. Equal log spacing (as in chris Muir's post) might be more appropriate - or some degree of randomisation of the frequencies / phases to create a more complex sound...

Regards

Alex

AlexHarker's icon

Just saw Chris Rolfe's new post:

You would not wrong in saying that an impulse of one sample has a perfectly flat spectrum from 0 Hz to the Nyquist.

However, you are wrong to say that:

"Again, a perfectly flat spectrum from 0 Hz to the Nyquist is an impulse response"

for the reasons given in the post above...

Also the term impulse response does not mean a single sample impulse - it means the response of a system to an input which is an impulse (in a digital system typically a single sample).

Hoping to bring some clarity to the debate,

Alex