Jump to content

Fit values to various steps? Quantize?


Symbolic

Recommended Posts

Hi,

I have values that go from 0 to 1. So it like:

val0 = 0.01

val1 = 0.1

val2 = 0.12

val3 = 0.15

val4 = 0.18

val5 = 0.23

val6 = 0.26

val7 = 0.27

val8 = 0.29

val9 = 0.31

val10 = 0.34

val11 = 0.35

val12 = 0.45

val13 = 0.67

val14 = 1

So I want to snap them to values like: 0,0.2,0.4,0.6,0.8

So it look like:

val0 = 0

val1 = 0

val2 = 0

val3 = 0

val4 = 0.2

val5 = 0.2

val6 = 0.2

val7 = 0.2

val8 = 0.4

val9 = 0.4

val10 = 0.4

val11 = 0.4

val12 = 0.8

val13 = 0.8

val14 = 0.8

So what is the way of doing this in VOPs... or basically what is the math behind it?

I know it is kind of creating a 5 step ramp from a float ramp... But I just can not put it together

:(

Thanks.

Link to comment
Share on other sites

But why "...not the cleanest way..."? What is a clean way?

I don't think there is a "cleaner" way - as this is fairly versatile.

More versatile than a lookuptable.

You could create a function for it, maybe.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...