Developing a panel for Yamaha TX7

Home Forums General Programming Developing a panel for Yamaha TX7

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

      I’m facing the following challenge: the TX7 has 6 operators each of which can be  ‘on‘ or ‘off‘ using a sysex message (F0 43 10 01 1B xx F7). The value of xx depends on the state of ALL operators. If all operators need to be on then the value of xx is 3F, which is in binary (0)111111. If for example operator 3 needs to be off then the value of xx is hex 37, which is in binary (0)11011. So the value and position of the bits determine which operator is on or off, but how do I ‘compose’ this binary value? I assume I have to use Lua to find out the current state of all the operators and then figure out which hex value xx should get the reflect the desired ON/OFF state of all operators. Or can it be solved without programming? Before I dive into this, maybe  some clever soul on this forum knows how to do this in the most efficient way! Or at least point me in the right direction. Thanks in advance. (I have attached the relevant part from the manual.)

      • This topic was modified 11 years, 1 month ago by SWB. Reason: correction of hex value (7F > 3F)
      Attachments:
      You must be logged in to view attached files.
      #7366
      atom
      Keymaster
        • Topics: 159
        • Replies: 2945
        • Total: 3104
        • ★★★★★

        You could use global variables and expressions to do that. You can do some BIT operations with expressions, have a look here: http://ctrlr.org/expressions-in-ctrlr-2/
        One global variable can be kept as a state of all operators.

        Also there is an example that does something similar in Panels/DEMO – Complex expressions.panel

        #7368
        SWB
        Participant
          • Topics: 35
          • Replies: 157
          • Total: 192
          • ★★

          Thanks, I will have a look at the information you pointed at!

          #7402
          SWB
          Participant
            • Topics: 35
            • Replies: 157
            • Total: 192
            • ★★

            With the help of your ‘DEMO-Complex expressions.panel’ I was able to solve the problem. I used this expression: setGlobal (0, setBit (global.k0, x, modulatorValue)) and x has to hold the bit number to set. As you can see the setBit expression uses a 3rd parameter, which you don’t mention in your Documentation. Without this 3rd parameter the expression doesn’t work (for me…).

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