Page 1 of 1

First simple use of Magic

Posted: Sat Mar 14, 2015 5:26 pm
by Daft Maker
Hi,

This is my first video using Magic Music Visuals.
I'm looking for making more complicated videos.
Also : please add "geometry" -> "text" !!!

Re: First simple use of Magic

Posted: Tue Mar 17, 2015 1:44 pm
by Terry Payman
I love the animation of the Fractal! It looks to me like a dancing galaxy or spacecraft. Very well done, especially for a first use. It really enhances my appreciation of the music. Additionally, the lowest three bars of the spectrum follow the bass very effectively.

IMHO adding a Trails module could enhance the motion of your Fractal. Try Insert>Effects2D>Trails at various places between the Fractal module and the Magic output (perhaps starting with Trails Speed=10).

To help isolate and combine the output of the Trails module, also try following it with the LumaKey module Insert>Effects2D>LumaKey.
Please ask for an illustrated example if the above isn't clear enough. Sorry, I haven't got time now.

Thanks for sharing, and welcome!

Terry

Re: First simple use of Magic

Posted: Tue Mar 17, 2015 2:04 pm
by Daft Maker
Thanks for your advice, i'll try that when I have time.

I have a question, how does "smooth" works exactly?

I know that it makes the movement looking less "brutal" but how is it calculated so the next position (let's say for the next second) is respected, so the positions in second A don't change the first "real" positions of second B ?
Sure, i talked abouts seconds but it can be fractions of second, it doesn't change the meaning of my question.

I'm looking for a mathematical explication here. If anyone knows, can you please explain it?

Re: First simple use of Magic

Posted: Tue Mar 17, 2015 4:40 pm
by Magic
Magic's formula for smoothing is something like this:

Code: Select all

outputValue = smoothingStrength*previousValue + (1-smoothingStrength)*inputValue;
previousValue = outputValue;
...where smoothingStrength is between 0 and 1, and the calculation is performed once per frame (60 fps on a standard display). So you can see that if smoothingStrength is 1, you're only getting the previousValue, and if it's 0, you're only getting the inputValue. Anything in between is some combination of the inputValue and the previousValue.

Here's a more in-depth explanation:
http://en.wikipedia.org/wiki/Exponential_smoothing

Re: First simple use of Magic

Posted: Tue Mar 17, 2015 7:45 pm
by Daft Maker
ok, it's so simple.

So with a coef of 0.5, after 100 fps, you can be far far away from the real input value.
It can be useful but I don't really like the concept. Although, I can't think about another technic that make movement less "brutal" but that does not change the n+100 value.

Re: First simple use of Magic

Posted: Tue Mar 17, 2015 10:04 pm
by Magic
So with a coef of 0.5, after 100 fps, you can be far far away from the real input value.
The smoothing decays exponentially, so the "n+100" value barely contributes any weight. The more recent values contribute most of the weight.

Re: First simple use of Magic

Posted: Wed Mar 18, 2015 7:04 am
by Daft Maker
ok but still the real values are never really approched.

I would prefer a smoothing that periodicly (let's say after 100 fps) regain the real value of the actual input, but still with no brutal changing.

perhaps by decreasing smoothingStrength from the choosen coef (let's say 0.5) to 0 every 100 fps.

Code: Select all

K = remainingFps/100;
outputValue = K*smoothingStrength*previousValue + (1-K*smoothingStrength)*inputValue;
previousValue = outputValue;
or operhaps with K :

Code: Select all

K = remainingFps*(100-remainingFps) / 50²

Re: First simple use of Magic

Posted: Wed Mar 18, 2015 7:34 am
by Daft Maker
ok let's be crazy :

Code: Select all

K = cos(PI*(1+2*remaingFps/100) )/ 2 + 0.5

Re: First simple use of Magic

Posted: Thu May 07, 2015 12:10 am
by Daft Maker
Hi,

I've got an idea for a new formula:

the regular formula is :

Code: Select all

outputValue = smoothingStrength*previousValue + (1-smoothingStrength)*inputValue;
previousValue = outputValue;
and I propose :

Code: Select all

if ( | inputValue - previousInputValue | < | inputValue - previousOutputValue | )
           outputValue = smoothingStrength*previousInputValue + (1-smoothingStrength)*inputValue;
else
           outputValue = smoothingStrength*previousOutputValue + (1-smoothingStrength)*inputValue;
previousInputValue = inputValue;
previousOutputValue = outputValue ;
to show an exemple, I will compare the course between the regular formula and the proposed formula with 3 points : 1,2 and 3.
We will take 0.5 as smoothingStrength and compare all possible positions of 1,2 and 3


1......#......2...*..!......3
regular formula : positions will be 1 then # then *
proposed formula : positions will be 1 then # then !

1.............3.............2
regular formula : positions will be 1 then 3 then 3
proposed formula : positions will be 1 then 3 then 3 (same as regular formula)

2......#......1...*.........3
regular formula : positions will be 1 then # then *
proposed formula : positions will be 1 then # then * (same as regular formula)

2.............3.............1
same as 1.............3.............2

3.............1.............2
same as 2.............1.............3

3.............2.............1
same as 1.............2.............3

To sum up, the proposed formula is interesting when points succede far and far away in the same direction. The result output will be "more" authentic then the regular formula.
let's imagine distance between 1 and 2 is 41 and between 2 and 3 is 5

1....................#............*........2..!..3
regular formula : positions will be 1 then # then *
proposed formula : positions will be 1 then # then ! -> much more authentical and still smooth

Re: First simple use of Magic

Posted: Thu May 14, 2015 1:35 am
by Magic
Sounds complicated! :) I'll see if I can try to understand what's going on there.

Also, in one of the next versions of Magic I'll be adding a modifier that can do custom expression parsing, as I briefly mentioned here: viewtopic.php?f=2&t=360&p=1460#p1460. So you will actually be able to write your own formulas and get exactly the kind of smoothing you want.