Preset change by Midi

Official support for: u-he.com
RELATED
PRODUCTS

Post

bmrzycki wrote:There are 3 variables in question:
1. bank number MSB, CC# 0
2. bank number LSB, CC# 0x20
3. program change, midi message 0xC0
I think that the LSB is quite academic. 128 banks are enuff as of today IMHO, so I've only implemented CC# 0 for this. This keeps CC# 32 free for XY Controls and stuff :)

Post

peoplethought wrote:So much trouble for such a simple task. But I appreciate your help. How do I convert the zz into a number? This is called a byte isn't it?
You shouldn't have to worry about converting a number into a byte. I'm assuming MAX/MSP has low level midi converters (I've never programmed in it however). As Urs said, he doesn't even use LSB so it's even easier. Just send CC #0 to select on of 128 banks (0-127) and then select a preset within that bank by sending program change with 0-127.

Your best bet is to just place the presets you want in the MIDI folder, then rename them so they'll always be ordered the way you expect. For example suppose you had these 4 presets:

lead.h2p, pad.h2p, bass.h2p, fx.h2p

Next, rename them:
01 bass.h2p, 02 lead.h2p, 03 pad.h2p, 04 fx.h2p

Finally, move these renamed presets to the "MIDI Programs" directory at the root of the preset browser.

Now, to load the pad, send the midi sequence

Code: Select all

b0 00 00 # bank 1 (midi starts counting from zero like C does)
c0 03 00 # preset 4
If all goes well you should have fx.h2p loaded.

If you're in doubt try to install a midi logger or have your host capture all midi signals and then send bank changes from a midi keyboard. It'll show you the bytestream (and verify it's working for Zebra).

I'm sorry you're having so much trouble with this, I admit it's non-trivial. It would have been nice if program change took both the bank and the patch (there's space in the message for it; I don't know why they didn't do that).

Post

Urs wrote:
bmrzycki wrote:There are 3 variables in question:
1. bank number MSB, CC# 0
2. bank number LSB, CC# 0x20
3. program change, midi message 0xC0
I think that the LSB is quite academic. 128 banks are enough as of today IMHO, so I've only implemented CC# 0 for this. This keeps CC# 32 free for XY Controls and stuff :)
Interesting. I implemented it this way mostly because I really wanted to understand how it worked myself. :oops: I have to admit it was difficult finding this info, it really only seems to be used by huge hardware synths from people like Korg where they have 3-400 preset banks.

Post

bmrzycki wrote:I'm sorry you're having so much trouble with this, I admit it's non-trivial. It would have been nice if program change took both the bank and the patch (there's space in the message for it; I don't know why they didn't do that).
Wow...that's great work bmrzycki. It somehow brings back memories of my Commodore64 days. 8)

Post

CC0 wasn't working because I was using an older version.

You used this as an example for preset 27:

b0 00 00
b0 20 04
c0 1b 00

How does 1b = 27? I get that 1 = 2, but why is b = 7?

Post

peoplethought wrote:CC0 wasn't working because I was using an older version.

You used this as an example for preset 27:

b0 00 00
b0 20 04
c0 1b 00

How does 1b = 27? I get that 1 = 2, but why is b = 7?
That's because 1b is in hexadecimal, the standard notation for byte streams. I apologize for not mentioning that before.

Hexadecimal is used by programmers as a shorthand for binary; it's very easy to convert a single hexadecimal digit into 4 binary digits. to count you use 0-9 but at 10 you use A all the way to 15 which is F. B in hex is 11 in decimal.

Numbers in hex are usually prefixed by "0x" to note it's different from decimal. 0x11 is completely different from 11(decimal). I didn't use that above in the code dumps because it's standard practice for byte streams to be hex. Here's a Wikipedia article if you're so inclined to learn more.

Google can convert hex for you, here is 0x1b in decimal.

The good news you should be able to put "27" into your program bank changer MAX/MSP generator and it'll do all this for you. I was just showing the raw byte stream to you how it would look if you used a MIDI logger to capture the output stream to Zebra or on a midi bus.

Post

Well I can't even figure out how to send this kind of message to it anyway, so I don't think I'll be doing it this way. It's really difficult to find information for max sometimes and the forums are so slow. Thanks for being so detailed in your help.

Post

I don't really know Max/MSP but I did see a few modules that might lead you where you want to go:
http://www.cycling74.com/docs/max5/refp ... ormat.html
http://www.cycling74.com/docs/max5/refp ... diout.html

Hopefully the first one can do what you want. Sorry you're not getting the support on the Max forums and I wish you luck. :)

Post

bmrzycki wrote: There are 3 variables in question:
1. bank number MSB, CC# 0
2. bank number LSB, CC# 0x20
3. program change, midi message 0xC0

It seems a lot of programs/synths/hw respond to them differently but the general consensus seems to be to send them in the following order:

Code: Select all

bn 00 xx
bn 20 yy
cn zz 00
I don't think this is technically correct. MIDI Program Change Cn only has one parameter byte not two. so it should really look like this. The 00 probably doesn't hurt anything, but it's superfluous.

Code: Select all

bn 00 xx
bn 20 yy
cn zz

Post

grantb5 wrote:The 00 probably doesn't hurt anything, but it's superfluous.
Actually, you're right. It might hurt though if the synth has Running Status implemented.

In the MIDI specs the first byte only has to be sent once if two or more successive messages are of the same kind on the same channel. So sending a 0 after a program change may result in yet another program change...

Post

Urs wrote:
grantb5 wrote:The 00 probably doesn't hurt anything, but it's superfluous.
Actually, you're right. It might hurt though if the synth has Running Status implemented.

In the MIDI specs the first byte only has to be sent once if two or more successive messages are of the same kind on the same channel. So sending a 0 after a program change may result in yet another program change...
Interesting. When I implemented in Reaper I used their Jesusonic scripting interface so I don't have a choice on how to send midi. I would assume it looks at the msg1 byte and determines the length of the message to send. I have to send all three parameters msg1, msg2, msg3 so I've zeroed out the other field.

With that said, all the loggers I've used showed the trailing zeros. It could be they too show the extra byte of zeros. It could be a limitation of the loggers.

I haven't had any problems using my PC code with several different synths, but that doesn't mean it couldn't break for a given implementation.

Thanks for filling me in. If I see erratic behavior with some device I'll definitely look into this more.

Post

Running a number through midiformats program change inlet just adds 192 to it, which I was just doing manually before. Zebra just doesn't respond to it.


...OK. It is just randomly working now. I don't know what I was doing wrong, but it works now.

Post

peoplethought wrote:Running a number through midiformats program change inlet just adds 192 to it, which I was just doing manually before. Zebra just doesn't respond to it.
Could it be that MAX's VST hosting module catches any MIDI Program Changes to switch between VST Programs? - In that case, well it won't work because the actual MIDI Program Change never reaches Zebra.

Please try Zebra 2.5b6. It has a MIDI indicator LED in its user interface. If the MIDI indicator LED doesn't flash upon a MIDI Program Change then it's not Zebra's fault:

http://www.kvraudio.com/forum/viewtopic.php?t=262885

;) Urs

Post

peoplethought wrote:...OK. It is just randomly working now. I don't know what I was doing wrong, but it works now.
Hmmm... in that case disregard my previous post...

Post

Unfortunately it has also crashed twice since I've been using it. This can be be expected when using max though.

Post Reply

Return to “u-he”