Hey, this is getting way OTT.
You said at the beginning that this was a way to EASILY change the instrument in a midi file. If you're trying to include what you seem to be aiming at, this is in effect the same as changing any instrument on any track - in effect - for every note played.
Is this really necessary?
As far as the Drum Kits are concerned, most of the kits are actually the same 'instruments' in most positions. Many of the instruments are in every kit.
The important consideration would be that to make any use of this facility, the user would need to have full knowledge of every kit, and which instrument was in each kit, and calculate for each instrument at each moment of playing which actual kit that contained that instrument would be the most suitable one to activate. If you want to play instrument X, and that instrument is in kit Y, then you must activate kit Y. If you need to play instrument X and that instrument is in, say, 8 different kits, then you should determine which of those 8 kits would be 'best' to use, maybe dependant on other instruments to be played later.
So the stated aim of your prog, to allow instrument changes to be done EASILY, goes out of the window?
I would suggest that it would be quite enough to allow the specific kit setting to be changed to another kit, as you seem to be thinking of regarding normal instruments. I.E you change one Bank Select + PC to a different BS + PC.
Geoff
When I say "easily", I mean for the user, not necessarily the poor programmer 😉 But I think I am probably going to limit it to changing whichever kit changes are already in the file (ie, there's a kit change at the beginning and one halfway through, allow those to be changed, and modify ALL corresponding percussion rather than the individuals) or perhaps allowing the insertion of one at a specified point in the file. My original idea of treating them like a standard instrument channel I think is too much. Though I'm still curious how hardware would respond. I'll probably update my instrument lists for drum kits to highlight all the percussion currently in use so you can tell at a glance which kit will work best.
Hello,
When I referred to 'easily', I was thinking about the user.
Some of what you say just now does not make sense. Please consider that the drum kit is in effect a single instrument, except that each different note in the instrument in fact plays a different sound. As soon as you change the kit, then you automatically change all the indiv sounds in just the same way that you would change all the sounds if you changed a Piano instrument to a Trumpet instrument.. So you don't need to modify anything else. And you ARE treating it exactly like a normal instrument change.
There is however the question as to this sounding right. Most of the diffent kits will have similar instruments in similar parts of the note number range, so that changing the kit will usually still be reasonable, but this will not be guaranteed. Probably, in some cases, a changed kit will result in a percussion track that sounds plain wrong! You can prob tell this ONLY when listening to the result. You should study some drum kits, and note how different they are (and also how similar they are, and how interchangeable they are). I'd also suspect that the vast majority of the sounds ACTUALLY USED from eack kit is merely a small proportion of the whole kit.
Geoff.
Some of what you say just now does not make sense. Please consider that the drum kit is in effect a single instrument, except that each different note in the instrument in fact plays a different sound.
Yes, I think I have been staring at the code for too long :p
I use the same code in my program to do several different things. Much of it processes both normal instruments (only with program changes) and percussion (with note-on/note-off). I keep "thinking" drum kits are separate banks, like instrument banks, though I know you change them with a regular program change and not a bank select. (Are they like banks? What actually happens in hardware when you do a kit change? Does it swap out all of the drum sounds, or does it just point to another location to play the sounds from?)
To clarify, my intent is to treat each percussion note as a stand-alone instrument during file modification. My program can already do this, no problem, as long as no kit changes are involved.
For example, a file has a drum track using
GM Kit 0 Standard Set
37 Bass Drum 1
39 Acoustic Snare
I would let the user choose any other drum kit for either the drum or cymbal (or both), and it would (theoretically) hop between the kits (via program changes) as the track plays. They could also change the drum or cymbal in to any other instrument from the new kit as desired.
So after modification,
GM Kit 0 Standard Set
37 Bass Drum 1
GM Kit 48 Orchestra Set
51 Timpani D (used to be Kit 0 39 Acoustic Snare)
The file would then need to rapidly alternate between Kit 0 and Kit 48 every time a drum is followed by a timpani and vice versa. This was the original question for this particular post, whether this was possible and whether it was feasible. It would require inserting lots of program changes, Thankfully, now that my brain has been on other things for a few days, I realize it does not also need a bunch of bank selects inserted 😉 Which dramatically increases the feasibility of doing it. I think.
But practically speaking from a programming standpoint, it would be easier for me to only allow changes that move all percussion currently on a particular kit to a new kit, rather than being able to piece it up all willy nilly. So if the user chose to change GM Kit 0 to GM Kit 48, all percussion on the track from GM Kit 0 would also go to Kit 48.
If it helps to visualize, here's a screenshot of drum kits in a GS file. the currently selected kit is the blue one in the middle. Kits can be changed by pressing left or right, instruments by pressing up or down.
Also, (can't edit previous reply) when I say treat each percussion as its own instrument, I mean each percussion item as a whole, which is what I do. So in my example from above, each "note on" for "37 Bass Drum 1" belongs to a single "Bass Drum 1" instrument, just as each "note on" for "39 Acoustic Snare" belongs to a single "Acoustic Snare" instrument. I would not want to treat each "note on" as it's own, just in case I accidentally gave that impression. THAT would just be downright silly :p
Thusly, as far as the user is concerned, it is still easy. Select new kit, select new instrument, done. 🙂
Please note that if you specifically want to change percussion item x from instrument X to instrument Y then there are two options.
If both instruments are in the same Kit, then you do NOT even need to change the kit, you simply need to change the note number. You may HAVE to do that anyway, if that specific sound is always a different note number.
Probably, if you MUST change the kit because the new sound is not present in the current kit, then you may still need to change the note number. In which case you need the Bank Select, then the Program Change, then change the note number. Of course, if you have to change the note number like this, then you need to change ALL the following note numbers for the same instrument change.
This might be practical if you use your own playback software. You can introduce a table into the prog, so that the note ## in the playback midi file is checked in the table and if the instrument has been changes then the note number is corrected from the tale and the changed note number is send for playing. I don't know if any existing playback software will do this?
.Geoff
From what i get about the kit changing what is really needed is an ins file "instrument description" that also hold the kit programs and bank.
I guess how frequently you can exchange banks/program is upto the hardware.
I have the most simple soundcanvas not a bank in sight just programs, however there is actually a few variations upon the statndard kit as programs.
I kind of doubt that i can use the snare on one program and bassdrum hihat on the other at least if it 16 part notes.
You probably can test your assumptions with my little script here, if you have different kits on same bank.
You just set the program for the virtualdrum kit you want to use, and record bassdrum and hihat.
Then change program "kit" and record snare.
Then you pretty much know how fast your device will be able to change kits, if it missing 16 part notes it simply to slow program changes.
https://jonasth.github.io/
Virtual drum toprow to the right, you will have to set notes for your kit.
Well it seem to me one would have to send a program change with each note on midichannel 10 to use two kits.
My script do not but i noticed i could record "listen" to two kits 16 parts notes, simultaneously on my Roland SC-7.
So it seem the mulitimbrality really do not care about banks and programs on the SC-7, and the switching message really just a message.
No weirder then the multitimbrality playing different programs.
Sure the message some byte longer but the Roland really do not care.
I think it so easy that the triggering really not aware about banks and stuff, programs and banks only "user interface".
When you send both program with notes it is just to find correct place in the lookup table in ROM.
So the adress spacing changes from 7 bit to 21-22?