Old 10-27-2014, 08:59 AM   #1
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default Sysex messages - getting "needed" values out ¯\(°_o)/¯

I'm trying to make a remote control app (JSFX) for H&K GrandMeister 36:




Sending CC messages from the app to amp (via MIDI cable) works fine - I can control the knobs, power soak settings, presets, use parameter modulation, change channels etc.
Code:
midisend(offset, $xB0, 25, val); // CC25 on channel 1 at "val" --> amp MIDI in --> "Presence knob value" on the amp is updated to "val"
...but the amp sends sysex messages back to the audio interface MIDI in. I would need to get certain data out of the message (so I could update the knobs and buttons on the JSFX GUI when turning the knobs on the amplifier).



...f.ex. "Presence knob":
Presence knob at min pos:
B0 19 00 [CC25] chan 1 val 0 if I send this CC message to the amp...
F0 00 20 44 00 10 00 06 00 04 19 00 00 1F F7 ...amp sends this sysex message back

Presence knob at max pos:
B0 19 7F [CC25] chan 1 val 127 // CC25, channel 1, val 127 --> amp MIDI in...
F0 00 20 44 00 10 00 06 00 04 19 01 7F 61 F7 // ...amp returns this sysex message to audio interface MIDI in [/CODE]
  • I think there are 128 different positions for each knob.
  • I know that the "blue 19" == CC25
  • next 3 values (green text) are probably the values I'm looking for (I think)

Here are some other "Presence knob" positions I tested:
Code:
Presence knob 0%
B0 19 00 [CC25] chan 1 val 0 // this is sent to amp
F0 00 20 44 00 10 00 06 00 04 19 00 00 1F F7 // amp sends this back

B0 19 01 [CC25] chan 1 val 1
F0 00 20 44 00 10 00 06 00 04 19 00 02 1D F7 

B0 19 02 [CC25] chan 1 val 2
F0 00 20 44 00 10 00 06 00 04 19 00 04 1B F7 

B0 19 03 [CC25] chan 1 val 3
F0 00 20 44 00 10 00 06 00 04 19 00 06 19 F7 

B0 19 04 [CC25] chan 1 val 4
F0 00 20 44 00 10 00 06 00 04 19 00 08 17 F7 

B0 19 05 [CC25] chan 1 val 5
F0 00 20 44 00 10 00 06 00 04 19 00 0A 15 F7 

B0 19 06 [CC25] chan 1 val 6
F0 00 20 44 00 10 00 06 00 04 19 00 0C 13 F7 

B0 19 07 [CC25] chan 1 val 7
F0 00 20 44 00 10 00 06 00 04 19 00 0E 11 F7 

B0 19 08 [CC25] chan 1 val 8
F0 00 20 44 00 10 00 06 00 04 19 00 10 0F F7 

B0 19 09 [CC25] chan 1 val 9
F0 00 20 44 00 10 00 06 00 04 19 00 12 0D F7 

B0 19 0A [CC25] chan 1 val 10
F0 00 20 44 00 10 00 06 00 04 19 00 14 0B F7 
.
.
.
B0 19 0E [CC25] chan 1 val 14
F0 00 20 44 00 10 00 06 00 04 19 00 1C 03 F7

B0 19 0F [CC25] chan 1 val 15
F0 00 20 44 00 10 00 06 00 04 19 00 1E 01 F7 

B0 19 10 [CC25] chan 1 val 16
F0 00 20 44 00 10 00 06 00 04 19 00 20 3F F7 
.
.
.
B0 19 3F [CC25] chan 1 val 63
F0 00 20 44 00 10 00 06 00 04 19 00 7E 61 F7 

B0 19 40 [CC25] chan 1 val 64
F0 00 20 44 00 10 00 06 00 04 19 01 00 1E F7 
.
.
.
B0 19 78 [CC25] chan 1 val 120
F0 00 20 44 00 10 00 06 00 04 19 01 71 6F F7 

B0 19 79 [CC25] chan 1 val 121
F0 00 20 44 00 10 00 06 00 04 19 01 73 6D F7 

