Expressions, some help needed

Home Forums General Using Ctrlr Expressions, some help needed

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #8763
    SWB
    Participant
    • Topics: 35
    • Replies: 157
    • Total: 192
    • ★★

    I formulated this expression for when a modulator receives a (midi) value: isBitSet (midiValue, 0). From the documentation I understand when the bit at position 0 is set, then ‘true’ is returned. In my case the receiving modulator is a button and so I expect the button to show ‘on’ when the returned value is ‘true’ and ‘off’ ‘when the returned value is ‘false’. But this is not the case, no change in the button’s appearance.

    An example: the received midivalue is hex 5A, so the binary form is: 01011010. The bit at position 0 has value 0, so the above expression should return ‘false’? Am I right or…? Any help much appreciated.

    (This is the last issue I have to resolve before uploading my TX7 panel.)

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

    Well yes it seems to work for me. Please remember that FALSE means 0 and TRUE means 1. So plan for your modulator values correctly. You can try attaching a LUA method to the modulator you are using to see what bits it’s getting

    debugMe = function(mod, value)
    	bi = BigInteger (value)
    	console (bi:toString(2,8))
    end
    
    • This reply was modified 9 years ago by atom.
    #9016
    zeoka
    Participant
    • Topics: 73
    • Replies: 466
    • Total: 539
    • ★★★

    Hi

    I’ve a modulator set to cc27 , 9 values :
    val1=10h
    val2=1Ch
    val3=28h
    val4=34h
    val5=40h
    val6=4Ch
    val7=58h
    val8=64h
    val9=70h
    So i need Expression to receive from the unit so i do :
    midivalue -16 * 12
    but this is not working
    I cant find on the doc about range of each values
    i just want start at value 16 and EACH value = 12 values
    How i can do ?
    Can i define value1 – 16 , value2 -28,value3 -40, etc…?

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

    Why is it not working ? Also remember about parentheses “()” this is basic math.

    #9019
    zeoka
    Participant
    • Topics: 73
    • Replies: 466
    • Total: 539
    • ★★★

    I’ve tried also :
    (midivalue -16) * 12

    #9357
    zeoka
    Participant
    • Topics: 73
    • Replies: 466
    • Total: 539
    • ★★★

    Solved
    I’ve set in the slider content regular values(0,1,2,3,..) instead 12,28,…

    and set this :

    I’ve a question : now if eventually i use midi function getbyte and set to the mod i don’t need to correct in LUA ?

    Attachments:
    You must be logged in to view attached files.
    #9369
    atom
    Keymaster
    • Topics: 159
    • Replies: 2945
    • Total: 3104
    • ★★★★★

    yes if you use expressions then you don’t need lua, they can work together but expressions can replace lua in simple situations (that’s what they are for).

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘Using Ctrlr’ is closed to new topics and replies.
There is currently 0 users and 33 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