KSP - How to express a decimal point
-
- KVRist
- Topic Starter
- 160 posts since 29 Apr, 2008
Hi
I have noticed that I cannot express values with decimals on a script for Kontakt, something like $val := 1.5
So how do I express this?
set_engine_par($ENGINE_PAR_VOLUME,$val / 1.5,-1,-1,-1)
I also tried:
set_engine_par($ENGINE_PAR_VOLUME,$val / (3/2) ,-1,-1,-1)
but i don't get the right result.
I have noticed that I cannot express values with decimals on a script for Kontakt, something like $val := 1.5
So how do I express this?
set_engine_par($ENGINE_PAR_VOLUME,$val / 1.5,-1,-1,-1)
I also tried:
set_engine_par($ENGINE_PAR_VOLUME,$val / (3/2) ,-1,-1,-1)
but i don't get the right result.
-
- KVRian
- 688 posts since 17 Sep, 2007 from Planet Thanet
A while since I used KSP but does it actually handle floats now? It never used to. Big Bob's library was useful for the maths stuff and required scaling to represent (pseudo)floats.
I could be wrong about this though
I could be wrong about this though
-
- KVRist
- Topic Starter
- 160 posts since 29 Apr, 2008
Thanks for the quick reply resynthesis. I was looking for the library last night at his website but I got a "Dropbox -404 - file no found message". I did a search now again and I found it on vi-control, here's the link:
https://dl.dropboxusercontent.com/u/804 ... thPack.zip
Anyway, so far I have no idea of how it works.
https://dl.dropboxusercontent.com/u/804 ... thPack.zip
Anyway, so far I have no idea of how it works.
- KVRAF
- 23102 posts since 7 Jan, 2009 from Croatia
Since Kontakt 5.6 KSP can handle floating point numbers. However, for engine parameters you still need to use integers (0-1000000), so you gotta use real_to_int() to cast your FP calculation into int. See KSP reference.
-
- KVRist
- Topic Starter
- 160 posts since 29 Apr, 2008