B0 19 7A [CC25] chan 1 val 122
F0 00 20 44 00 10 00 06 00 04 19 01 75 6B F7 

B0 19 7B [CC25] chan 1 val 123
F0 00 20 44 00 10 00 06 00 04 19 01 77 69 F7

B0 19 7C [CC25] chan 1 val 124
F0 00 20 44 00 10 00 06 00 04 19 01 79 67 F7 

B0 19 7D [CC25] chan 1 val 125
F0 00 20 44 00 10 00 06 00 04 19 01 7B 65 F7 

B0 19 7E [CC25] chan 1 val 126
F0 00 20 44 00 10 00 06 00 04 19 01 7D 63 F7 

Presence knob 100%
B0 19 7F [CC25] chan 1 val 127  // CC25, channel 1, val 127 --> amp MIDI in...
F0 00 20 44 00 10 00 06 00 04 19 01 7F 61 F7 // ...amp returns this sysex message to audio interface MIDI in

Does anyone know how to convert those 3 green values to f.ex. 0-127? Do I need to do bit shifting, and/or operations etc.? Thanks

Last edited by spk77; 10-27-2014 at 09:10 AM.
spk77 is offline   Reply With Quote
Old 10-27-2014, 05:51 PM   #2
Lazarus
Human being with feelings
 
Join Date: Aug 2013
Posts: 1,355
Default

This...
Code:
B0 19 40 [CC25] chan 1 val 64
F0 00 20 44 00 10 00 06 00 04 19 01 00 1E F7
... is freaking me out a little bit, should that not end in 01 1E F7?

In any case, the three values being x, y and z, doing this...

((y-x)>>1)+x*$x40

... will get 0 -> 127.
Lazarus is offline   Reply With Quote
Old 10-28-2014, 09:48 AM   #3
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

Thanks Lazarus!

I got more information on the GM36 sysex format:

Code:
[F0] Start sysex message
[00 20 44 00 10 00 06 00] H&K / Grandmeister identification code, never changes
[04] type of message : 04 = parameter change, 40 = preset content
[19] parameter type : 19=Presence, 18=Resonance, 1E=Power soak etc.
[01 7F] parameter value, from 0 to 256 in hexa 7bit (i.e. 0=00 00; 1=00 01 ... 127=00 7F; 128= 01 00; 129 = 01 01 ... 256 = 01 7F)
[61] some kind of checksum, but did not manage to find how it is calculated...
[F7] End of sysex
This is still confusing me...If I want to convert the parameter values from 0 to 127...

...this seems to work for values from 0 to 64 (bit shift right 1 bit):
B0 19 00 [CC25] chan 1 val 0 (this is sent to the amp)
F0 00 20 44 00 10 00 06 00 04 19 00 00 1F F7 ....0000 >> 1 -> returns 0 (return values are integers here)

B0 19 01 [CC25] chan 1 val 1
F0 00 20 44 00 10 00 06 00 04 19 00 02 1D F7 ....0002 >> 1 -> returns 1

B0 19 02 [CC25] chan 1 val 2
F0 00 20 44 00 10 00 06 00 04 19 00 04 1B F7 ....0004 >> 1 -> returns 2
.
.
.
B0 19 3F [CC25] chan 1 val 63
F0 00 20 44 00 10 00 06 00 04 19 00 7E 61 F7 ....007E >> 1 -> returns 63

B0 19 40 [CC25] chan 1 val 64
F0 00 20 44 00 10 00 06 00 04 19 01 00 1E F7 ....0100 >> 1 -> returns 64



...but values from 65 to 127, I need to subtract 80 (=int 128) first and then do the bit shifting:
B0 19 41 [CC25] chan 1 val 65
F0 00 20 44 00 10 00 06 00 04 19 01 02 3C F7....(0102 - 80) >> 1 -> returns 65
.
.
.
B0 19 7F [CC25] chan 1 val 127
F0 00 20 44 00 10 00 06 00 04 19 01 7F 61 F7....(017F - 80) >> 1 -> returns 127

