Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

SQR and PLS Oscillators

Post any examples or modules that you want to share here

SQR and PLS Oscillators

Postby TimC-uk » Wed Jan 16, 2013 3:13 am

Although I'm quite new to Flowstone, Ruby and DSP, I'm really enjoying getting into it. I thought I'd share a little work I've done. I noticed that in the multi-oscillator, the square wave is generated from two saw waves. As the saws themselves seem rather 'dirty' ;) , I thought I'd find another way - and it's very simple!

I developed the idea into a pulse wave - which got a bit more complicated - but so far the results seem OK to me. If you're making synths, perhaps you might like to try them. My coding still is very primative, but I'm learning all the time. Let me know if you come up with further suggestions, improvements etc
Attachments
PWM and SQR.fsm
... and here is the pulse wave development.
(145.89 KiB) Downloaded 1416 times
SQR wave.fsm
Here is the 'improved' square wave generator
(665 Bytes) Downloaded 1434 times
TimC-uk
 
Posts: 8
Joined: Sun Dec 02, 2012 7:11 pm

Re: SQR and PLS Oscillators

Postby Halon » Sat Nov 28, 2015 7:17 pm

Thanks. :)
Halon
 
Posts: 321
Joined: Sat Nov 28, 2015 4:42 pm
Location: Norway

Re: SQR and PLS Oscillators

Postby rocknrollkat » Tue Jan 12, 2016 4:46 pm

Nice work !!
The second example, Ruby, is superb.

Roxy, Jan. 16, 2016
User avatar
rocknrollkat
 
Posts: 213
Joined: Mon Jan 04, 2016 7:04 pm
Location: Oakland Gardens, New York City, U.S.A.

Re: SQR and PLS Oscillators

Postby Spogg » Tue Jan 12, 2016 5:16 pm

This is my understanding of "dirty" saw and square waves and I hope I'll be corrected if I'm wrong.
It's caused by bandwidth limiting and is a deliberate ploy to keep any harmonics below the Nyquist frequency which is half the sample rate (so typically lower than 22 kHz). If you search out nyquist theorem you'll find some nice explanations of why we must do this to avoid inharmonic noise in the audible range.
You can imagine the effective frequency of the fly-back element of a saw or square. If this takes 1 sample that's a 44kHz pulse signal at full -1 to 1 range. To avoid this so-called aliasing the clever guys use interpolation or wavetable creation based on the frequency called for. This is necessary especially for the higher frequency waves called for at the upper end of the keyboard where aliasing is most audible.
However, there are circumstances where a "pure" wave is needed, for example for creating Lissajou figures, where the fly-back should be neat with no ringing-type overshoot visible on the display.

We have experts here, like Martin Vinacek, who are capable of far more detailed explanations then me. He has created some amazing oscillators which fulfill all needs, including surprisingly CPU-efficient characteristics.

Cheers

Spogg
User avatar
Spogg
 
Posts: 3358
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: SQR and PLS Oscillators

Postby tulamide » Tue Jan 12, 2016 5:25 pm

Spogg wrote:To avoid this so-called aliasing the clever guys use interpolation or wavetable creation based on the frequency called for.

Although I'm not a fan of reviving 3 year old threads, I take the chance to ask about wavetables. There is one thing that I don't understand.

In Flowstone, you can load a waveform in a predefined resolution, like 256, 512 or 1024 sample points. The prim then generates a wavetable from it. Ok. But, what does the original waveform represent? It represents one full cycle of the wave, that's clear, but how does the prim know, which frequency it stands for, and which ones need to be generated? How does it work?
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: SQR and PLS Oscillators

Postby adamszabo » Tue Jan 12, 2016 5:34 pm

I might be wrong but I assume it works like this: The wavetable promitive knows the sample rate, and internally it creates a ramp. We will know the rate of the ramp because of the frequency input, and the ramp reads through the available wave table, which always assumes it to be once cycle. So I think it doesnt matter what wavetable you create it always considers it as a one cycle wave.
adamszabo
 
Posts: 667
Joined: Sun Jul 11, 2010 7:21 am

Re: SQR and PLS Oscillators

Postby Spogg » Tue Jan 12, 2016 6:04 pm

adamszabo wrote:I might be wrong but I assume it works like this: The wavetable promitive knows the sample rate, and internally it creates a ramp. We will know the rate of the ramp because of the frequency input, and the ramp reads through the available wave table, which always assumes it to be once cycle. So I think it doesnt matter what wavetable you create it always considers it as a one cycle wave.


I think tulamide is referring to irregular shaped waves such as one might create in a wave-draw oscillator. The only way the Prim could deal with this, that I know of, is that it must use FFT to analyse the harmonic strengths and phases then re-make the wave with the nyquist-hating harmonics removed. You'd need different frequency-based tables because you don't want a muddy sound for your bass-end sounds and you don't want aliasing at the top-end where those higher frequencies are inaudible or don't add anything to the quality of sound.

I'd say the only guys who could answer with authority are those who made the algorithms. Until then it may as well be down to VCM.

Very Clever Magic :lol:

Cheers

Spogg
User avatar
Spogg
 
Posts: 3358
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: SQR and PLS Oscillators

Postby tulamide » Tue Jan 12, 2016 6:52 pm

Yes, that's what I was referring to.

If I try to visualize the process in my head, it looks like this: The waveform is something special, irregular. It is fft'd. Now there are dominant frequencies and the prim creates sine waves for each of them. I still couldn't put the phasing into this imagination, but is it at least the right direction?
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: SQR and PLS Oscillators

Postby Spogg » Tue Jan 12, 2016 8:20 pm

tulamide wrote:Yes, that's what I was referring to.

If I try to visualize the process in my head, it looks like this: The waveform is something special, irregular. It is fft'd. Now there are dominant frequencies and the prim creates sine waves for each of them. I still couldn't put the phasing into this imagination, but is it at least the right direction?


That's exactly what I have in mind too. I think the phasing is important for the reconstruction of the waves to be as close to the original as possible, kind of just smoothed versions... sort of.

For me this is all speculation, we need the software writers to give the final answer. I'm sure they'll read this and respond soon :lol:

Cheers

Spogg
User avatar
Spogg
 
Posts: 3358
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: SQR and PLS Oscillators

Postby tulamide » Tue Jan 12, 2016 8:57 pm

I understand what you mean, Spogg, so let me just add this for those experts reading this:

I ask, because I wanted to create an LFO with unusual waveforms. Some may only be in the "upper" range, so that they can be used for unidirectional modulations. Others might have odd shapes to use them as rhythmic modulators, etc.
First tests were waveforms converted to wavetables and then used as oscillators (standard waveforms like sine). And something strange happened. When comparing with the stock sine osc, the wavetable osc was only in tune with (if I recall correctly) a size of 1024. With a size of 512 it was one octave below, with a size of 2048 it was one octave above (or vice versa, I can't remember it exactly).
To my understanding this shouldn't happen, since the waveform is just the form, it does not represent a certain frequency (as opposed to samples).
This behavior makes me insecure. For the LFO as explained above, I would need to depend on a frequency independant waveform interpretation, so that they will be strictly in time with the rest of the oscillators/lfos. A quarter note length should always produce the same sequence of sample points as for the stock oscillators, else I would need to transfer a quarter note length internally to an eigth note length, resp. a half note length, depending on the original size of the waveform. That would be a nightmare.
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Next

Return to User Examples

Who is online

Users browsing this forum: No registered users and 24 guests