Urs, I have two questions...

Official support for: u-he.com
RELATED
PRODUCTS

Post

I know you have spend a lot of time on it already.
But i can't stop thinking about it...
I don't want to be smart-arse. Just some thoughts out of my head...maybe they are usefull.

>>>> y2Right = ( y2Left + y2Right ) / 2; // meet half way and try again

Is this really the best approximation? (worst-, avg.-, best case senario?)
It seems to be very fixed.
Is it possible to change the direction of the approximation dynamically ?
This may reduce some iteration steps.
----------------------------

>>>> y2Left = F * tanh(F * tanh(X- y2Right) + S1) + S2

I don't know how many iterations (worst,avg, best) it needs to get the result.
But it looks heavy inside a loop (worst case).
Is this the simplest possible formular ? Not possible to transform it mathematically into a formular, which is not so cpu intense?
----------------------------

Atm i don't know if C/C++ is using bit shifting by default (for faster calculating).
----------------------------

I think it's possible to replace/merge a part of the code with assembler.
Assembler should be faster, but also a pain haha.
----------------------------

What about recursion? Would it be slower?

recursion(y2Right) { // y2 = y2Right start with previous sample

y2Left = F * tanh(F * tanh(X- y2Right) + S1) + S2

if( y2Left == y2Right )
return y2Left;
else
recursion( (y2Left + y2Right) / 2); // meet half way and try again

}
//of course F,X,S1,S2 parameters have to be included in the signature
----------------------------

Or maybe the solution is just 43. :-)

Post

Did you just go math on us?

I need to go make music.

Post

pinso wrote:>>>> y2Right = ( y2Left + y2Right ) / 2; // meet half way and try again

Is this really the best approximation? (worst-, avg.-, best case senario?)
No, it's not the best solution at all. It actually doesn't work (as explained in the following paragraph). I just couldn't be bothered writing down the infrastructure needed for the bisection method or similar. This was merely a placeholder that looks like it does something ;-)

Also, I'm quite sure that "approximation" isn't the right word. It's essentially a "solver" for root finding. That is, we seek the zero crossings of the function

error = y2Left - y2Right

The most simple and definitely converging method to solve this is the bisection method:

http://en.wikipedia.org/wiki/Bisection_method

One of the fastest methods in literature is Brent's method:

http://en.wikipedia.org/wiki/Brent%27s_method

… or the inevitable (always a classic) but not necessarily best method, Newton-Raphson:

http://en.wikipedia.org/wiki/Newton%27s_method

I posted working code on the Music DSP mailing list. This was partly met with outcry from a few people who seem stuck in ancient DSP paradigms. They don't get it. However, a root finding algorithm on a list of equations (aka matrix of variables) is exactly how circuit emulators like SPICE have solved the non-linear case since long before anyone put their first Direct Form filter into a softsynth. It's called Modified Nodal Analysis, or MNA which is run through a custom solver:

http://en.wikipedia.org/wiki/Modified_nodal_analysis

Unlike the example given on Wikipedia, and unlike ancient Nodal Analysis based on Kirchhoff's laws, MNA can be solved for non-linear terms. Andy Simper of Cytomic commonly recommends to check out a circuit emulator named QUCS, which also has excellent documentation on MNA, and how to use Newton-Raphson (told you so!) to solve it:

http://qucs.sourceforge.net/tech/node13.html

Note how they first explain MNA for the linear (aka boring) case, then make it faster, then explain how to do circuit analysis with non-linear elements. I haven't ever needed anything else to see the light :idea:

Post

:shock:

I think I'll stick to my understanding of the subject matter.

I press key, it goes buzz.
"I was wondering if you'd like to try Magic Mushrooms"
"Oooh I dont know. Sounds a bit scary"
"It's not scary. You just lose a sense of who you are and all that sh!t"

Post

Mushy Mushy wrote::shock:

I think I'll stick to my understanding of the subject matter.

I press key, it goes buzz.
Join the team ;-)

Post

Hehehe, well, if people want to have things clarified, I'll happily clarify (even if the opposite happens)

Post

It's amazing that a developer would go to such lengths to explain things that make their stuff "tick". Thank you, Urs.

Post

EvilDragon wrote:It's amazing that a developer would go to such lengths to explain things that make their stuff "tick". Thank you, Urs.
agreed :clap:

Post

Even Urs likes to show off every now and again ;-)

Post

Nielzie wrote:Can't you just simply program those models along the lines of: behave unexpectedly from time to time + add saturation with output :?

:hihi:
It will be a compromise and because of that it won't be high end anymore!!! And Uhe is high end!!!
https://слово-божье.рф
Image

Post

EE201, Kirchoff's current/voltage law was used every day. I kinda miss having to do those problems. ;)

Post

EvilDragon wrote:It's amazing that a developer would go to such lengths to explain things that make their stuff "tick". Thank you, Urs.
I completely agree! Very cool! :tu:

Post

AusDisciple wrote:
EvilDragon wrote:It's amazing that a developer would go to such lengths to explain things that make their stuff "tick". Thank you, Urs.
I completely agree! Very cool! :tu:
+1. Transparency goes a such a long way these days.

Post

Erkenfresh wrote:EE201, Kirchoff's current/voltage law was used every day. I kinda miss having to do those problems. ;)
It's funny how applying Kirchhoff to a circuit schematic yields equations that is easier to understand, provide better numerical accuracy and translate to algorithms that execute faster than the abstract filters taught in DSP lessons. Had they done that in the late 80ies, the history of synthesizers might have been different.

Post

xh3rv wrote:
AusDisciple wrote:
EvilDragon wrote:It's amazing that a developer would go to such lengths to explain things that make their stuff "tick". Thank you, Urs.
I completely agree! Very cool! :tu:
+1. Transparency goes a such a long way these days.
Urs and the crew are amazing. Stellar support and always active here, answering questions and being very open about everything really. My hat goes off to them!
I make music like I play Tekken; randomly push buttons and hope for something good to happen.

Post Reply

Return to “u-he”