SysEx Tutorial for the MPC4000 / Z4/ Z8

Mar 24, 2008

I decided to dive in and figure out the system exclusive implementation to see if it could be used to get past some of the MPC's control limitations. It seems pretty clear that the documentation was developed for the Z samplers as most sampling functions are in there, but nothing for sequencing. You can tell that they must have programmed Ak.sys using these commands. It is too bad they didn't add in other features to ak.sys that were available, like FX. Figure that with a good sysex capable MIDI controller, you can make a hardware version of ak.sys to some extent.

Looking at the command set, there are quite a few parameters that are not possible to change via the sequencer with standard built in controls, modulations, or midi parameters. Without sysex, you would have to change those parameters with the screen and dial manually, which is rarely the best option.

After looking through the parameters, there are some pretty cool things that can be controlled:

  • Sample loop start/end point
  • glitchy effects
  • synth sync effect on cyclic samples
  • change the sound of held notes
  • move loop points of a drum loop around
  • Filter type change
  • Every Envelope and LFO parameter
  • Modulate modulations
  • Change parameters for ALL keygroups in a program at once
  • FX type, routing, and all parameters
  • Use hidden parameters
  • Dynamically change almost any other keygroup, program, or multi parameter that does not have built in modulation.

The 4k’s sequencer could have easily implemented more sysex control. Like q-link to sysex just like it can control MIDI CC. Also, continuous control inserts like they do for MIDI CCs in step edit. Since these features do not exist, you have to either enter the codes in manually through single step edit inserts, or use an external device/program for realtime control and sequencing.

One thing I learned after a lot of pain while trying to control sysex externally... you need to change your MIDI routing for the MIDI in to the SAMPLER, not SEQUENCER (default setting). If you are sending commands from an external device to the MPC to record in the sequencer, you will need to switch the routing back to SEQUENCER. Also, when playing back commands from the MPC's sequencer, be sure the track is set to INTA or INTB. Sending internally to a program does nothing.

To first start messing with sysex, you will want to find software that is able to send and receive sysex commands easily. MIDI-OX is a free program that does this well. It will allow you to test out commands, and receive information messages back using the SysEx View. Once you know something works, you can then assign it to a controller or drop it into the sequencer.

I recommend using midi in II for sysex so you can still run other midi stuff through midi in I. Remember to change the MIDI routing for that channel, but leave MIDI in I set to SEQUENCE so your MIDI keyboard (or other gear) still works properly. If you want to receive the confirmation messages back, you need to also run from MIDI out B back to the computer. Make sure your software does not route the MIDI in to the MIDI out on the MIDI interface or you will get a nasty loop. I found MIDI-OX was set up that way by default and needed to make a change in the routing window. Another problem I ran into is that sometimes MIDI-OX needed to be restarted to work properly. When I could not figure out what was wrong, I found that replugging the MIDI interface and restarting the program magically made things work.

The Basics

You can read the document to learn all this, but I'm going to sum up what I've learned and what works the best. Keep in mind that all sysex data is in hex. So if you see a parameter that is "10" it is not the decimal ten, but actually sixteen. You need to understand hex for this to make sense, but you can use a calculator/converter to help out. MIDI-OX has a built in calc that does this for 7 and 14 bit values. You also will need to read the data formats (table 5) to know how to format data parameters. Don’t forget that each data byte can only use 7 bits so you can only use values between 00 and 7F (0 and 127). Although the document might seem a bit cryptic, there is important info plus all the commands, so you’ll have to be willing to do some reading, or at least understand how the commands work.

All 4k sysex messages start with "F0 47 5F 00" followed by the command section, command item, data, and end with "F7". The doc explains these numbers if you need to know more. The 00 tells the command to be sent to any MPC/Z. If you happen to have more than one of these machines in the chain, you would need to read up on device IDs and change accordingly. Most people are just using one, so using 00 is the easiest way to go.

