sysex message with funky checksum

Home Forums General Programming sysex message with funky checksum

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #419
    msepsis
    Participant
      • Topics: 219
      • Replies: 732
      • Total: 951
      • ★★★

      I’m coding up some buttons on a jp-8080 panel..
      some of roland’s sysex messages are weird.

      arpeggiator active, for instance sends
      [f0 41 10 00 06 12 01 00 00 17 [b:6rzirppp]01 67[/b:6rzirppp] f7] for on state and
      [f0 41 10 00 06 12 01 00 00 17 [b:6rzirppp]00 68[/b:6rzirppp] f7] for off state

      There are two variables – the 11th and 12th positions.

      how do i set up the Button values to send 01,67 on one click then 00,68 on the next?

      Monstrum Media | Music, Sound & Software Design, Chicago / San Francisco listen

      #3144
      msepsis
      Participant
        • Topics: 219
        • Replies: 732
        • Total: 951
        • ★★★

        duh that’s the checksum.
        but why does 00 checksum a number HIGHER than 01??

        Monstrum Media | Music, Sound & Software Design, Chicago / San Francisco listen

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

          the checksum is a complicated beast sometimes, usually setting it to 00 means accept the message anyway, but there might be a algorithm for that, i think i added one of those in the sysex editor.

          #3146
          msepsis
          Participant
            • Topics: 219
            • Replies: 732
            • Total: 951
            • ★★★

            ok. I’m stuck on this again.
            From the JP manual:
            how to calculate the checksum

            [i:1i6p0ylb]The following formula shows how to calculate the checksum when the exclusive message to be transmitted has an address of aa bb cc ddH and data or size of ee ffH

            aa+bb+cc+dd+ee+ff=total
            total /128 = quotient…remainder
            128 – remainder = checksum
            [/i:1i6p0ylb]

            ok. how do i calculate checksum within ctrlr? I think this is probably why that other JP-8080 panel never was posted here ;p

            Monstrum Media | Music, Sound & Software Design, Chicago / San Francisco listen

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

              have a look at the math library of LUA (http://www.lua.org/manual/5.1/manual.html look for math.fmod)
              also LUA has the modulo operation
              [code:1pooxp1c]
              Lua 5 % Divisor
              Lua 4 mod(x,y) Divisor
              [/code:1pooxp1c]

              also i wrote a jp8080 checksum method for Ctrlr and it can be used in the SysEx editor, it looks like this:
              [code:1pooxp1c]
              void CtrlrSysexProcessor::checksumRolandJp8080(const SysExToken token, MidiMessage &m)
              {
              /*
              Since +5 is parameter value 1DH,
              F0 41 10 00 06 (model id) 12 (command if) 01 00 10 03 (address) 1D (data) ?? (checksum) F7

              Next we calculate the checksum.
              01H + 00H + 10H + 03H + 1DH = 1 + 0 + 16 + 3 + 29 = 49 (sum)
              49 (total) 128 ÷ 0 (quotient) ... 49 (remainder)
              checksum = 128 – 49 (quotient) = 79 = 4FH

              This means that the message transmitted will be F0 41 10 00 06 12 01 00 10 03 1D 4F F7
              */

              String str;
              const int startByte = token.position – token.data0;
              double chTotal = 0.0;
              uint8 *ptr = m.getRawData();

              for (int i=startByte; i<token.position; i++)
              {
              chTotal = chTotal + *(ptr+i);

              }

              const double remainder = fmod(chTotal, 128);
              const uint8 ch = (uint8)(128 – remainder);
              *(ptr+token.position) = ch;
              }
              [/code:1pooxp1c]

              #3148
              msepsis
              Participant
                • Topics: 219
                • Replies: 732
                • Total: 951
                • ★★★

                thanks Atom.
                I’m not sure how I use your jp8080 checksum method in the sysex editor.. the sysex editor’s functionality seems to be limited to adding / subtracting to the length of the message and entering values. what value do i put in the checksum’s spot to specifically call your jp8080 checksum method?

                thanks again

                Monstrum Media | Music, Sound & Software Design, Chicago / San Francisco listen

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

                  right click on a byte in the sysex editor to see "other" options <img decoding=” title=”Smile” />

                  #3150
                  msepsis
                  Participant
                    • Topics: 219
                    • Replies: 732
                    • Total: 951
                    • ★★★

                    shit goddamn, atom you really have thought of everything, haven’t you.

                    thank you once again atom.

                    Monstrum Media | Music, Sound & Software Design, Chicago / San Francisco listen

                    #49067
                    memorysplice
                    Participant
                      • Topics: 14
                      • Replies: 59
                      • Total: 73

                      I figured it out. I was getting parameter changes but without proper checksum. Thank you!

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