Previous topicNext topic

Normalise modifier

Suggestions for new features for Magic.
Post Reply
Sadler
Posts: 1139
Joined: Sat Aug 02, 2014 7:10 pm
Location: London, UK

Normalise modifier

Post by Sadler »

Many, if not most, parameters range from 0 to 1 (e.g Hue). The input sources range from 0 to somewhere below 1 depending on the music and the feature. It would improve reactivity if input sources could be normalised to the parameter range. Scaling, offsetting, clamping etc don't achieve this.

Here is a magic comp that implements a pair of normalising globals that pushes peak values to 1.
normalised_modifier.magic
(2.76 KiB) Downloaded 382 times
It would be good if this could be implemented as a modifier that dealt with both ends (min/max) and used a better algorithm to track and calculate the scale factor.
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Normalise modifier

Post by Magic »

Normalize relative to what though? Your algorithm will change over time, based on the input. In other words, it's non-deterministic. I'm not sure if that's what people would want.

But if they do, then your algorithm seems fine to me. I'm not sure how it could be improved.

Or, one other thing you can try is using the Power modifier with a value between 0 and 1. For example, .5 will result in the square root. So, for an input value of, let's say, .49, the value will become .7. Thus, everything gets shifted towards 1, but maintaining the range [0,1]. This is exactly the opposite of what I described in viewtopic.php?f=3&t=76, as one user realized: viewtopic.php?f=3&t=76#p2326
Sadler
Posts: 1139
Joined: Sat Aug 02, 2014 7:10 pm
Location: London, UK

Re: Normalise modifier

Post by Sadler »

I mean normalise to the max value of that source's feature. I realise this is somewhat of a moving target but I wouldn't go so far as to say it is non-deterministic. The maximum value of a frequency range may move up/down slightly if there are louder/quieter parts of the music but if the music is fairly even the maximum will be reasonably predictable. In my example comp, the value of the peak modifier dictated how quickly the scale factor was re-evaluated with higher values giving more stable results but which were slower to react to quieter parts later. I would think that a normalise modifier that does re-evaluate its scaling factor would be preferable to a deterministic value.

Here's a coloured snapshot showing 80-320 Hz straight source on the left, then normalised in the middle and to power 0.5 on the right. You can see that not only does the normalised version cover the whole hue range but goes closer to both boundaries 0 and 1. Even if it is slightly under or over the 1 mark, it is still more predictable than the unmodified frequency or the powered frequency in my evaluation.
normalised_vs_power.png
normalised_vs_power.png (4.08 KiB) Viewed 4549 times
As I mentioned, there are many parameters (built-in or otherwise) that operate within the 0-1 range. Getting the full effect of these parameters would be, I think, more predictable with a normalise modifier. Perhaps the example algorithm can't be improved but it would still make a useful modifier.
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Normalise modifier

Post by Magic »

The maximum value of a frequency range may move up/down slightly if there are louder/quieter parts of the music but if the music is fairly even the maximum will be reasonably predictable.
That might be true within one song, but keep in mind that one song is a subset of multiple songs, and even multiple songs are a subset of all types of audio (speech, ambient, sound fx, etc). The maxima could vary significantly. In the case of live audio, there's no way to tell when things might shift suddenly. Then, the algorithm would fail.

It's a similar situation with beat detection. One of the reasons I never implemented it is that it works when it works, but it also doesn't work quite often.
As I mentioned, there are many parameters (built-in or otherwise) that operate within the 0-1 range.
Yes of course. Magic is designed that way. But I still think that using modifiers like Power is a better solution for the case you're describing. As much as possible, I try to avoid introducing features that are just combinations of other features, unless the combination is very inconvenient.
Post Reply