Drum Map in Cubase for MDrummer

Official support for: meldaproduction.com
Post Reply New Topic
RELATED
PRODUCTS

Post

Cubase has a feature where you can create a drum map with names that correspond to the drum samples/rhythms loaded in a VST to display the names in the MIDI editor.

There's an option to generate it automatically from the VST, but that doesn't seem to work with MDrummer. I know that MDrummer reports the names to the host and I can see them in REAPER's MIDI editor, but I can't find a way to display those names in Cubase.

Does anyone know if it's possible to generate a drum map from MDrummer and how?

Post

Are you sure, that it's not just the Midi GM mapping that is being displayed in Reaper? Because MDrummer is using a lot of MIDI GM mapping assignments, albeit it seems not 100% matched with the Cubase built-in MIDI GM template.

In any case, I've just done a little manual drum mapping and have attached a zip file containing 2 Cubase drum maps that can hopefully be imported:

MDrummer.drm maps the individual drum instruments to channel 10
MDrummerControl.drm maps the rhythms to channel 1

It's definitely not as good as if there was automapping that is different depending on kit(s) loaded because not all individual drums may be present depending on the loaded (and merged) kit(s). But if one loads and merges lots of drums and percussion, the mapping seems to be rather consistent.

So my attached drum map shows more stuff than is typically present in most kits.

But maybe it's useful as a starting point for further refinement depending on individual preference and use case?
MDrummer_CubaseDrumMaps.zip
You do not have the required permissions to view the files attached to this post.

Post

noizejoy wrote: Mon Jan 22, 2024 11:03 am Are you sure, that it's not just the Midi GM mapping that is being displayed in Reaper? Because MDrummer is using a lot of MIDI GM mapping assignments, albeit it seems not 100% matched with the Cubase built-in MIDI GM template.
By default, REAPER shows the rhythms that can be triggered with each note. When I switch to drumpad mode, it shows the drum names for each note and not some generic mapping.
noizejoy wrote: Mon Jan 22, 2024 11:03 am In any case, I've just done a little manual drum mapping and have attached a zip file containing 2 Cubase drum maps that can hopefully be imported:
Thanks for sharing your maps. The rhythm map is very useful since they don't change as far as I can tell.

For the drum pads I would prefer to just see the notes that can actually trigger a sample. But it's much faster to delete unused notes than to create a new map from scratch, so your example is definitely useful until we hopefully get a proper implementation. So thanks again :)

Post

I would still like support for this. As a workaround, I "wrote" a python script that does the conversion from REAPER to Cubase. It's not very convenient, but better than nothing.

Code: Select all

import xml.etree.ElementTree as ET

def convert_reaper_to_cubase_drum_map(reaper_file, cubase_file):
    """
    Converts REAPER MIDI note names to Cubase drum map XML format.

    Args:
        reaper_file (str): Path to the REAPER note names file.
        cubase_file (str): Path to save the generated Cubase drum map XML file.
    """

    note_names = {}
    with open(reaper_file, 'r') as f:
        for line in f:
            # Skip comment lines
            if line.startswith('#'):
                continue
            parts = line.strip().split(maxsplit=1)
            if len(parts) == 2:
                try:
                    note_number = int(parts[0])
                    note_name = parts[1]
                    note_names[note_number] = note_name
                except ValueError:
                    continue  # Handle potential non-integer lines gracefully

    # Create the root element
    drum_map = ET.Element("DrumMap")

    # Add the Name element
    string_element = ET.SubElement(drum_map, "string", name="Name", value=f"{cubase_file.split('.')[0]}", wide="true")

    # Add the Quantize list (this is taken from the example, you might need to adjust)
    quantize_list = ET.SubElement(drum_map, "list", name="Quantize", type="list")
    item_element = ET.SubElement(quantize_list, "item")
    ET.SubElement(item_element, "int", name="Grid", value="4")
    ET.SubElement(item_element, "int", name="Type", value="0")
    ET.SubElement(item_element, "float", name="Swing", value="0")
    ET.SubElement(item_element, "int", name="Legato", value="50")

    # Create the Map list
    map_list = ET.SubElement(drum_map, "list", name="Map", type="list")

    # Populate the Map list with items for each MIDI note (0-127)
    for note_number in range(128):
        item_element = ET.SubElement(map_list, "item")
        ET.SubElement(item_element, "int", name="INote", value=str(note_number))
        ET.SubElement(item_element, "int", name="ONote", value=str(note_number))
        ET.SubElement(item_element, "int", name="Channel", value="0")
        ET.SubElement(item_element, "float", name="Length", value="200")
        ET.SubElement(item_element, "int", name="Mute", value="0")
        ET.SubElement(item_element, "int", name="DisplayNote", value=str(note_number))
        ET.SubElement(item_element, "int", name="HeadSymbol", value="0")
        ET.SubElement(item_element, "int", name="Voice", value="0")
        ET.SubElement(item_element, "int", name="PortIndex", value="0")
        
        #Use names from the file or "..." if missing
        note_name = note_names.get(note_number, "...")
        ET.SubElement(item_element, "string", name="Name", value=note_name, wide="true")
        ET.SubElement(item_element, "int", name="QuantizeIndex", value="0")

    # Generate the "Order" list
    order_list = ET.SubElement(drum_map, "list", name="Order", type="int")
    for note_number in range(128):
        item_element = ET.SubElement(order_list, "item", attrib={"value": str(note_number)})
        #ET.SubElement(item_element, "int", name="ID", value=str(note_number))

    # Write the XML to a file
    tree = ET.ElementTree(drum_map)
    ET.indent(tree, space="    ")  # Pretty formatting
    tree.write(cubase_file, encoding="utf-8", xml_declaration=True)


# Example usage (replace with your actual file paths)
reaper_file = "mdrummer_note_names.txt"
cubase_file = "MDrummerRhythms.drm"  # Cubase drum map extension is .drm
convert_reaper_to_cubase_drum_map(reaper_file, cubase_file)
To use it, export the note names from REAPER and save the file in the same directory as the python script. Change the reaper_file and cubase_file variables at the bottom to the correct file names and run the script without parameters.

Post Reply

Return to “MeldaProduction”