Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    Is there something like this in FUZE?

    Help
    processing range of number remapping
    3
    5
    361
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • QIsLegit
      QIsLegit F last edited by

      If you're familiar with the map() function in Processing it allows you to map a number to a different range of numbers.
      https://processing.org/reference/map_.html

      "In the first example above, the number 25 is converted from a value in the range of 0 to 100 into a value that ranges from the left edge of the window (0) to the right edge (width).

      As shown in the second example, numbers outside of the range are not clamped to the minimum and maximum parameters values, because out-of-range values are often intentional and useful"

      If there isn't something like this in Fuze can somebody maybe help me out with alternative way of getting this task completed? I greatly appreciate any and all help. 🙏🏻🙏🏻🙏🏻

      pianofire 1 Reply Last reply Reply Quote 1
      • Martin
        Martin Fuze Team last edited by

        It might be useful for some context on what you are doing.

        It sounds / feels like something I would want if i was trying to draw to a smaller coordinate system than the physical screen. If that is indeed what you are trying to do then please say because there's a very easy way of doing that in Fuze but I maybe completely off the mark here.

        QIsLegit 1 Reply Last reply Reply Quote 0
        • pianofire
          pianofire Fuze Team @QIsLegit last edited by

          @QIsLegit I am not taking credit for this as I just found the implementation

          value = 25
          result = map(value, 0, 100, 0, 200)
          print(result, "\n")
          value = 100
          result = map(value, 0, 100, -20, -10)
          update()
          sleep(3)
          
          function map(value, start1, stop1, start2, stop2)
            result = start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1))
          return result
          
          QIsLegit 1 Reply Last reply Reply Quote 2
          • QIsLegit
            QIsLegit F @Martin last edited by

            @Martin
            I'm actually not needing it for any specific project yet...but I have been thinking about ways that I could accomplish tasks on a future project I have planned. Simply a result of daydreaming :P Plus I still have much to learn.

            When I eventually end up needing to solve this problem I will update this post with my solution/result/process 🙏🏻

            1 Reply Last reply Reply Quote 1
            • QIsLegit
              QIsLegit F @pianofire last edited by

              @pianofire
              Thank you! 🙏🏻 I will update my post here when I get around to implementing this into a future project. Still working my way through the tutorials :P and I'm terrible at math. Much to learn!

              1 Reply Last reply Reply Quote 2
              • First post
                Last post