Yeah, the MIDI_GET_GRAPH call is something I will be using all over the next version of AxePad that I am working on. It is in the official MIDI specs from Fractal. I had assumed that Scrutinizer already had a copy of that document.
At risk of getting a slap on the wrist from FA, here is what I have worked out. Note: The MIDI specs are still a little short on detail about this call, so I had to do some sleuthing work myself to work out how to interpolate the values.
MIDI_GET_GRAPH is function number 0x30. It will return a 127 byte stream relating to the LAST block parameter you queried from the device. So, if you query any of the Amp Speaker controls, then a call to MIDI_GET_GRAPH immediately afterwards will return the speaker graph for the block. Similar if you call any of the PEQ parameters, then this call will return the PEQ graph.
I have never actually tested it with the Modifier graph, but it should so the same after you call any Modifier parameter. I'll be including Modifiers in the next AxePad release anyhow, so I expect I will have to come across this at some stage.
The MIDI call to send looks like:
F0 00 01 74 03 30 36 F7
The response will be the standard MIDI header (with 0x30 as the function call) plus 127 values split as 2 byte MIDI packets.
That was about as far as the Fractal specs went. The following is what I deduced after a few hours of playing with this command and studying the returned data:
To convert the 2 byte MIDI packets into a readable value is fairly simple. The data comes back as a series with the LSB first then the MSB. To convert to a single value byte:
(MSB << 7) || LSB
This then gives you a series of 127 bytes with the values 0 to 16384. You basically need to plot these values onto a graph with 127 points along the X axis. The values above are the Y axis values... BUT
You will need to cater for negative values. In the returned data, any value ABOVE 8192 is actually a negative value, so you will need to 'clean up' the Y axis values first to give you a proper range of negative and positive values to plot, as thus:
If Value > 8192 Then Value = Value - 16384
Now it is simply a case of plotting these. Pseudocode for doing so will be similar to:
Code:
ReturnedValueArray[] = ResultsOfMIDICall(0x30)
For X = 1 to 127
Y = ReturnedValueArray[X]
// Convert to positive/negative as explained above
If Y > 8192
Y = Y - 16384
End If
Plot(X, Y)
End For
Hope this helps.