vParkuu
(_)
#1
Im trying to make a slider from a certain song time position to another
Example: from 16 to 26
I need help with the math to convert it to 0 to 1
16 would be 0 and 26 would be 1
and also need help making the current song time position a number between 0 and 1
Nyonic
(Nyonic)
#2
just do current/max it should range form 0 to 1
vParkuu
(_)
#3
I tried that, but I need the number to be from a specific time position
it would only work if the starting time was 0
Nyonic
(Nyonic)
#4
just subtract the certain time and add it back when applied
MP3Face
(MP3Face)
#5
local min, max = 16, 26
for i = 0, 1, 0.1 do
print(min + (i * (max-min)))
end
vParkuu
(_)
#6
its the same thing as doing current/max
Nyonic
(Nyonic)
#7
this is example of how you could do it
local StartPos = 16
local CurrentTime = 20 - StartPos
local MaxTime = 26 - StartPos
local NewPos = CurrentTime / MaxTime
print(NewPos)
1 Like
system
(system)
Closed
#8
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.