fbpx
Skip to main content

MIDI Forum

Bank messages "pre ...
 
Notifications
Clear all

Bank messages "pre cognition"

18 Posts
2 Users
0 Reactions
10.2 K Views
Jonas
Posts: 207
Reputable Member
Topic starter
 

http://www.studio4all.de/htmle/main91.html

A. Selection of an instrument or a drum kit
(After sending Bank Select MSB and/or LSB you always have to send a Program Change Message)

I do not really get this how would this be accomplished if you do not have an instrument file loaded, what happen if you send an instrument out of range?

 
Posted : 29/06/2021 5:41 pm
Jason
Posts: 438
Honorable Member
 

From my experience (software only, no hardware) if you select a bank/instrument combo that does not exist (but is in the 0-127 range), the software will default to bank 0 of the same instrument on playback. I believe that may be part of the midi spec that synths should behave this way, but don't quote me on that.

My instrument changer I am writing now has working bank changes as well, and if I change anything to a non-existing one, it plays back the default from bank 0 (0 msb if GM or GS, bank 0 lsb if XG)

 
Posted : 29/06/2021 6:09 pm
Jonas
Posts: 207
Reputable Member
Topic starter
 

I must say i find it strange that one can not send a bankchange and it defaults to the first preset in the bank. It really does not seem thought thru.
Without that the programmer must keep track of which presets actually hold in the bank.

 
Posted : 30/06/2021 2:51 am
Jonas
Posts: 207
Reputable Member
Topic starter
 

I try to make a webmidiapi XG synth to change bank, but i have not quite figured out the message format.
I have only implemented banks for my Korg N364 and it was no problem since every bank has a preset zero although an overlay mode message that must be sent combi or program. Now for yamaha XG and roland SC i will have to read out startpreset of bank before change.

That program / preset and bank changer you work on what language is it?
Will it be general for most / any synth?
Will one have to select synth from a dropdown or can you somehow ask the device to send modelID and decide message using a lookup table?

I really could have use for it, log its output port via a virtual midicable just saying....

 
Posted : 30/06/2021 3:50 am
Jason
Posts: 438
Honorable Member
 

I am using Game Maker Studio, which uses a C-like language, to make MIDI-MIS (MIDI Musical Instrument Switcher). It is for Windows only currently, but with some modification (after it is done) I may be able to get it to run on MacOS and Ubuntu, but I haven't looked in to doing that yet.

It works on pre-existing MIDI files by letting you load them and then easily modify any instrument by name/number and bank. It works for GM, Roland GS, and Yamaha XG files. I've just finally gotten bank and program change inserts to work properly (if the file does not have either, I can add them and save without destroying the file :p )

I can reply later with more info about Yamaha bank selection to help you out. I found many great resources for all midi formats while working on this project.

Essentially, you need
Bank Select MSB
Bank Select LSB
Program Change
(more info for this later)

You can do the bank select at any point in the file before the program change. It does not have to be immediately before it. This is why it works the way it does. So you could bank select to prepare for the next section, let your current notes finish playing, then program change to activate the new bank.

Note that any bank select will change the bank for ALL program changes in the same track that follow it. So if you have two instruments on one track, and only want to change the bank for one, you will have to change the bank back to the original bank for the other instrument if it plays after the instrument you do want to change. This is especially important in MIDI type 0 files where all data is in one track, but also applies to more complex type 1 or 2 files.

 
Posted : 30/06/2021 5:10 am
Jonas
Posts: 207
Reputable Member
Topic starter
 

It sounds like a worthwhile project, i hope you make a video or demo version, so i can watch it.
My project is just a hobby project, and i find the midifile format disturbingly complex....
So i walked away from in favour for a textformat in my sequenser, but i still need to be able to manipulate things like synths and mixers via midimessages during playup and recording.

I also built a simple editor, and think what you talk about "listing the messages" on a track/channel and able to change one or all sounds like a nice feature.
If your editor comes with a player a "prechange playup" would be nice.

Right now i have to select CC/PRG/BANK via a dropdown list in editor for a track and they will be filtered out, but i probably will filter them out separately on the track because it sounds like a neat feature.

Well good luck with your midi project i look forward to see it in action.

