1
$\begingroup$

First off, I am not sure if I'm asking the right question. I'm a modeler first and foremost. Its all I know :)

I make music visualizations. Normally, to bake a sound to a value, I press "i" over a value to insert a keyframe and then go into the graph editor and bake sound to f-curve for that specific value. As far as I can tell, it only affects it in a positive direction.

What I'm used to doing...EX:

enter image description here

Using the "factor" in graph editor and baking sound to f-curve. In this example, I'm using the frequency range of 0-120 to change the color of the object. Easy peasy. Goes from blue to red depending on how high the sound is.

enter image description here

The thing I can't figure out is how to do the same thing but with a materials z location mapping.

https://prnt.sc/12ul2qx

I've been told there is a Map Range node and I've done some research on it and understand the concept, but the implementation of it has stumped me.

Thanks for any and all help.

$\endgroup$
4
  • 1
    $\begingroup$ In shader nodes, this is exactly what Converter > Map Range does, but I'm still not sure exactly what you want.. you may have to split Z out of a vector to use this. $\endgroup$
    – Robin Betts
    May 12, 2021 at 17:34
  • 1
    $\begingroup$ Look at using fcurve modifiers on the baked curve. Envelope can be used to change range, generator to change sign. blender.stackexchange.com/a/127900/15543 $\endgroup$
    – batFINGER
    May 12, 2021 at 17:49
  • $\begingroup$ I think you have a little too much faith in my knowledge of blender lol. I googled map range and gave it a go on YT and the blender docs. I understand the concept, but how to implement it is the problem. I will update the question with more info. $\endgroup$ May 12, 2021 at 21:25
  • $\begingroup$ @batFINGER thank you! It didn't really help with what I was asking specifically (that I was able to understand at least), but it did give me a resolution to my main problem at the end of the post! Apparently, you can unbake a curve, then scale it in the negative which solves my main problem! Thank you! $\endgroup$ May 13, 2021 at 0:19

1 Answer 1

1
$\begingroup$

If I understand you correctly, you'd like to map the incoming 0->1 audio amplitude range from the baked f-curve, to a 0 -> -40 range for use inside a shader node-tree.

You can key the incoming audio range into an Input > Value node, and map that to any other range you like with a Converter > Map Range node:

enter image description here

... here, mapping 0 -> 1 to 0 -> -40, influencing only the Z-component of the location of the texture space. The 'Clamp' checkbox causes the output to flatline at the min and max of the ranges. If unchecked, the mapping extrapolates.

Using a Value node is more flexible than keying, say, the 'Fac' of a color-ramp directly. The single 0 -> 1 audio input can be branched, and mapped to different ranges for different features of your tree.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .