Filein - bytes and bits / accessing DX7 parameter values from a sysex file.

KP's icon

Hi all,

To begin with I have to say that I have close to zero understanding of data, bytes, bits etc. But, I think it would be correct to say that what I am trying to do (however failing at) is to decipher data using the "filein" object.

I will do my best to explain my issue although I might not have the correct understanding and words for it.

In short; case is that I want to route every DX7 parameter value of a DX7 sysex file to a set of UI sliders in max.

Everything seem to work fine - after the first few headers etc. in the sysex file I can see that the values start to correspond perfectly with the values of the DX7 parameters. Just as I would have hoped. All this without much hassle.

However, the troubles start as soon as I reach a byte that holds the values of not only one parameter but two or more. The first couple of parameters were easy as 1 byte = 1 parameter value. But now I have 1 byte = 2 parameter values. Parameter A is on bit # 1 and 2, and Parameter B is on bit # 3 and "4. The thing is that the "filein" object only outputs a 0 here, so I can't seem to figure out how to access and use the bit information of the given byte.

So, I am sure that I am doing something wrong ..

So, question is, what I am doing wrong and how can I access the full set of parameter values via the sysex file? :)

Source Audio's icon

"1 byte = 2 parameter values" ???

1 byte can only be 1 value.

you mean 1 parameter = 2 bytes or better say 2 values for that parameter ?

You must route sysex string according to specifications.

You know which parameter has 1, 2 or whatever number of bytes following.

you can use for example route, match etc objects

KP's icon

@source audio:

sorry for my lack of knowledge here.

I actually did mean that 1 byte contains the values of two of DX7's parameters. For instance byte #12 contains param values for both "Detune" and "OSC Rate Scale". It is split out on the different bits and I have to decipher the bit in order to get the value for detune and osc rate scale. I found a very thorough documentation on how the values are split on the different bit numbers here (https://forum.pdpatchrepo.info/uploads/files/1611522180187-sysex-format.txt - it's found under "F" in the contents).

Source Audio's icon

then route $12 to 2 destinations, do they need scale 0 ~ 127 / 0 ~ nn ?

or is there another key to unpack the values ?

pdelges's icon

This may help, or not :

Max Patch
Copy patch and select New From Clipboard in Max.

KP's icon

@source audio, yes, I think the key to unpack the values is to calculate the bits and as I am currently just using the dexed vst I am scaling 0. 1. to send the values to the "vst~" object.

@Pdelges, thanks! And yes, that's definitely useful! I get the correct values in the case of byte number 12. But, I feel that the following bytes are a bit incorrect. Would this have something to do with the way that the bits are split between the params in for instance the cases of byte number 11, 13 and 15?

pdelges's icon

For #13:

It's probably easier to understand with binary representation

Max Patch
Copy patch and select New From Clipboard in Max.

KP's icon

Great, thanks Pdelges. And thanks a lot to both of you for your help! I think this was just what I needed :)