User Forum    :: Powered by YaBB
  « MIDI-OX User Forum - Translate MSB-LSB-PC to MSB-LSB-PC »
Welcome, Guest. Please Login or Register.
May 3rd, 2025, 4:09am


Home Home Help Help Search Search Members Members Login Login Register Register


   MIDI-OX User Forum
   MIDI-OX
   Mapping Questions
(Moderator: Jamie OConnell)
   Translate MSB-LSB-PC to MSB-LSB-PC
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: Translate MSB-LSB-PC to MSB-LSB-PC  (Read 2525 times)
thorr
New Member
*



MIDI-OX Rules!

   


Posts: 3
Translate MSB-LSB-PC to MSB-LSB-PC
« on: Jan 27th, 2020, 12:07am »
Quote Quote Modify Modify

Hello,
 
I am confused by how to do this.  Do I need to create files, use the gui, etc.?  Could someone provide step by step instructions on how to do the following?
 
- Look for instrument changes with MSB, LSB and PC and translate it to a different MSB, LSB and PC.
 
- Look for General Midi instrument changes and map to MSB, LSB and PC.  Is this the same as the above, but it is missing the incoming MSB and LSB control changes?
 
Do I need to use LoopBe1 or Midi Yoke?  I have a Roland Fantom and I want to use it with vArranger and also play General Midi files.  Both are using programs on my PC and sending MIDI to the Fantom.  With vArranger, I can play Yamaha Genos and other vendor music styles and the instruments are all different than the Fantom.  I want to detect the incoming program changes and convert them to Fantom instruments.  I can do this in vArranger, but I can only change one style at a time and then save it.  I want them all to just work using a translation/mapping.  
 
Thanks for your help!
Mike
IP Logged
Breath
Administrator
*****





   
WWW

Gender: male
Posts: 1030
Re: Translate MSB-LSB-PC to MSB-LSB-PC
« Reply #1 on: Jan 27th, 2020, 9:59pm »
Quote Quote Modify Modify

Hi
"MSB + LSB" sounds like you are talking about a bank change message for different banks of patches.
There are 128 patch spaces (0 to 127) in each bank.
When you send a Patch Change (PC) message it always refers to the patch in the current bank.
Changing the Bank does nothing audible. You have to do a PC to select from the new bank.
 
So as well as a PC message, you need to send a bank change message.  
This is two Continuous Controller (CC) messages with the data holding the MSB and LSB
CCchan, 0, MSB
CCchan, 32, LSB
 
So to change to GM (channel 1) on my Motif XS is  and select a patch...
B0 00 00
B0 20 00 selects the GM bank (20 is the hexadecimal for 32)
PC 00 selects the piano
 
On the Motif XS the preset banks are in MSB= 64 (3F) and the LSB = 0 to 10 (8,9,10 are the User RAM presets)
You can treat the MSB as a Bank Group and once the group has been selected you can just use the LSB
So..
B0 00 3F selects the Preset bank group
B0 20 00 selects the "PRE 1" bank
PC 0 selects the "Full Concert Grand" from ROM bank PRE1  
 
B0 20 00 selects the "PRE 2" bank
PC 0 selects the "Roundabout" from ROM bank PRE2
 
Unfortunately the Datamap section of MidiOx only handles single Midi message conversion and as you can see, the Bank change needs one or two messages.
So to change a patch from one bank to a patch in another bank generally needs to recognize 3 messages coming in.
No really doable in the Datamap (you can do multiple  message NRPN but not bank change)
 
You could probably do this with the MidiOx scripting or perhaps with Bome's Midi Translator Classic
https://www.bome.com/products/mtclassic  
 
All the best
Royce
IP Logged
thorr
New Member
*



MIDI-OX Rules!

   


Posts: 3
Re: Translate MSB-LSB-PC to MSB-LSB-PC
« Reply #2 on: Jan 27th, 2020, 10:21pm »
Quote Quote Modify Modify

Royce, thank you.  You are correct in what I am trying to accomplish.  The strings you provided are a step in the right direction.  If I understand correctly, I need to look for:
 
B0 00 (MSB value in hex) B0 20 (LSB value in hex) (Whatever PC is in Hex) (PC value in hex)
 
So I would need to know what the hex command for PC is, and then I could script something like this:
 
capture and send midi data until seeing a B0 or a PC and then collect the next few bites until it is determined if it is relevant;
if midi_string = B0 00 ?? B0 20 ?? PC ?? then
  {
  if midi_string = B0 00 00 B0 20 00 PC 00 then new_string = B0 00 50 B0 20 30 PC 80;
  if midi_string = B0 00 00 B0 20 00 PC 01 then new_string = B0 00 50 B0 20 30 PC 89;
  }
