Announcement

Collapse
No announcement yet.

how to convert absolute CC to relative CC?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to convert absolute CC to relative CC?

    the new "Change Channel" event gives us a one press solution to make a shift button. now I want to figure out how to convert an Absolute rotary encoder (of Maschine) to send a relative value.

  • #2
    To what destination would you need to send the relative value?
    There is currently no possibility of calculating a relative position.

    Comment


    • #3
      the usual range of the absolute knob is 0 - 127. I want to link a knob to control loop start and end. in Ableton remote midi scripts this is set up as a relative value. 64 - 127 when turned right and 63 - 0 when turned left.
      the way this is done in Bome's MTP is by adding variable that stores the last position of the knob before you turn it to the opposit direction and uses that as the relative point.

      if this is currently not possible I hope you think about it for future updates.

      Comment


      • #4
        Sure Emerah, I'll think about this feature.

        A few more questions though:
        What is the range of the absolute rotary encoder?
        Does it wrap around?

        Also could you please point me to some documentation about the loop start/end you were referring to?
        I would like to be able to test that.

        Comment


        • #5
          Camille, sure thing. let me do that when I get home from work today.

          Thanks man. your prompt response is really appreciated.

          A.Emerah

          Comment


          • #6
            I resurrect this thread because I got the request from a user asking me how it would be possible to transform a MIDI CC stream into a series of +1 / -1 values representing the successive increments and decrements of the input signal.

            The idea is to create two OSC Routings that are sent only when the value changes. One routing handles increasing values and the other the decreasing values.

            Here are the detailed steps to reproduce the settings given in the attached example:

            1. Suppose you have a device sending the MIDI control change 10 on channel 1 to OSCulator (the example file also uses a fader from TouchOSC).
            2. So the input message is /midi/cc/10/1. Select this message and press Command-D to duplicate it.
            3. Open the Parameters Window and go to the OSC tab.
            4. Create a OSC Routing by pressing the + button and double click the new item so the OSC Editor is displayed.
            5. Change its target (first column) to "L", which means that the routed values are sent to the current OSCulator document (L as in Local).
            6. [optional] In the OSC editor, change the routing address to /relative<address>.
            7. In the Arguments field, replace the token <all args> by the token with number 1 (type the number 1, then press space key).
            8. At the bottom of the OSC Editor, choose Route when: "The value increases". This ensures the values are routed only when the input increases.
            9. Close the OSC Editor.
            10. [optional] Rename this routing to "increment" in the Memo column.
            11. Now copy and paste the OSC Routing you just configured, rename it to "decrement", change the token with number 1 to a token with number -1, finally change Route When to "The value decreases".
            12. Go back to the /midi/cc/10/1 message. Select both duplicates and choose OSC Routing in the Event Type column.
            13. Assign the Value column of the first duplicate to the "increment" OSC routing.
            14. Assign the Value column of the second duplicate to the "decrement" OSC routing.


            And voilà, when you change the input value, a new message called /relative/midi/cc/10/1 message will be created only outputting +1 or -1.

            Camille
            Attached Files

            Comment


            • #7
              decrease is not working

              Camille,

              Thanks a lot for your answer.
              Now incrementation and decrementation are obviously working well in local, i.e inside osculator.

              Then I assigned the created relative message to the CC of my choice, and routed to my Ableton remote script.

              Unfortunately the message is not interpreted correctly: when increasing (turn right), it's perfect: values in ableton increase by steps of 1.
              But when decreasing(turn left), it doesn't work; nothing happens.

              I suspected the argument value "-1" is not recognized. So I replaced the "-1" by "2". And what happened? As I turned right, it's still increasing by one, and as I turned left, it's increasing by 2!

              So I think my script is not capable of interpreting negative values. Am I right? Is there anything I can do?

              Thanks

              Comment


              • #8
                Hi Julien!

                Unfortunately, there is no such thing as negative values in MIDI. Value range is between 0 and 127. OSC, on the other hand can transmit negative integer values.

                Another possibility is that they use signed two's complement values, so -1 would be 127. You can try to see if that changes anything.

                You should look at the documentation of the device you are controlling to see what value they use for decrement.


                Cam
                Last edited by camille; 11-07-2013, 11:33 PM.

                Comment


                • #9
                  It think I've found the clue.

                  My Ableton script is programed in absolute or relative mode. More precisely, the relative mode is called "relative to complements". This is a kind of language that translates values in this way:


                  For positive values
                  • 0000 - zero
                  • 0001 - one
                  • 0010 - two
                  • 0011 - three
                  • 0100 to 0111 - four to seven

                  For negative values
                  • 1111 - negative one
                  • 1110 - negative two
                  • 1101 - negative three
                  • 1100 to 1000 - negative four to negative eight
                  So to increment by 1 per step, the argument value should be 0001
                  To decrement by 1 per step, the argument value should be 1111

                  So I tried this way and it works! Wonderfull but.... here is THE MOST IMPORTANT THING: my controller is natively coded in absolute protocol. Although rotary encoders are endless, the values sent to Osculator are absolute. Thats why when I reach maximum value (let's say 127), there is no incrementation anymore. It's sending 127 and then 127, so no more incrementation.... And that's exactly the same for the minimum value. No more decreasing while 0 is reached. It's easy to find it out by reading the osculator monitor called "quick look".

                  So according to me, unless completely re-programming your controller, it's IMPOSSIBLE.

                  Maybe Camille can confirm it cause I'm a novice in this domain. Till now, I didn't know anything about programming, scripting and stuff like that.... So I have to admit I'm not sure!!

                  Julien

                  Comment


                  • #10
                    Cam,

                    You're right. It's decreasing with argument value = 127!!!
                    But the problem is still the same

                    However thanks a lot for the support!!

                    Julien

                    Comment


                    • #11
                      I see... that's a bummer...
                      Is there any chance that you can configure your controller so the value wraps around (goes to 127, then start from 0 again)?

                      Comment


                      • #12
                        I didn't find anything about it on the web. Honnestly it's starting to be complicated for me!

                        I was thinking of extending the incoming CC range. For example, the values sent by my controller ( from 0 to 127) could be turned into a larger range (for example 0 to 999). But even if it's possible..... Then I reach 999 and what?

                        I'm fed up with my cheap controler. If today is sunny, I will open the window and.....

                        Anyway I realized, just with the OSC routing function, how versatile and powerfull is Osculator. If someday I get a "real" control surface, I'll certainly use Osculator to program it.

                        Comment


                        • #13
                          Originally posted by camille View Post
                          I resurrect this thread because I got the request from a user asking me how it would be possible to transform a MIDI CC stream into a series of +1 / -1 values representing the successive increments and decrements of the input signal.

                          The idea is to create two OSC Routings that are sent only when the value changes. One routing handles increasing values and the other the decreasing values.

                          Here are the detailed steps to reproduce the settings given in the attached example:

                          1. Suppose you have a device sending the MIDI control change 10 on channel 1 to OSCulator (the example file also uses a fader from TouchOSC).
                          2. So the input message is /midi/cc/10/1. Select this message and press Command-D to duplicate it.
                          3. Open the Parameters Window and go to the OSC tab.
                          4. Create a OSC Routing by pressing the + button and double click the new item so the OSC Editor is displayed.
                          5. Change its target (first column) to "L", which means that the routed values are sent to the current OSCulator document (L as in Local).
                          6. [optional] In the OSC editor, change the routing address to /relative<address>.
                          7. In the Arguments field, replace the token <all args> by the token with number 1 (type the number 1, then press space key).
                          8. At the bottom of the OSC Editor, choose Route when: "The value increases". This ensures the values are routed only when the input increases.
                          9. Close the OSC Editor.
                          10. [optional] Rename this routing to "increment" in the Memo column.
                          11. Now copy and paste the OSC Routing you just configured, rename it to "decrement", change the token with number 1 to a token with number -1, finally change Route When to "The value decreases".
                          12. Go back to the /midi/cc/10/1 message. Select both duplicates and choose OSC Routing in the Event Type column.
                          13. Assign the Value column of the first duplicate to the "increment" OSC routing.
                          14. Assign the Value column of the second duplicate to the "decrement" OSC routing.


                          And voilà, when you change the input value, a new message called /relative/midi/cc/10/1 message will be created only outputting +1 or -1.

                          Camille
                          Hi!
                          I would like to refresh this issue. I've tried this solution to get an arturia minilab connected with studio one, but through the monitor console I can detect that it only sends two values. According to the value I try on the scalling (-1,1 / 0,127 / 1,16383, etc) it only sends those values, not a calculation between a previous value and the arg 1/-1. Don't know if it has anything to do it, but I've also noticed that with <address> on the routing, the created adress is not exactly equal to the original. Example: if the source is /midi/cc1, the returned adress will be /midi/cc1/0... does this make sense?

                          Thank you in advance!

                          Comment


                          • #14
                            Hi,

                            I am sorry, but I have a hard time figuring out the details
                            Would you please send your OSCulator file to camille at osculator dot net?

                            Example: if the source is /midi/cc1, the returned adress will be /midi/cc1/0... does this make sense?
                            This might be because you are routing the first argument of a multi-argument OSC message.
                            Hopefully, I'll see that in your file.

                            Best,
                            Camille

                            Comment

                            Working...
                            X