Home › Forums › General › Using Ctrlr › LSB MSB HELP ME
- This topic has 10 replies, 2 voices, and was last updated 10 years, 10 months ago by KALYWAY.
-
AuthorPosts
-
July 1, 2013 at 4:34 pm #10523
HELLO , YOU CAN SEE INN THIS PICTURE THE BIT PROCESSING I WANT TO ADD IN MODULATOR EXPRESSION (FORWARD ONLY)
the INPUT VARY FROM 1 TO 7150 , AND IT CONVERTED INTO HEX LSB MSB
I JUST WANT TO ADD THIS IN CTRLR !
THANKS
July 1, 2013 at 4:47 pm #10524SysEx 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:
There is a lot about formulas in the getting started:I just helped someone with the alesis formula:
July 1, 2013 at 8:11 pm #10528THANK 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 RELATEDKALYWAY
- This reply was modified 10 years, 10 months ago by KALYWAY.
July 1, 2013 at 10:36 pm #10532I’m always interested in fixes.
July 1, 2013 at 11:39 pm #10541CtrlrInlineUtilities.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.
July 2, 2013 at 3:47 pm #10555I 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.
July 2, 2013 at 8:21 pm #10558OK , 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 WRITEthe fix is coming soon !!! (if you are interested)
KALYWAY.
July 3, 2013 at 12:44 pm #10563July 3, 2013 at 3:15 pm #10576I’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 :
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 !July 3, 2013 at 4:02 pm #10580You 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.
July 3, 2013 at 4:36 pm #10582I 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 >> devicebut if this problem can be fixed without switching to float some files in sources it can be good !
KALYWAY.
-
AuthorPosts
- The forum ‘Using Ctrlr’ is closed to new topics and replies.