Writing SysEx in MAX for a DX7
As Forest Gump once said: I am not a smart man. So I might need a little help, or a push in the right direction.
I've got a project I'm working on, and it's a pretty simple idea: build a DX7 patch editor that you can control with an external midi controller like the one attached.
I think the problem is that I suck with sysex, and don't quite understand what I need to do to make Max send a DX7 the appropriate MIDI messages (to change the DX7's internal sound parameters).
A point in the right direction?
That sounds like a fun project! First thing you should do is read the dx7 manual and find out how parameters can be changed: http://www2.yamaha.co.jp/manual/pdf/emi/english/synth/DX7E1.pdf
I took a quick look and it seems that remark #3 on the bottom right of p22 is what you want to do. The most important part from the manual is the midi specification, which defines how the machine responds and sends out midi data, it starts on page 30 (it may look a bit scary). I think what you need is on the bottom right of that page (1.2.4) which seems to define how a sysex message for changing a voice parameter is set up.
What it is: a list of bytes (you could see them as numbers) that have to be sent for that certain command, with some data left open and for tou to fill in. As you can see, it starts with a status byte (still talking about 1.2.4), and a little further down needs a parameter to change (0ppppppp) and the data for that parameter (0ddddddd). You can find these parameters on the next page (you need to send the oarameter number in the message).
So basically what you do is fill in those missing numbers for the command you want to send, construct a sysex message out of it, and send it. And i think you need to make sure that the memory protection of the dx7 is off.
Hope that clarifies things a bit, feel free to ask anything,
A little more info:
- what you need to do is send 7 values (look at that 1.2.4 on p30, its a list of 7 values)
- what you see there are binary numbers, you should convert them to decimal (http://mistupid.com/computers/binaryconv.htm)
- any letters you see there should be filled in by you
- you can use this max obj to send a list of values: http://www.cycling74.com/docs/max5/refpages/max-ref/sxformat.html
So when looking at the values you need to send:
- first, the standard sysex startbyte (also mentioned on the docpage for sxformat): 11110000, which is 240 in decimals. (Please note that all bytes are 8 bits, they consist of 8 zeroes or ones)
- then, the identification number: 67. It’s already given in decimals, no need to convert it (the max object i mentioned uses decimal values)
- third is a combined one, we need to send both the substatus and the channel here. I have no idea what the substatus is, but let’s just do what the manual hints: substatus=1, channel=0. Looking at 0sssnnnn (a binary numberstructure) it appears that we need 3 bits for the sub and 4 for the channel, but this is a little weird and leads to something i dont understand a little later on, but here it doesnt seem to matter. So: a substatus of 1 is in binary: 1 or 01 or 0000001. According to the manual we need to fill the three locations marked with an s, so we use 001. The channelnumber value is 0 (seems to equal midichannel 1) and that is in binary (with 4 locations to fill here) 0000. So when we fill in 0sssnnnn we get 00010000, which converts to 16.
- then,we need to send the parameter group number. When looking at the next page in the manual, g=0 is used for the voiceparameters and g=2 for some specific functions and settings like pitchbend range. Let’s say for this example we want to set the ‘Op6 operator output level’ to 20 (just one of the many voice parameters i picked in the list on page 31). So, we want to change a voice parameter which means we need to set g to 0 for this byte.
- (by the way, i have no idea why the manual says 0ggggggpp for the previous byte, it appears that we need to enter two variables here, but i don’t see any mention of that, there’s just a group number, so let’s assume that it’s a mistake or a confusing notation, and that it is 0ggggggg)
- on to the next, the parameter number that we want to change. As i said, we want to change the op6 operator output level here, which you can see in the list has a parameternumber of 16.
- (again, a little confusion here on my part. The manual says 0ppppppp for this previous entry, which implies that you have 7 bits to fill for this value. However, 7 bytes gives you 128 possibilities, and as you can see in the list, there are more than that. I assume here that you can use the full 8bits as in pppppppp. You probably dont need to worry about this, since you can just get the decimal value for the parameter that you wan to change)
- then, the value to set the parameter to. We chose 20.
- finally, a codeword to let the synthesizer know this is the end of this sysex command: 247
Which leads to this list of numbers to put in the sxformat object and send to your dx7:
240, 67, 16, 0, 16, 20, 247
(By the way, i have no idea if this works….this is what i make out of looking at the manual)
I hope this helps you out. Let us know how you get on.
This patch has a couple of examples and includes a comprehensive list of all of the values you need to give to the [sxformat] object that can be edited on the original DX7 (don’t know about any other version).
Just replace the "xx" with "/ in $i1 /" and feed the [sxformat] object data from your midi controller. (You will want to scale the 0-127 values from your midi controller down to values that are suitable, eg the Operators on the DX7 require values of 0-99, etc).
I’ve also attached two text files for the Edit and Function sysex values. Both of which came from Clyde’s Midi bus stop website (http://web.archive.org/web/20060225110206/http://home.worldoptions.com.au/jonescnt/jonescnt/downcont.htm) and both of which I’ve edited to the values that the [sxformat] object will accept.
It works with my DX7. Unfortunately it’s not smooth sailing though. I’d really like to be able to edit the DX7 in realtime without the sound glitching at all but my DX7 can’t handle being edited in realtime via sysex without it’s output being interrupted. I’m super keen to know if anyone else has managed a method that doesn’t have this issue….???
BTW, Thank you everyone over the years of my lurking and browsing this forum for all your help. I’ve pretty much always found answers to my questions and I’ve never needed to post. Thank you all.
----------begin_max5_patcher---------- 2984.3oc0a01aaiiD9yI+JHLNfsEn0Qj589oyMQoMWaRLrc6tAaVrPwhIV6J K4ShtIYWr+2ugjRwR1Tpg1Mo8Rfskkd3vYd3LCGJQ+26uWuqxtiVzC8Fzuh1 au+d+81SbJ9I1q7660ad3cSSBKDv5MMa9bZJq2qjWiQuiIN+Q+hK53koSYwY onIgWkPujA+mdY5c2ghKPrYTzWByi4Wo+koLFJm9eWFmSkW5xdQgrPzKXrWd YODiiBExPWkwXYy6yESkvuj84vjkfzeO8N37hNYXVx8hiXDKCjiKB6f7PNVH CCDwx8xzSyRyTC.KALLlMc1Uzzn2Hk3nvzaDVfwqwj0ZkMBLIQqFynKZAjyC fFlkyB4bV1aVosnWiFQYgwoqqSt3GT5RbGmkjjcqJb3UFGGWLnx4znNjXExk IIr34zNj46RhKJBSixPnKYYWe8ZVm2ChrIvzMwUJvIk8mwq88iVCk+Cb0oYQ KSBE9P+7LJMYyQCe+0zYiUDMeLji57yN3btJeY5f4KRhYKinqN4ZFL3HJZbv 6PuMNrXsleMilyxVNc1iPQb1EEwsaE4s4zP1LzgYorbvcfl+HzGqcQer6VeN NKiom1P1EswrasABDoIzoLQlDQdjzkyuhlKRmfBmNMKOBBNPrLAhqKyjTftO aI51vTFhlxy3DIRzbzCIhXHDxDLDKC3EFdAA4VlvKK3kM7xol0fJ+6B9gmAu cAOh3Lj3H3M9Q7CNqg4xQIPKuN+fx1gjMslIiDWsR7kMRHQQq3hme8zpbyIw ozoYKSEInsbKO60vnVJjORj0d.jPNoB+hPvT.d52yAtTNmfmuceiWgrLjeXZ v+vwwuuA52JaEP0YKYITlX9AixyFGIje1U+wqMs6UqqKh+KQ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yFbZf7wOfGySSLYRvnx6enb2GgWc+jkOlHF4riZAnWSfliZCneSfVhJ CT.rd7FGncq.wMA5zJPRSftsBzrIPuVAZ0Dneq.saBDWWIa.zodAAa9u5M2f Adadd2lVM1fSdt8seErpOOCsdh2NO0Ow6T5sPGswC7tXAkFkDOGVVTucYOJ4 I9vU7NocSGuooispDuDG69ETor606Aon2NpwxGK2qI3u9NpgrMbo3A1uS7ks 3C4lgoC9hnfu7VI9xm17uK27g08s1fKi461ATuqBSuYWoUrySyFU5IxEsZ+U s8tndey8PIdhM6ku6ygCJbo34Kmyuhu+tvfauSq+2Ke1Rh1Q89XDn4Jl4Ieq EcT1Rvde8zj3o+obexTtiU.y9lL9lKdNeijsHKmgdAeWEcxYp2UVlayPHlHG 0jAAXKrbxJclixYK2Jox.Na2m2c2XqzcbJzDEzMX7eC4aIOa5HLXros9zs0+ mVQP418b6y1Z5r8oa28LmsPJk6NyZUYZvqV+.9Nn6eEigCfpM2kJBH3RpxaK XLidckBUKRaa7jlSKJBugtAqs1OQGislijNSVDYxKGYYHd5PQDxOdNU+UB5l 7rkKPaGoPjasVSe4Fs0T+YkIs62vm28GrnMB9aQ3VYsLUga3sYEKNeeC2Zi0 363z3zcxWRNekbcSZRJ3uyjRak7ZtK+nE1gkoY7jWxaspWwOw9V7Zk.ccGJH nrxSK+uBUp5m+w2qJg1LMDF47sHITIkTk7YaB2dZh1DMTT96Z+jtEFA+7Mow hrk4Sq54pRQPqriHZAKNUrjf5fZfYVbTDMs9XeTbg3GSo3bJGOerpC+lK80U GimO8w4GJ5w6QnMqoxOoryOTji4iYrB+7QNOpAKqmM8w+QnNdOaZC4wj2guH .HE9yxn0iwWl7Ll34QkWdaC0kSaDtXwWn4EkxTnJv7r+QVN+qNuZeYIKxuJj Xub5WhqvasOWZ+y9+OrdXv3N -----------end_max5_patcher-----------
I worked on this with a student of mine for one of his projects. There’s not a method that I was able to find that could do it glitch free. Certain parameters you could sort-of get away with, but not most.
BTW, the sysex for the DX7 is very similar to the TX-802.
Thanks Peter for the reply. It’s disappointing as I have the TX816 + DX7 and real time manipulation of this setup is something I’d really like.
I gotta say you guys, I am overwhelmed by the helpfulness.
Pvdn– Thank you for this in depth insight into the DX7 manual; this greatly improves my sysex literacy, and I feel significantly more equipped to handle patch programming in general. I learned about twenty things from your posts.
P.s. – Thank you for confirming my confusion over esoteric values such as 0ggggggg.
Joeman– you gave the entire patch…Wow! I can see how extensible it is. You made quick work of my little project. It’s funny how complicated I thought this would be; a few patches and bam, all the tools you need.
By the way, I have a DX7s, and I have the same glitchiness. I suppose these internal parameters weren’t meant to be manipulated dynamically? It’s a shame.
"I’d really like to be able to edit the DX7 in realtime without the sound glitching at all but my DX7 can’t handle being edited in realtime via sysex without it’s output being interrupted. I’m super keen to know if anyone else has managed a method that doesn’t have this issue….???"
no synth i know is able to keep playing while receiving sysex.
you could say this is the main difference beween parameters which can be controlled by continuous controlles and such which can only be edited by sysex.
sysex in that way is more similar to sending the device a new patch which overwrites the old one than using CCs.
p.s.: so if using a knob controller, you might want to use something like [thresh 250] in max to reduce the sysex commands.
As Peter pointed it out, I had made some sysex templates for the oberheim matrix 1000 to control it back in the atari days, and I made it again with my Novation x station controller. In both cases, there was no way you could use it live as a modulation source without glitches. Still useful to edit the matrix though, because that was the only solution for this preset beast.
I generally view sysex edit messages as the manufacturer saying "in no way do we want you to edit this while you play–why else would we make it such a pain to edit?…" Shame, but it’s one of those functionalities that the commercial market has little use for, but anyone who pokes around further really wants.
The good news: you could just build the DX-7 in MSP…
Is the MSP DX7 virtually the same, or does it vary in any way, other than the DAC stuff?
Not saying I have, but you definitely could. I would probably not build it the same because there’s some things about the DX7 that are absolutely a pain to deal with. For example, its envelopes use a rate mapping so that you can have very long envelopes as well as very short ones (and only with 100 values!), but that doesn’t really make sense when you can supply actual time values in Max. (Here’s where live.dial’s exponential mapping is really useful…)
Also, the breakpoint mapping (that weird X diagram on the front panel) is confusing as hell to most users, it seems…
I’d highly recommend using a higher sampling rate (88.2 kHz) if you wanted to reimplement it, since this will reduce aliasing, esp. on higher notes.
Thank you Peter. Very interesting. I’ll have to look into this.
@Roman: The elektron machinedrum can take SysEx without glitching.. an example is manipulating the tempo over the factory limits of 2x – 300 bpm. :)
@pvdn the integer boxes can also be used as a decimal binary … converter.. they are very handy!
----------begin_max5_patcher---------- 424.3oc0VEsSCBCE8Y3qfzmwkBxXpuoQS7SvDiYo.2s0EnkT5V1bY+6RKfvV bNRMyvdojd5kSO2SubK6rsPQ7MPAx4Am2crr1YaYogT.V0ysPYjMwojBcXnX dVFvjH2p0jvFoF+YHllQRavyIx3ET17oBHVVwe33QXWGOr9w3.0nOdD14i5W YFmIKneBpn87KWtBlln4mGs7FeuF5YqxnrTPp0jWKHekrAE2gVFISSK5QAsU iyDyizQNBq.1aaqFb6oQTtaQf3WxWuCxWrI4qeK8hxTPBho.iDkBcSvd3E90 nUPxs4PkDQT0IoCJhvliNPXG4XF3OmpP40Wd6rEISLuFwCOfpQNkG7DkQDaO qMDXtMb+UfKz6VFlaC2c80vXh48KBGJsK9dEQFQmbdWN+Jvb+JXv5W2dAuP5 Obez.75HcXnTJ63eiQa.J7CsrB9JQby9U+QiSqIj.ExxlyRJm0IF0EwcBZAM IAXcS5DZgxGzV0O2anuxInGxI7eSM98PMAFplpSNRd9ZPTTSoVHkk0K4B0zP W8TJqZplQj.VSahehshs81eAxU6dhC -----------end_max5_patcher-----------
Regarding the SysEx 7 bit part. I’m very puzzled by this. I’m building a MachineDrum SysEx editor, and have quite a bit of trouble figuring out why some SysEx data sets are packed in a weird way.. something about the most significant bit is sent in a 1 byte package before the next 7 bytes of the rest of the information.. I’m very much struck of confusion – and are pretty sure i’m mixing terms up.
There is a (old) thread about it here – but I don’t seem to understand. If any of you SysEx / MiDi gurus have they time, I would very much appricitate a pointer.. i’ve tried to search around for an explanation, but I don’t really know what to search for :)
All the best,
thanks pvdn for your breakdown of sysex info! i am currently writing a blofeld midi editor, my first project, and your post has been very helpful
I have found the information in this thread really useful. I was wondering if anyone has found a way to format sysex info to write voices to the original DX7, not just individual parameters like Joeman’s contribution ((My limited understanding)There may me a way not highlighted in bold for me)). Where I am falling short is the ability format the sxformat object to write full voices to the DX7. In the patch I have included, an adaptation of Joeman’s example patch, I can edit the algorithm and output level of each operator. The problem I have is when I store the voice the changes are not recognized.
In my example patch, the algorithm changes the value on the lcd of the DX7. When I go to change the output level of the operators it changes the values of the output in terms of the audio but the values are not changed on the LCD. This is only what I have observed and may not be the root of my quandary.
Thank you for anyone that has had the time to look at this.
----------begin_max5_patcher---------- 1002.3oc6Z1rbZCCDG+L7TnwSOzNCgZIaKa2a4InW5sNYxXvJAkweMxhDZyj 28pOrSbRKvBAbaMbAhDxx69W69yRa7iiG4LqbEq1A8Ez2QiF833QiLco6XTS 6QN4IqlmkTaFly7x7bVgzYh82jrURS+eaAuF8.OKCMeQRwsLjbACUtTVsThx X2yxPk2f9ZESjHKEHZ60mwKXyKWVXlDRSmUIx4K3E2dsfMWZMN+n3ot333fn IHbTzTW0WAt5u77l5htp4J4oFiob1cW340dOtorPVjjyL+zkBdRV6uTrLmWj wjFWC2Nbwsyzs0y9KSPM+mlI.Sdta0Uqbv1K2U24SiGq+XBPwrf8fxT+Msrt hwRy34n.WGXRBgFp0hv.8mD20nH96nhP1E+uU9rcI+QEyZlNNnq1GoYY9Ll. p6SvZG2FPrV2Onc1TtHOeYtYUaqJRUhP0ujItlUjLKi08pTVb6DEGuwXJHJH YcJHWmugbloxq1SwbMwYqtoTjmHQDeWDMDgoHWU9D5yHUt7G3X0eP7CgtFDG ZU+nMtHDtuYkuqXPsBtWJ2gA2Erq3NhO0f3.Q5H9CbRWiZ.BxQBFRPtVOGBe iPOy2fv2Bgy2ZkePnMxIIZyeWQawZLVyyLBfP2bG3zstBRjO.BGdHQ3558dQ .nbjyTN.TtfH3TttKAXrODTm2oHpyaWQcgX2cB0gCF3nttBBDTGNbHg5558P Pc3nynN.ntvX3nttKAvPc33SQTG48TeNHntvSnhyAhzgGp0l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