The rest of the sysex string consists of a number for the command section, the command item, and data. The document has all of the commands listed neatly in order. Section 00 is for sysex related commands. Command 00 in this section simply queries the device to see if it is there. There is no data for this command, so your final string is: “F0 47 5F 00 00 00 F7”. This is a good starting command, as it will determine if you have things set up properly. If everything is ok, you will get a reply message back. It seems that getting to that point is one of the hardest parts of the battle. Once you have this working, you are ready to dive in.

Reply messages aren’t needed for setting values, so you don’t have to worry about them when you are simply controlling parameters or sequencing. They do help a lot when you are learning commands to see how they work and the data that is returned. When you can’t get something to work, you should get an error code that will help you debug what you did wrong.

First Messages and Testing

The first command I typically run each time is to turn off OK messages; “F0 47 5F 00 00 01 00 F7”. If you already know sysex is working, it is not needed to get an OK message every time you send a command since you should get another reply message anyway. I figure it is just wasting MIDI bandwidth, and that is a concern when you are spewing out a bunch of sysex commands from a knob turn. Reply messages will still be sent regardless of this setting.

While testing sysex out, the system main (04) and system parameters (06, 07) sections are a good place to start. They do simple things like; check sampler model, clear memory, set master level, get clock, etc. Setting some of these basic parameters is pretty straightforward and you will see the related parameter change on the screen if you are doing things right. Most of these are unnecessary to actually use, since they are simple to change through the MPC’s menus, and you probably don’t need to change the MPC’s clock for daylight savings in the middle of your hot beats.

Lets say you have a live set, and at a certain sequence, you want the MPC’s global pad assignment to change to chromatic. In the document, this setting is controlled by item 50 in section 06 and the value 01 is for chromatic. Your string is “F0 47 5F 00 06 50 01 F7”. Putting that into the beginning of the sequence would make the change for you. Sending this to the MPC while you are on the pad assign page will allow you to see the parameter to switch live. (If you want to try this, make sure the current sequencer track is not set to a drum program.)

Synchronization and Selecting Items to Edit

One of the issues with the sysex implementation is that when you are working with multis, programs, keygroups and samples, you first need to select that specific item before you can modify it. This requires a message to select the item, then any following control messages will modify the last selected item. For quickly testing something, you can simply select that item on the 4k's screen to make it active. This requires the synchronization sysex parameter to be on (it is by default). In sequencing or controlling multiple items, the screen method will not work, so you need to be sure to add in the selection command. The sysex synchronization option could cause problems in that instance if you are changing screens, in which case you can disable it; “F0 47 5F 00 00 03 00 F7”.

You can select an item by handle or by name. Since there would be no way for us to know what the handles are without running code, selecting by name makes the most sense. This requires some work since you need to convert the item’s ASCII name to hex. The exception to this rule is keygroups, they are simply selected by number.

Lets say we want change a sample’s loop end point. We first have to make that sample active. 1C, 04 is the command to select by name. If our sample’s name was LOOP, we convert that to an ASCII hex string. This site shows the codes: http://www.ascii.cl/ and we find our string is “4C 4F 4F 50 00”. Don’t forget that all strings end with 00. Our final sysex command is “F0 47 5F 00 1C 04 4C 4F 4F 50 00 F7”. Then sending “F0475F001E3100000800000000000000F7” changes the loop end point to 1024. If you were using syncronization, you could have just brought up LOOP on the sample page first, then sent the end point command.

If you had several items you wanted to modify, it might make it easier to give them all the same name and have a number at the end (LOOP001, LOOP002, etc) so the ASCII code is easy to modify. This would also allow a sysex MIDI controller to assign a knob to item selection. There is also a method for modifying programs and keygroups without selecting a specific program first. This is done with Program Automations, which is explained at the end of the document. It is a bit more confusing, but would allow you to change a programs parameter by referencing the part the program is assigned to inside the same message.

Odd SysEx Notes in the Documentation

