LSB MSB HELP ME

Home Forums General Using Ctrlr LSB MSB HELP ME

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #10523
    KALYWAY
    Participant
      • Topics: 9
      • Replies: 23
      • Total: 32

      HELLO , YOU CAN SEE INN THIS PICTURE THE BIT PROCESSING I WANT TO ADD IN MODULATOR EXPRESSION (FORWARD ONLY)

      BIT SYSEX

      the INPUT VARY FROM 1 TO 7150 , AND IT CONVERTED INTO HEX LSB MSB

      I JUST WANT TO ADD THIS IN CTRLR !

      THANKS

      #10524
      atom
      Keymaster
        • Topics: 159
        • Replies: 2945
        • Total: 3104
        • ★★★★★

        SysEx formula has LS MS and ls ms tokens in it, you can combine that with expressions and you can really do anyting with that:

        there is a place in documentation for the expressions:

        Expressions in Ctrlr


        There is a lot about formulas in the getting started:

        Getting started

        I just helped someone with the alesis formula:

        Negative values in Alesis QS8

        #10528
        KALYWAY
        Participant
          • Topics: 9
          • Replies: 23
          • Total: 32

          THANK YOU ATOM , i have read some elements , and now it work , i have just add the classic LSB MSB formula with (modulatorValue*10)+0.001
          in the expression area
          i have to multi the value by 10 because NOW the modulator display the values in float if i set the slider that ( for example : min =0.1 , max = 715 ; interval = 0.1 ; decimal position 1 ….) >>>> mult 10 for a variation >>> 1 TO 7150
          i added 0.001 for fixed some round internal stuff .
          now i have fixed the float handling and variation in edit box , I CAN ENTER FLOAT VALUES IN EDIT BOX DIRECTLY NOW WITH THIS FIX , I HAVE TESTED IN THE ORIGINAL CTRLR AND THE FLOAT HANDLING NOT WORK FOR ME , VER 1444 OSX LION 10.7.4
          IF YOU ARE INTERESTED WITH THIS FIX , I CAN GIVE YOU THE CODE RELATED

          FLOAT POINT

          KALYWAY

          • This reply was modified 10 years, 10 months ago by KALYWAY.
          #10532
          atom
          Keymaster
            • Topics: 159
            • Replies: 2945
            • Total: 3104
            • ★★★★★

            I’m always interested in fixes.

            #10541
            KALYWAY
            Participant
              • Topics: 9
              • Replies: 23
              • Total: 32

              CtrlrInlineUtilities.h near line 270

              change this : return roundFloatToInt (minValue + normalized * (maxValue – minValue));

              to this :
              return (minValue + normalized * (maxValue – minValue));

              and in CtrlrModulatorProcessor.cpp near line 45

              change this : owner.setProperty (Ids::modulatorValue, currentValue);

              to this :

              owner.setProperty (Ids::modulatorValue, ( round((currentValue * 10 )) / 10));

              the round correction is for suppression off over decimals
              (if you do not that your module° value display : 256.00025451 (for example) ; this is the reason i have added 0.001 to my expression , it fixes my slider to correspond exactly for all values entered with num keyboard >>> values displayed in the lcd hardware )

              if you find a more precise solution it can be good !

              also in CtrlrModulatorProcessor.H near line 139

              change this :

              int currentValue, currentMidiValue, maxValue, minValue, globalIndex;

              to this

              float currentValue, currentMidiValue, maxValue, minValue, globalIndex;

              no paste bin needed for this changes !

              kalyway.

              • This reply was modified 10 years, 10 months ago by KALYWAY.
              #10555
              atom
              Keymaster
                • Topics: 159
                • Replies: 2945
                • Total: 3104
                • ★★★★★

                I can’t store values as floats internaly, i need them as integers to write them directly to memory (you can’t do that with floats, the bits are in a different encoding).

                I understand you need more precision, in this case this is the precision of the uiSlider component, the modulatorValue can store any value as long it is set properly.

                Also ALl components have a special property “componentValueDecimalPlaces” you can set that to increase the precision.

                #10558
                KALYWAY
                Participant
                  • Topics: 9
                  • Replies: 23
                  • Total: 32

                  OK , but when i set a float value in my float slider , if i save the panel , the value are restored OK when i reopen it , in the plugin AU version also !!!!
                  where is the problem ?
                  /////////////////////////////////////////////////////////////////////////////
                  others thing (no relation with the previous problem/fix) :

                  i also work on a fix with negatives values : if i create a normal uislider with -64 +63 range min max interval 1 (no float in this case ) when i write automation in logic pro , or in live ableton , the host do not take the negative part , i have tested this with the last version off AU plugin off ctrlr (no rebuild stuff , the original from dmg 1454 )
                  the expression area is OK for sending sysex on positive -64+63 >>>>> modulatorValue + 64 >>>> sysex formula OK working good
                  but automation writing negative part do not work , automation reading negative part IS OK , THE PROBLEM HAPPEN ONLY IN AUTO WRITE

                  the fix is coming soon !!! (if you are interested)

                  KALYWAY.

                  #10563
                  atom
                  Keymaster
                    • Topics: 159
                    • Replies: 2945
                    • Total: 3104
                    • ★★★★★

                    I’m always interested, i recommend using pastebin for those code snippets or at least enclose them in a <pre> tag.

                    • This reply was modified 10 years, 10 months ago by atom.
                    • This reply was modified 10 years, 10 months ago by atom.
                    • This reply was modified 10 years, 10 months ago by atom.
                    #10576
                    KALYWAY
                    Participant
                      • Topics: 9
                      • Replies: 23
                      • Total: 32

                      I’m always interested, i recommend using pastebin for those code snippets or at least enclose them in a <pre> tag.

                      CtrlrModulatorProcessor.cpp near line 340 :

                      http://pastebin.com/tEKfR3TE

                      it works 100% with sliders symetric settings (-24 +24 , -12 +12 , -6 +6) in this case the correction factor is 2 , but when the values are not symmetric (-64 +63 ) in my case the value sent to host is 0 to 1.02 , it’s not really bad but i have corrected factor to 1.99 for a 0 to 1 variation ( for my needs my panel have a lot off sliders with -64 +63 ) , the others sliders are -12+12 the host receive 0 (-12) to 1.02 (+12) it works also !

                      BUT the 0 base is always respected for any min max values in slider properties and with your original code the o base is not respected for negative min/max slider settings and the host receive negative/bad value and do not want to write .

                      BUT if you find a formula that works for all settings (-8 +12 , -6 -2 , -6 +6 , -x + x ….etc)
                      I AM INTERESTED !

                      • This reply was modified 10 years, 10 months ago by KALYWAY.
                      • This reply was modified 10 years, 10 months ago by KALYWAY.
                      • This reply was modified 10 years, 10 months ago by KALYWAY.
                      #10580
                      atom
                      Keymaster
                        • Topics: 159
                        • Replies: 2945
                        • Total: 3104
                        • ★★★★★

                        You are correct negatvie values were incorrect, but i think a fix would be just in getValueForHost()

                        const float CtrlrModulatorProcessor::getValueForHost() const
                        {
                        	const ScopedReadLock sl (processorLock);
                        
                        	return (normalizeValue (currentValue, minValue, maxValue));
                        }
                        

                        There was a difference on how Ctrlr wrote the value to the host and reported it when the host aksed for it, those two need to match. Here at work all i can is test it in one host, i’ll try more at home. But this seems to do the trick.

                        #10582
                        KALYWAY
                        Participant
                          • Topics: 9
                          • Replies: 23
                          • Total: 32

                          I HAVE JUST TESTED IT IN LOGIC PRO , AND YOUR SIMPLE FIX WORKS , THANKS A LOT !

                          OTHER THING : about the float values edit fix (the first fix roundtoint….)

                          with ctrlr original 1454 from dmg in standalone , IN EDIT MODE when i create a slider with min = 0.1 max= 715 interval 0.1 , the float variation work OK , but when i switch to panel mode to test in the device , the float part do not vary (only integer part ) example i can set only 1 to 715 integer values in device i cannot set 0.1 0.2 0.3 0.5 222.5 etc …)
                          FOR this reason i have modified inline utilities and others for displaying modulator value with float >>> formula >> device

                          but if this problem can be fixed without switching to float some files in sources it can be good !

                          KALYWAY.

                          • This reply was modified 10 years, 10 months ago by KALYWAY.
                          • This reply was modified 10 years, 10 months ago by KALYWAY.
                          • This reply was modified 10 years, 10 months ago by KALYWAY.
                        Viewing 11 posts - 1 through 11 (of 11 total)
                        • The forum ‘Using Ctrlr’ is closed to new topics and replies.
                        There is currently 0 users and 67 guests online
                        No users are currently active
                        Forum Statistics
                        Threads: 2,495, Posts: 17,374, Members: 77,605
                        Most users ever online was 12 on January 22, 2019 3:47 pm
                        Ctrlr