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

The old but never satisfyingly answered question

For general discussion related FlowStone

The old but never satisfyingly answered question

Postby tulamide » Mon Dec 02, 2019 6:38 am

Guys, for this question I need an answer based on facts, but it doesn't need to go into very much detail, as it is just a thought experiment at this point of time.

Say I'd figure out how to use the DSP edit box and develop an algorithm that arithmetically produces a sine wave with everything needed to be a full fledged oscillator.

Say also, I'd do another Oscillator in the DSP edit box that arithmetally produces a pulse wave.

In DSP, we calculate per sample. If I combine both oscillators into one DSP box and, instead of outputting two signals, output a mixture of both calculated samples, depending on a value...
Code: Select all
osc1sample * amount + osc2sample * (1 - amount)
...what would be the result, when modulating "amount" via envelope or LFO?

Would it be a usable signal? Or full of clicks and aliasing? Would the time be sufficient to do the double osc in one DSP edit box? Are there issues I don't think of? Is there anything beautiful about this idea, or is it simply bs?
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: The old but never satisfyingly answered question

Postby trogluddite » Mon Dec 02, 2019 3:42 pm

(Shhh, don't let on that I'm posting - I'm only supposed to be lurking, but I couldn't resist! ;) )

TL/DR...
It all depends on how quickly you intend to modulate the "amount" and the amount of high frequency harmonics in the oscillator waveforms. If 'amount' is modulated at typical LFO/envelope rates, it's unlikely to be a problem, but you may get aliasing if 'amount' is modulated at audio rates (e.g. to use it as a form of single-cycle wave-shaping.)

Explanation
The addition in the middle is no problem for aliasing, of course; summing two signals doesn't create any partials (sine wave components) not present in the input signals. But the multiplications represent amplitude modulation, so they will generate side-bands. For each pair of partial frequencies fo (from the oscillator) and fa (from 'amount'), the output will contain partials at frequencies (fo + fa) and (fo - fa). Any upper side-band (fo + fa) exceeding half the sample rate will be aliased, and any lower side-band below zero Hz will be phase inverted.

Thinking of it in reverse might help to make this equivalence clear. If you mix two constant amplitude sine oscillators together which are detuned ("side-bands"), the output is effectively a single sine-wave at a constant intermediate frequency which "beats" (is "amplitude modulated") at a rate which increases with the amount of detuning.

From a coding perspective, two oscillators in a single DSP block may allow some optimisations - by sharing code for a phase ramp, for example (assuming they are to be phase locked). So, it's not necessarily "beautiful" nor "bs"; just an option to consider which may be beneficial in some situations but not others.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: The old but never satisfyingly answered question

Postby Spogg » Mon Dec 02, 2019 4:01 pm

Damn! Trog got in before me while I was preparing this and of course did a much better job!
But here's my post anyway...


I’ll answer according to what I think I know!

Your idea should certainly work but I think any saving made by doing it all in 1 DSP edit box would be tiny.

There should be no time issues, since the whole schematic is evaluated in one sample period for DSP, including all other audio stream components. So if you can run 2 oscillators “separately” there’s no reason why they can’t be in one edit box.

What you are proposing is effectively a cross-fade between two varying values, which shouldn’t cause any clicks. You can get nice sounds when modulating this so, it’s not a bs idea, but also not a new one (sorry!).

One thing to watch out for is aliasing from the pulse wave though, since too rapid a change of value will exceed nyquist. So it would need to be band-limited and that’s something for Martin to respond to.

Cheers

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

Re: The old but never satisfyingly answered question

Postby trogluddite » Mon Dec 02, 2019 9:15 pm

Spogg wrote:Damn! Trog got in before me while I was preparing this...

Just like a hunting tiger, I have been patiently biding my time; lurking motionless in the shadows; silent and with bated breath; seeing but unseen; waiting for the perfect moment to pounce on my helpless prey! :shock:
(either that, or just another example of my life-long talent for inadvertently timing my brain-farts so as to maximise social awkwardness! :lol: )

Spogg wrote:... I think any saving made by doing it all in 1 DSP edit box would be tiny

It may depend on whether the oscillators need to be absolutely locked in phase, and whether current oscillator designs allow this easily. If that is a requirement, and phase-drift proves to be a problem, there might be more benefit from combining the oscillators. Otherwise, I agree; it's worth considering but probably a premature optimisation; separate oscillators and cross-fader(s) would make no material difference and might make it easier to experiment without having to rewrite code.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: The old but never satisfyingly answered question

Postby billv » Mon Dec 02, 2019 10:53 pm

trogluddite wrote:Just like a hunting tiger, I have been patiently biding my time; lurking motionless in the shadows

Interesting...I pictured you in a "Yellow Submarine" somewhere near the bottom
of the Thames River..Good to see you back... :D
billv
 
Posts: 1157
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia

Re: The old but never satisfyingly answered question

Postby tulamide » Tue Dec 03, 2019 6:30 am

trogluddite wrote:For each pair of partial frequencies fo (from the oscillator) and fa (from 'amount'), the output will contain partials at frequencies (fo + fa) and (fo - fa). Any upper side-band (fo + fa) exceeding half the sample rate will be aliased, and any lower side-band below zero Hz will be phase inverted.
It feels so weird, that I actually understand that :o