(There is probably a simple formula that would work for all the values, but I'm not able to figure it out)
spk77 is offline   Reply With Quote
Old 10-28-2014, 10:46 AM   #4
Lazarus
Human being with feelings
 
Join Date: Aug 2013
Posts: 1,355
Default

Quote:
Originally Posted by spk77 View Post
...but values from 65 to 127, I need to subtract 80 (=int 128) first and then do the bit shifting:
B0 19 41 [CC25] chan 1 val 65
F0 00 20 44 00 10 00 06 00 04 19 01 02 3C F7....(0102 - 80) >> 1 -> returns 65
This is confusing, I thought the second number (y) was odd if the first number was 1. I thought the bit that was freaking me out was a mistake, but obviously not.

So...

(((x<<8)|y)-$x80*x)>>1

... should do it. Methinks.
Lazarus is offline   Reply With Quote
Old 10-28-2014, 11:06 AM   #5
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

Quote:
Originally Posted by Lazarus View Post
This is confusing, I thought the second number (y) was odd if the first number was 1. I thought the bit that was freaking me out was a mistake, but obviously not.

So...

(((x<<8)|y)-$x80*x)>>1

... should do it. Methinks.
Thank you very much!
spk77 is offline   Reply With Quote
Old 10-28-2014, 12:00 PM   #6
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

Don't know what I'm doing, but this seems to work also:
Code:
((x<<7)|y)>>1
spk77 is offline   Reply With Quote
Old 10-28-2014, 02:24 PM   #7
Lazarus
Human being with feelings
 
Join Date: Aug 2013
Posts: 1,355
Default

Of course, that's much more sensible!

From that, I think this is about as neat as it can get...

Code:
y>>1|x<<6
Lazarus is offline   Reply With Quote
Old 10-28-2014, 02:41 PM   #8
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

Quote:
Originally Posted by Lazarus View Post
Of course, that's much more sensible!

From that, I think this is about as neat as it can get...

Code:
y>>1|x<<6
Nice! Thanks again
spk77 is offline   Reply With Quote
Old 10-28-2014, 03:15 PM   #9
Lazarus
Human being with feelings
 
Join Date: Aug 2013
Posts: 1,355
Default

No problemo, you got the logic yourself even with me distracting you with a bunch of nonsense!
Lazarus is offline   Reply With Quote
Old 10-29-2014, 06:59 AM   #10
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

Yes! y>>1|x<<6 works for all the knobs:

(turning the knobs on my GM 36 now updates the "virtual knobs")
spk77 is offline   Reply With Quote
Old 10-29-2014, 08:11 AM   #11
gofer
-blänk-
 
gofer's Avatar
 
Join Date: Jun 2008
Posts: 11,359
Default

You should give them some eyebrows, too

no, wait the correct emo-smiley would be


Seriously, congrats for the decoding work. I'd be stumped and would have needed to resort to complicated math formulars - I just can't get my grips around bit shifting, try as I might...
gofer is offline   Reply With Quote
Old 10-29-2014, 08:42 AM   #12
Lazarus
Human being with feelings
 
Join Date: Aug 2013
Posts: 1,355
Default

Cool, good work getting it sorted! The plugin looks really useful too.
Lazarus is offline   Reply With Quote
Old 10-29-2014, 08:50 AM   #13
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

Quote:
Originally Posted by gofer View Post
You should give them some eyebrows, too

no, wait the correct emo-smiley would be
It's the "How do mix drums?" guy : http://www.ultimatemetal.com/forum/f...mix-drums.html

Quote:
Originally Posted by gofer View Post
Seriously, congrats for the decoding work. I'd be stumped and would have needed to resort to complicated math formulars - I just can't get my grips around bit shifting, try as I might...
Thanks! I couldn't have solved the bit shifting part without the help of Lazarus and this calculator http://www.penjee.com/calc/
spk77 is offline   Reply With Quote
Old 10-29-2014, 09:02 AM   #14
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

Quote:
Originally Posted by Lazarus View Post
Cool, good work getting it sorted! The plugin looks really useful too.
Thanks! I'll have to add more knobs and buttons.

These parameters can be adjusted by sending CC messages:
Code:
Channels: CC# 0-31
Values for Clean Channel: 00-31
Values for Crunch Channel: 32-63
Values for Lead Channel: 64-95
Values for Ultra Channel: 96-127

Effects:
Mod-FX On-Off: CC# 52
Values: 0-63 Off – 64-127 On
Delay On-Off: CC# 63
Values: 0-64 Off – 64-127 On
Reverb On-Off: CC# 54:
Values: 0-63 Off – 64-127 On
Hint: Mod-FX, Delay, and Reverb must be programmed into your original preset in order to switch on/off.

FX Loop On-Off: CC# 55
Values: 0-63 Off – 64-127 On
Noise Gate On-Off CC# 63
Values: 0-63 Off – 64-127 On
Boost On-Off: CC# 64
Values: 0-64 Off – 64-127 On

Power Soak: CC 30#
Silent Recording Values: 0-25
1 Watt values: 26-51
5 Watt values: 52-77
18 Watt values 78-101
36 Watt values 102-127
Hint: You can choose any value within the required range. For example: 10 for Silent Recording, 30 for 1 Watt, 60 for 5 Watt, 90 for 18 Watt and 120 for 36 Watt.

Controller Functions
1 Modulation Intensity
4 Delay Time, 10ms steps (double steps), 5ms to 1360ms
7 Volume (soft*)
20 Gain (soft*)
21 Bass
22 Mids
23 Treble
24 Resonance
25 Presence
26 Modulation speed (always for the active modulation effect, 64 steps)
27 Delay feedback
28 Delay volume
29 Reverb volume
30 Power Soak switching (5 sectors)
56 Gain (hard)
57 Volume (hard)
The interesting thing is that I can adjust the knobs on the amp -> amp sends sysex back and updates the virtual knobs -> now I can store the knob positions as JSFX presets.
spk77 is offline   Reply With Quote
Old 10-29-2014, 09:33 AM   #15
gofer
-blänk-
 
gofer's Avatar
 
Join Date: Jun 2008
Posts: 11,359
Default

Quote:
Originally Posted by spk77 View Post
It's the "How do mix drums?" guy : http://www.ultimatemetal.com/forum/f...mix-drums.html
Yeah, the ascii gui is nice, too



But I actually meant the knobs. Should keep them in pairs.
Homer on acid

Thanks for the calc page, maybe I'll be able to get behind it on that site.
gofer is offline   Reply With Quote
Old 10-29-2014, 10:44 AM   #16
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

Quote:
Originally Posted by gofer View Post
Homer on acid
Oh...now I can't unsee it
spk77 is offline   Reply With Quote
Old 10-29-2014, 01:23 PM   #17
Lazarus
Human being with feelings
 
Join Date: Aug 2013
Posts: 1,355
Default

It looks like they are becoming self aware. To check how far this has gone, could you tell us if you have noticed any of the following since implementing the GUI:

1) Code in the script being changed from the last time you left it.
2) Any rooms in your house suddenly becoming a network of loose cables plugged into 1980s looking tech hung on the walls. This could be accompanied by you missing periods of time.
3) A general feeling of disconnection and/or the world seeming a bit too perfect.

???
Lazarus is offline   Reply With Quote
Old 10-29-2014, 01:41 PM   #18
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

Quote:
Originally Posted by Lazarus View Post
It looks like they are becoming self aware. To check how far this has gone, could you tell us if you have noticed any of the following since implementing the GUI:

1) Code in the script being changed from the last time you left it.
2) Any rooms in your house suddenly becoming a network of loose cables plugged into 1980s looking tech hung on the walls. This could be accompanied by you missing periods of time.
3) A general feeling of disconnection and/or the world seeming a bit too perfect.

???
All of these and there are crop circles on my...floor!
spk77 is offline   Reply With Quote
Old 10-29-2014, 02:54 PM   #19
Lazarus
Human being with feelings
 
Join Date: Aug 2013
Posts: 1,355
Default

Lazarus is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 12:54 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.