There are quite a few parameters in the documentation that are mysterious (or I haven’t figured them out). Most likely they were planned features for future OS releases that never made it, as I am not able to do anything with them.

EQ per multi. 3 band EQ with adjustable frequencies. Would have been nice. I wonder if there wasn’t enough power or if they were just lazy.

Mouse for external display. This means the concept of an MV style external screen was an idea they were considering. Not sure where the video adapter would have connected to the mainboard for that.

FX could have multiple modules (like the 5000). It shows each FX channel having up to 4 FX chained together. The FX are also setup very open ended as if the machine’s OS doesn’t need to be aware of the FX names and parameters. It seems to suggest that it would be possible to have other manufacturers make different FX boards and that it would work without changing the MPC’s code.

Multiple loops per sample to set and play back. All loop related commands refer to a loop index. Supposedly you can set 128 different loops within a sample and then choose which one you want to play (kind of like with regions). This is only referenced in the sample parameters, so it must be assumed that loop index 0 is always used in a program.

Example

I did a quick recording to show examples of what all this can accomplish. One of the features that I really wanted control over was a sample’s loop points. Assigning sysex commands for loop start and end to MIDI faders had some very interesting results when tweaking live. In these sample clips, I am playing with these settings as well as others such as tune, filter, lfo, and fx.

Trim Sample Example
This is just a single sample with a loop point. At first I bang on the pads while adjusting the loop points. Then I simply hold the note and go ape on the knobs. It isn’t supposed to sound pretty, just insane.

Trim Loop Regions Example
Here is a basic amen loop chopped into 8 regions and sequenced as is. This time, I have 8 buttons assigned to select each of the samples. After hitting the button, that sample can be edited individually from the others. The sequence sounds quite different after a bit of tweaking and shows great potential for live glitch-type effects.

Q-link Trick and Commands

The Z engine allows for 8 q-links. The MPC4000 only has 6 physical controls. The ability is still there as you can see EXT 7 & 8 in the modulation sources, but the OS does not allow you to program them. As it turns out, you CAN set up those extra Q-links! The way to do this involves setting the parameters through sysex, assigning it to a MIDI CC, then you can control it from a MIDI controller set to that CC number. The downside is that there are no sysex parameters for Q-link’s send page (features that were added in OS v1.3). That means you cannot assign it to a MIDI CC (which is pointless in this application) or pad control. Still, it is 2 extra program modulations or FX controls. You can also use the sysex commands to change the Q-link controls without needing to switch multis.

So lets say we want Q-link 8 to control amplitude on part 1.
F0 47 5F 00 1A 51 07 01 00 F7 – set q-link 8 to part 1
F0 47 5F 00 1A 52 07 01 00 F7 – set q-link 8 to amplitude
F0 47 5F 00 1A 53 07 00 F7 – set q-link 8 to replace
F0 47 5F 00 1A 54 07 00 00 F7 – set q-link 8 minimum to 0
F0 47 5F 00 1A 56 07 25 00 F7 - set q-link 8 MIDI CC to 24

With a MIDI controller knob set to MIDI CC 24, you can now control and record automations for that value. Here are the q-link sysex strings. Q = q-link 1-8 (0-7). SS = sign. XX = enter desired value.

Set Assign type, PART=0/FX=1
F0475F001A50QQXXF7

Set Target Part/FX, part 0=all, 1-128; fx 0-3
F0475F001A51QQXX00F7

Set Destination 0=Off,1=amp,2=pan,3=pitch,4=lfo1 rate...14=cutoff,15=res…
F0475F001A52QQXX00F7

Change type 1=offset 0=replace
F0475F001A53QQXXF7

Set Scale Minimum
F0475F001A54QQSSXXF7

Set Scale Maximum
F0475F001A55QQSSXXF7

Set MIDI CC, X = CC + 1, 0 for none
F0475F001A56QQXX00F7

Set MIDI Channel output (FX only)
F0475F001A57QQXXF7

Article originally posted at mpc-forums. Check out the link for related discussion.