As the lion you are, I expect you to stay here while devouring your prey. Welcome back! :D

Spogg wrote:What you are proposing is effectively a cross-fade between two varying values, which shouldn’t cause any clicks. You can get nice sounds when modulating this so, it’s not a bs idea, but also not a new one (sorry!).
:oops: So I'm basically just replicating Quilcom Blender? Well, it all roots in me not understanding this seperation: When there are two waveform cycles and a synth blends between them, it is called morphing. But if you do the same blending on a per sample basis (with a modulation that is much slower than one cycle), it isn't called morphing. But why? They do the same thing, don't they? (@trog, you're also welcome to answer :lol: )
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: The old but never satisfyingly answered question

Postby Spogg » Tue Dec 03, 2019 11:02 am

Ahhh the good old “morphing” question! I didn’t realise it was Groundhog Day! :lol: :lol:

I hope trog is preparing his post while I write this, because he’s a much better explainer than me…
BTW way, a BIG welcome back to you, Sir Trog of the Shadow Lands! :D

Let’s say you have 2 oscillators and a “mixer” or cross-fader as per your proposal. For every sample, the calculation of proportional mix is individually calculated. So, with a 50-50 mix, the resulting value would be half the sample value of Osc 1 + half the value of Osc 2. This would be true whether you do the calculation inside a DSP box, or externally using stream multiply prims, and the resulting value, per sample, would be the same.

Now there’s another type of “morphing”, what I would call true morphing. This involves imposing the dynamic spectrum of one sound onto another and is applicable to longer sound clips rather than single cycle waveforms. I looked in vain for a definitive article but you can piece together the overview if you search for Spectral Morphing. It’s a complex topic and a big technical challenge.
Imagine, if you will, slowly changing the sound of a tap dripping to a dog barking, and with all the weird intermediate states.

Cheers

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

Re: The old but never satisfyingly answered question

Postby tulamide » Tue Dec 03, 2019 12:35 pm

Spogg wrote:Ahhh the good old “morphing” question! I didn’t realise it was Groundhog Day! :lol: :lol:

I hope trog is preparing his post while I write this, because he’s a much better explainer than me…
BTW way, a BIG welcome back to you, Sir Trog of the Shadow Lands! :D

Let’s say you have 2 oscillators and a “mixer” or cross-fader as per your proposal. For every sample, the calculation of proportional mix is individually calculated. So, with a 50-50 mix, the resulting value would be half the sample value of Osc 1 + half the value of Osc 2. This would be true whether you do the calculation inside a DSP box, or externally using stream multiply prims, and the resulting value, per sample, would be the same.

Now there’s another type of “morphing”, what I would call true morphing. This involves imposing the dynamic spectrum of one sound onto another and is applicable to longer sound clips rather than single cycle waveforms. I looked in vain for a definitive article but you can piece together the overview if you search for Spectral Morphing. It’s a complex topic and a big technical challenge.
Imagine, if you will, slowly changing the sound of a tap dripping to a dog barking, and with all the weird intermediate states.

Cheers

Spogg

Now you understand the title better, right ;)

I'm not talking of spectral morphing. I'm talking of standard wavetable morphing. And there isn't much to it. Simplified for this example, it looks a little like this:
Code: Select all
first wave cycle
10 10 10 5 0 -5 -10 -10 -10
last wave cycle
-4 -3 -2- 1 0 1 2 3 4
## all other cycles of the wavetable are calculated from those two (let's assume a total of 10##
second wave cycle
10 * 0.9 + -4 * 0.1 | 10 * 0.9 + -3 * 0.1 | 10 * 0.9 + -2 * 0.1 etc


the result is the amplitude changing slowly from the first to the last cycle (here resulting in a table of 10 wave cycles), with all interesting intermediate wave cycles.

That's called morphing (when you modulate through all these wave cycles). So why isn't it morphing, when you do it sample-based?

I guess, I will never get a satisfying answer. But I'm also not the guy to give up. Better be prepared for anual posts :lol:
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: The old but never satisfyingly answered question

Postby Spogg » Tue Dec 03, 2019 2:01 pm

So I’ll meet you here next year, same time, same place! :lol:

Seriously, I think my problem is that I don’t understand what you don’t understand. You have a perfect grasp of waveform morphing, as shown by your code. You have a starting waveform and a target waveform. The maths cross-fades between the two, according to an external ratio amount, which could be modulated.

Maybe it’s the word morphing versus cross-fading, but in a waveform context it’s the same thing, just different names.

If you do it rapidly, like your 10 iteration example, then repeat the process every 10 cycles, you won’t hear “morphing” as such, but a new sound with a fundamental based on the morph repetition rate. If you do it slowly over seconds, you’ll hear one sound timbre change (morph) into another.

Where is that trogluddite when you need him? :lol:

Cheers

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

Re: The old but never satisfyingly answered question

Postby martinvicanek » Tue Dec 03, 2019 4:50 pm

To me crossfading and morphing are different. What Tula describes is crossfading, whereas morphing involves some sort of waveshape warping. I posted a little morphing excercise some time ago.
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Next

Return to General

Who is online

Users browsing this forum: No registered users and 68 guests