send new_string instead of midi_string;
 
Probably instead I would actually break it up into a section for the bank switching and then handle the PC separately and keep track of the bank it is using in case only PC's came in.
 
From what I saw of Midi Translator Classic, it might be easier to do there.  I tried this already but quickly got lost.  I was hoping that this was already done by somebody and I wouldn't reinvent the wheel.  
 
I haven't looked into MidiOx scripting yet.  Hopefully there is good documentation for it or I can figure out Bome's program.  I remember seeing posts about using .ocx files or something similar and was thinking that might be a way to do this, but I don't know.
 
Thanks again for your help!
Mike
IP Logged
Breath
Administrator
*****





   
WWW

Gender: male
Posts: 1030
Re: Translate MSB-LSB-PC to MSB-LSB-PC
« Reply #3 on: Jan 28th, 2020, 9:03pm »
Quote Quote Modify Modify

Hi Mike,
 
PC in hex is Cx where x is the channel. C9 10 to change the drum kit - PC on channel 10 (often drums) to Kit 11 - whatever that is
 
Grab the Midi Spec (and join the Midi Association - free)https://www.midi.org/ for all the definitions of the Midi messages.
The Midi spec https://www.midi.org/specifications-old/item/the-midi-1-0-specification
 
I nicked this from another great source http://www.somascape.org/midi/tech/spec.html
 
"Bank Select
 
Controller numbers 0 (MSB) and 32 (LSB) are used for Bank selection.
 
The concept of instrument banks was introduced to get around the 128 voice limit of the Program Change message. The bank number is a 14-bit value, hence 16384 different banks are theoretically possible. The Program Change message gives access to up to 128 voices, from within the currently selected bank. There is, however, no requirement for a bank to contain the full set of 128 voices.
 
The Bank Select message should be transmitted as a pair, and then followed by a Program Change message :
Hex Binary Description
Bn , 00 , msb 1011nnnn , 00000000 , 0vvvvvvv Bank Select, MSB
Bn , 20 , lsb 1011nnnn , 00100000 , 0vvvvvvv Bank Select, LSB
Cn , pc 1100nnnn , 0ppppppp Program Change
 
The 14-bit Bank Select value gives access to 16,384 banks using the formula :
(MSB * 128 ) + LSB + 1
"
E.g. :
MSB LSB Bank number
00 00 1
00 7F 128
01 00 129
7F 7F 16,384

 
The trouble with  
" if midi_string = B0 00 00 B0 20 00 PC 00 then new_string = B0 00 50 B0 20 30 PC 80; "
is the midi messages don't necessarily come as a block eg
B0 00 00  
90 45 23
B0 20 00  
FA
C0 00
 
You need to catch the Bank MSB and LSB and if it is the correct combination then change then bank output otherwise just output the incoming bank change.
(pseudo C code)
 
if (B0 00 x)  MSB = x; //any MSB
if (B0 20 y) {
    LSB = y; //any LSB
 
    if (MSB= 00 and LSB = 00 ) {
     MSB = 50;
     LSB = 30;
     CorrectBank= true;
   }
   else  CorrectBank= false;
 
   MidiOut B0 00 MSB B0 20 LSB ;  
} //the bank has changed
 
if (CorrectBank and C0 00 ) then MidiOut C0 7E  // only the status bytes - eg CC or PC or Note on etc -  are 80 or above. 7F = 127 = last patch in current bank
if (CorrectBank and C0 01 ) then MidiOut C0 7F    
 
 
 
Hope this helps
Royce
IP Logged
thorr
New Member
*



MIDI-OX Rules!

   


Posts: 3
Re: Translate MSB-LSB-PC to MSB-LSB-PC
« Reply #4 on: Jan 29th, 2020, 1:23am »
Quote Quote Modify Modify

Thank you Royce.  This looks like it will be a big project.  I was hoping it would be easier.  In the meantime, I ordered a Ketron SD1000 that I am hoping will just mostly solve my problem.  vArranger2 works well with the SD1000 out of the box, and I already created a .ins file for my Fantom using the same information in your post ((MSB*LSB) + LSB) and I am in the process of making multiple .ins file grouped by type like piano, organ, etc. because there are so many instruments and they are hard to find throughout the banks.  When I use vArranger with the SD1000, I will see how the style sounds and then supplement it / replace it with specific Fantom voices.  I have been talking to the author of vArranger and hopefully he will add the mapping feature directly so I don't have to code it myself.  I would envision maps for each type of style (Genos -> Fantom, Korg -> Fantom, etc.)  I have learned a lot about MIDI lately and the additional information and links you provided are great to enhance that learning even further.  Thanks again!
 
Mike
IP Logged
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »


MIDI-OX User Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.