|
|
|
10-27-2014, 08:59 AM
|
#1
|
Human being with feelings
Join Date: Aug 2012
Location: Finland
Posts: 2,668
|
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.
|
|
|
10-27-2014, 05:51 PM
|
#2
|
Human being with feelings
Join Date: Aug 2013
Posts: 1,355
|
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.
|
|
|
10-28-2014, 09:48 AM
|
#3
|
Human being with feelings
Join Date: Aug 2012
Location: Finland
Posts: 2,668
|
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)
|
|
|
10-28-2014, 10:46 AM
|
#4
|
Human being with feelings
Join Date: Aug 2013
Posts: 1,355
|
Quote:
Originally Posted by spk77
...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.
|
|
|
10-28-2014, 11:06 AM
|
#5
|
Human being with feelings
Join Date: Aug 2012
Location: Finland
Posts: 2,668
|
Quote:
Originally Posted by Lazarus
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!
|
|
|
10-28-2014, 12:00 PM
|
#6
|
Human being with feelings
Join Date: Aug 2012
Location: Finland
Posts: 2,668
|
Don't know what I'm doing, but this seems to work also:
|
|
|
10-28-2014, 02:24 PM
|
#7
|
Human being with feelings
Join Date: Aug 2013
Posts: 1,355
|
Of course, that's much more sensible!
From that, I think this is about as neat as it can get...
|
|
|
10-28-2014, 02:41 PM
|
#8
|
Human being with feelings
Join Date: Aug 2012
Location: Finland
Posts: 2,668
|
Quote:
Originally Posted by Lazarus
Of course, that's much more sensible!
From that, I think this is about as neat as it can get...
|
Nice! Thanks again
|
|
|
10-28-2014, 03:15 PM
|
#9
|
Human being with feelings
Join Date: Aug 2013
Posts: 1,355
|
No problemo, you got the logic yourself even with me distracting you with a bunch of nonsense!
|
|
|
10-29-2014, 06:59 AM
|
#10
|
Human being with feelings
Join Date: Aug 2012
Location: Finland
Posts: 2,668
|
Yes! y>>1|x<<6 works for all the knobs:
(turning the knobs on my GM 36 now updates the "virtual knobs")
|
|
|
10-29-2014, 08:11 AM
|
#11
|
-blänk-
Join Date: Jun 2008
Posts: 11,359
|
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...
|
|
|
10-29-2014, 08:42 AM
|
#12
|
Human being with feelings
Join Date: Aug 2013
Posts: 1,355
|
Cool, good work getting it sorted! The plugin looks really useful too.
|
|
|
10-29-2014, 08:50 AM
|
#13
|
Human being with feelings
Join Date: Aug 2012
Location: Finland
Posts: 2,668
|
Quote:
Originally Posted by gofer
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
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/
|
|
|
10-29-2014, 09:02 AM
|
#14
|
Human being with feelings
Join Date: Aug 2012
Location: Finland
Posts: 2,668
|
Quote:
Originally Posted by Lazarus
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.
|
|
|
10-29-2014, 09:33 AM
|
#15
|
-blänk-
Join Date: Jun 2008
Posts: 11,359
|
Quote:
Originally Posted by spk77
|
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.
|
|
|
10-29-2014, 10:44 AM
|
#16
|
Human being with feelings
Join Date: Aug 2012
Location: Finland
Posts: 2,668
|
Quote:
Originally Posted by gofer
Homer on acid
|
Oh...now I can't unsee it
|
|
|
10-29-2014, 01:23 PM
|
#17
|
Human being with feelings
Join Date: Aug 2013
Posts: 1,355
|
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.
???
|
|
|
10-29-2014, 01:41 PM
|
#18
|
Human being with feelings
Join Date: Aug 2012
Location: Finland
Posts: 2,668
|
Quote:
Originally Posted by Lazarus
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!
|
|
|
10-29-2014, 02:54 PM
|
#19
|
Human being with feelings
Join Date: Aug 2013
Posts: 1,355
|
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 12:54 AM.
|