Negative values in hex, which expression?

Home Forums General Programming Negative values in hex, which expression?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #27012
    dontwarrior
    Participant
    • Topics: 1
    • Replies: 2
    • Total: 3

    Hallo, first of all, congratulations for the great software you have created and participated, so far this is the most user friendly approach to control external synthesizers I’ve found, hats down.

    I am building a panel for my EMU Proteus 2000, and so far it goes great, except that my programming (math) ability is quite limited and I need guidance to choose a correct expression to convert negative values in hex format.

    The sysex string to control preset arpeggio speed looks like this (on page 62 from the specs – http://soundprogramming.net/manuals/E-Mu_ProteusFamily_Sysex2.2.pdf):

    F0 18 0f 00 55 01 02 11 08 xx xx f7

    where xx xx are 7 bits LSB and MSB (LS first)

    The values are ranging from -2 to 2 and if I set those as the component minimal and maximum value it appears correct on the user interface, but I cannot figure out an expression to convert the value in negative numbers.
    For this modulator there are just 5 difference settings and for this component I could do it with a workaround and input the string 5 times, but as I went trough the specs, there are many parameters that would require a expression function to convert to negative numbers as values range from negative to positive , e.g., preset LINK 1 level (-96 to +4):

    F0 18 0f 00 55 01 02 02 0a xx xx f7

    preset LINK 1 transpose (-24 to +24 )

    F0 18 0f 00 55 01 02 04 0a xx xx f7

    or LINK 1 pan (-64 to +64 )

    F0 18 0f 00 55 01 02 03 0a xx xx f7

    What is the best way to approach this? I went to the documentation, but my math understanding is someway limited regarding programing with expressions.

    I will keep reading, but any help is appreciated

    Thank you

    #27016
    dontwarrior
    Participant
    • Topics: 1
    • Replies: 2
    • Total: 3

    getting clear with this :), though it might take time to ring trough

    Korg Z1 – Negative Values

    #27017
    dontwarrior
    Participant
    • Topics: 1
    • Replies: 2
    • Total: 3

    it worked with this formula in the expressions:

    lt (modulatorValue, 0, 16383 – (abs(modulatorValue)), modulatorValue)

    though in the first example of mine (the arpeggio speed) the -1 value is skiped (I can live with that), it works flawless with -96 +10 or -64 +64 ranges, by just configuring the min and max value of the component

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