JT

PS just want to show you how easy things are to change using Javascript, and maybe drag you in to some javascript programming 😉

function setVol(){
console.log("setVol()");
CCchan=176+trackMidiCh-1;
CCtype=7;
CCvol=document.getElementById("volID").value;
if (SF2PLAY==false){
settingChange=[CCchan,CCtype,CCvol];
outportarr[outportindex].send(settingChange);
} else if (SF2PLAY==true){
synth.NoteOn(CCchan,CCtype,CCvol);
}
}

function setPan(){
console.log("setPan()");
CCchan=176+trackMidiCh-1;
CCtype=10;
CCpan=document.getElementById("panID").value;
if (SF2PLAY==false){
settingChange=[CCchan,CCtype,CCpan];
outportarr[outportindex].send(settingChange);
} else if (SF2PLAY==true){
synth.NoteOn(CCchan,CCtype,CCpan);
}
}

function setRev(){
console.log("setRev()");
CCchan=176+trackMidiCh-1;
CCtype=91;
CCrev=document.getElementById("revID").value;
if (SF2PLAY==false){
settingChange=[CCchan,CCtype,CCrev];
outportarr[outportindex].send(settingChange);
} else if (SF2PLAY==true){
synth.NoteOn(CCchan,CCtype,CCrev);
}
}

function setChor(){
console.log("setChor()");
CCchan=176+trackMidiCh-1;
CCtype=93;
CCchor=document.getElementById("chorID").value;
if (SF2PLAY==false){
settingChange=[CCchan,CCtype,CCchor];
outportarr[outportindex].send(settingChange);
} else if (SF2PLAY==true){
synth.NoteOn(CCchan,CCtype,CCchor);
}
}

function setMod(){
console.log("sendMod()");
CCchan=176+trackMidiCh-1;
CCtype=1;
CCmod=document.getElementById("modID").value;
if (SF2PLAY==false){
settingChange=[CCchan,CCtype,CCmod];
outportarr[outportindex].send(settingChange);
} else if (SF2PLAY==true){
synth.NoteOn(CCchan,CCtype,CCmod);
}
}

function setHold(){
console.log("setHold()");
CCchan=176+trackMidiCh-1;
CCtype=64;
CChold=document.getElementById("holdID").value;
if (SF2PLAY==false){
settingChange=[CCchan,CCtype,CChold];
outportarr[outportindex].send(settingChange);
} else if (SF2PLAY==true){
synth.NoteOn(CCchan,CCtype,CChold);
}
}

function setProgram() {
console.log("setProgram()");
programNbr = document.getElementById("prog_sel").value;
midiCh = 192 + trackMidiCh-1;
//Set program on the track
if (SF2PLAY==false){
settingChange = [midiCh, programNbr];
outportarr[outportindex].send(settingChange);
} else if (SF2PLAY==true){
synth.PGMchange(midiCh,programNbr);
}
}

function sendOutport() {
console.log("sendOutport()");
outportindex = document.getElementById("out_portsel").selectedIndex;
console.log("ChangePort");
//PORToutmess = outportarr[outportindex];
PORTout = outportarr[outportindex];
}

 
Posted : 30/06/2021 5:54 am
Jonas
Posts: 207
Reputable Member
Topic starter
 

And then the HTML for it.
VOL

PAN

SUS.

REVERB

CHORUS

MOD.

 
Posted : 30/06/2021 6:03 am
Jason
Posts: 438
Honorable Member
 

Have a look at this data table from the Yamaha SW1000XG. I use modified Cakewalk Instrument Definition Files (.ins) from this and the PSR 9000 Pro v100 to build my names database for XG.

https://usermanual.wiki/Yamaha/SW1000E2.636143250/view

It shows what each MSB and LSB setting will do for this device.
MSB = 0 is default/unmodified tones.
MSB = 1 .. 125 is for device-specific variations like timbre and polyphony.
MSB = 64 is a SFX Bank (different from the SFX Kits listed below)
MSB = 126 will give you SFX Kits
MSB = 127 will give you Drum Kits
Use MSB = 126 or 127 to get SFX/drums on any channel that is not the default of 10.

