XML question regarding midimaps

Moderators: MattKingUSA, khz, muldjord, deva

Post Reply
ontologist
Established Member
Posts: 3
Joined: Fri Oct 30, 2020 12:40 am
Has thanked: 2 times

XML question regarding midimaps

Post by ontologist »

Hi all,

I'm fairly new to DrumGizmo, and I've just started getting into XML in order to construct my own kit however, I have a question: is there any way to map a single MIDI note number to more than one 'instrument'?

If not, is there any possibility that such a feature could be implemented in an update?

Any help finding a way to achieve this would be much appreciated.
User avatar
deva
Established Member
Posts: 285
Joined: Sun Oct 23, 2016 10:15 am
Has thanked: 3 times
Been thanked: 31 times
Contact:

Re: XML question regarding midimaps

Post by deva »

At the moment only one instrument is activated by a note, but as such I see no reason why it couldn't be made to activate any number of instruments.
I will add it to the roadmap :-)
JamesPeters
Established Member
Posts: 188
Joined: Fri Jun 29, 2018 6:35 pm
Has thanked: 8 times
Been thanked: 15 times

Re: XML question regarding midimaps

Post by JamesPeters »

You can currently accomplish something like this by setting up the instrument XML file differently. The "sample name" just needs to consist of multiple source audio files. You can combine multiple source audio files into one "sample name". The "sample name" doesn't need to be made of a single multichannel WAV file (even though all DrumGizmo kits that I've noticed seem to be made that way).

Here's an example of a "normal" DrumGizmo instrument XML that uses a single 5-channel WAV file (named cowbell_a_01.wav):

Code: Select all

  <sample name="cowbell_a_01" power="1">
    <audiofile channel="COW" file="samples/cowbell_a_01.wav" filechannel="1"/>
    <audiofile channel="COW_OH_L" file="samples/cowbell_a_01.wav" filechannel="2"/>
    <audiofile channel="COW_OH_R" file="samples/cowbell_a_01.wav" filechannel="3"/>
    <audiofile channel="COW_ROOM_L" file="samples/cowbell_a_01.wav" filechannel="4"/>
    <audiofile channel="COW_ROOM_R" file="samples/cowbell_a_01.wav" filechannel="5"/>
  </sample>
  (etc.)
That indicates that a 5-channel WAV file will have its audio channels mapped to "COW", "COW_OH_L", etc. (and those mappings are picked up as "input" mappings, "channelmap in", of a kit.xml file). All audiofile channel references point to the same source WAV file, just different filechannel numbers of that same WAV file.

The thing is, it seems you don't have to use a single audio file as the source for that "sample name". If you wanted to use 5 separate mono WAV files for each "filechannel", that should work too. As long as they're mapped to the appropriate "audiofile channel" (which gets picked up as the "channelmap in" in the kit.xml file), it accomplishes the same thing.

I've tried this with multiple stereo and mono files (mixed), instead of 5-channel (or 7-channel) source WAV files. They were samples made for a Kontakt kit, so they were either mono or stereo files depending on the mic sources (proximity was mono, overheads were stereo, room was stereo.)

Here's an edited example of that instrument XML, but using separate mono and stereo samples to accomplish the same thing, assuming that the cowbell WAV files are separate: one each for proximity, overhead, and room channels named cowbell_a_01_prox.wav (mono proximity mic), cowbell_a_01_oh.wav (stereo overhead mics), cowbell_a_01_rm.wav (stereo room mics):

Code: Select all

  <sample name="cowbell_a_01" power="1">
    <audiofile channel="COW" file="samples/cowbell_a_01_prox.wav" filechannel="1"/>
    <audiofile channel="COW_OH_L" file="samples/cowbell_a_01_oh.wav" filechannel="1"/>
    <audiofile channel="COW_OH_R" file="samples/cowbell_a_01_oh.wav" filechannel="2"/>
    <audiofile channel="COW_ROOM_L" file="samples/cowbell_a_01_rm.wav" filechannel="1"/>
    <audiofile channel="COW_ROOM_R" file="samples/cowbell_a_01_rm.wav" filechannel="2"/>
  </sample>
  (etc.)
Notice the WAV file names and filechannel number designators, by comparison to the earlier example.

So if you're willing to edit your instrument xml files, you can do this with DrumGizmo right now. You can make a "hydrid" "sample name" that consists of different WAV files with different channel numbers. You could combine two kicks, two snares, a snare/tom combo, or whatever you want. As long as you rout the audiofile channel correctly to the kit.xml file, you can output the sound to separate "out" channels of the kit.


...of course, for existing instrument.xml files, it would be a lot simpler to be able to edit the midimap.xml file such that each MIDI note could trigger multiple instruments. But in the meantime, this other method exists. It's also useful in a different way (for instance making "instruments" from combinations of mono/stereo WAV files which weren't specifically prepared as multichannel WAV, since a lot of existing sample banks being sold are just mono and stereo files even if their mic sources could've been combined as multichannel WAV files).
ontologist
Established Member
Posts: 3
Joined: Fri Oct 30, 2020 12:40 am
Has thanked: 2 times

Re: XML question regarding midimaps

Post by ontologist »

First of all, thank you deva, that is very good to hear. Do you think it is likely to appear in the next version?

And JamesPeters, thanks for your suggestion. As I'm only just getting started with XML for DrumGizmo, I very much appreciate your detailed explanation; it's certainly helped clarify a few things for me and that method may prove useful for certain aspects of the drumkit I'm constructing. However, for most of what I need to do, being able to select sample combinations in the midimap.xml file would be my preferred choice, and if my proposed feature will appear in the next version (and if its release is not too far away) I may well be able to afford to wait for its arrival as I have plenty of single sample instrument files yet to create. So here's hoping. :)
User avatar
deva
Established Member
Posts: 285
Joined: Sun Oct 23, 2016 10:15 am
Has thanked: 3 times
Been thanked: 31 times
Contact:

Re: XML question regarding midimaps

Post by deva »

I have just pushed the changes needed to trigger multiple instruments with one note to our develop git branch.
The features is available now, if you compile the code yourself and will be part of our next release.
Post Reply