LSB is used to select the actual instrument bank/kit (which is opposite of how GM and GS work, they use MSB for instrument bank/kit).

A program change on a percussion channel will set the actual percussion kit (unlike instruments where the bank select does it).

Most Yahama devices will have some form of this functionality (usually less). The SW1000XG is one of the "newest"/most complete XG devices, so using it as a base covers almost all others.

See a couple of screenshots of MIDI-MIS with an XG file loaded and being edited. There is extra debugging info in the screenshots, it'll be cleaner when it is done. But maybe it can help you understand what is happening better as well.

Shots of
MSB = 0 LSB = 40
MSB = 126 LSB = 0 (program change = 1)
MSB = 127 LSB = 0 (program change = 24)
MSB = 64 LSB = 0

(hopefully they upload in the right order!)

 
Posted : 30/06/2021 6:58 am
Jonas
Posts: 207
Reputable Member
Topic starter
 

Very nice indeed one can see the bars where the program/bank change on the midi channel.
Have you been thinking it would be very easy to add a single slidebar and a dropdown to list and select CC messages instead of program.

Well CC as modulation probably can change quite more often bar wise, so maybe not a good idea for this layout.

 
Posted : 30/06/2021 8:07 am
Jonas
Posts: 207
Reputable Member
Topic starter
 

But maybe you could list CC tracker wise vertical "and the position / empty bars" replaced by timings.
Even nicer if the specific CC 's bars length dependent upon the slidebar, visual inpection as you change.

 
Posted : 30/06/2021 8:12 am
Jason
Posts: 438
Honorable Member
 

I haven't done anything with the actual modification of playing notes, only changing the specific instruments. I'd have to look in to it more to see if it is possible with the way my program works. All of the items at the top are instrument containers, and any changes to them affect all notes of that instrument on that track/channel. Therefore, any modulation or whatnot would apply to the instrument as a whole, and would not be able to happen only "sometimes". But if you think this is a feature that people would use, I can see if it's possible to add later on when everything else is done.

 
Posted : 30/06/2021 8:56 am
Jonas
Posts: 207
Reputable Member
Topic starter
 

I will make a video of my track editor changing programs, by listing and select. But actually also change other CC selectable from a dropdown "filter them out" and adjut them with a simple slidebar 0-127, you got me inspired to work on the editor. And it is no competition to your very good idea, my program simply can't save the midi "it imported" to midi files. But write its own "adhoc but easy to understand format".

 
Posted : 30/06/2021 11:31 am
Jonas
Posts: 207
Reputable Member
Topic starter
 

I managed to create filters that individually select programs, volume, pan, reverb, chorus and sustain messages.
Will add a slider for easy change of the ones ranged 0-127 probably should be used on note on as well.

"Well and then check things actually update then change"
"Also the step function finding previous and next have to be adjusted, one can write in the value to select in listing but next/prev step one forward/backard..... just do not work without some logical surgery LoL" I have done it for CCs as whole but do it for the individual CCs we will see.

 
Posted : 30/06/2021 12:33 pm
Jason
Posts: 438
Honorable Member
 

[quotePost id=9550]Will one have to select synth from a dropdown or can you somehow ask the device to send modelID and decide message using a lookup table?
[/quotePost]
I missed this question earlier.

I check each file for a SYSEX reset to determine which mode to use.
If it has a GS reset, I use GS.
If it has XG, I use XG (usually also has a GM reset before the XG reset).
If it only has a GM reset or no resets, I default to GM.

As with the XG stuff mentioned above, I have an instrument file for GS from the Roland SC-8850 (most complete I could find) and for GM I have a generic GM1/GM2 file that includes all the instruments/banks in the official specs.

I'd like to see your video when it's ready. It sounds interesting! I also accidentally deleted my reply earlier while I was typing it, and forgot to re-type that doing the stuff in Javascript looks much easier 😉

 
Posted : 30/06/2021 7:30 pm
Jonas
Posts: 207
Reputable Member
Topic starter
 

I finished the "added extra interface" to editor but it sliders and fetch the selected value "from the new list items not" attached yet.

Once everything attached and working i make video.

 
Posted : 30/06/2021 11:14 pm
Page 1 / 2
Share: