Help needed with MIDI channel mapping for exported MIDI files

TBH, I always open those Details arrows, must be some kind of OCD. What are you hiding from me? :face_with_monocle:
Let’s face it: it’s where things get serious and interesting.

2 Likes

“Nothing to see here.”

Ha! Yes, I can see how those closed tabs might be enticing. But I figure that by using them I can at least pretend to myself that I’ve been thoughtful of…oh, yeah, others.

This is way OT now, but I just wanted to mention (in solidarity) that I found myself doing exactly this in one response yesterday. When I posted it I was surprised to see how much I had written.

1 Like

There is something in how you have this configured that isn’t correct. I have HW and Dorico open together every day without issue. Once in a while I have to restart HW if it loses connection due to computer sleep, but otherwise this shouldn’t be a problem for you either. Granted, I’m on mac, but still. There is a Dorico setting about “taking exclusive control” which you can un-tick, so that it doesn’t steel the ASIO stream from another device. It might also be possible to use a 3rd party program to route both programs to that, and allow it to pass audio through from both.

But I digress…
I’m wondering if you are adjusting the incorrect setting when you change the midi channels. Perhaps you’re only changing the dynamics lane or something by accident? You very much should be able to assign specific channels to specific notes.

Also, to simplify matters, I would probably create more than one “organ” and assign each one to it’s own channel, and then just copy and past notes to each instance, so that the midi would be sent to each channel, rather than faffing about with changes mid-file on the same instrument.

Romanos, my screen looks like yours when I set my MIDI channels, and I am using the Default expression map. It doesn’t matter what I set the channel numbers to. Over the weekend I tried setting channels 5, 6, and 7 (not that HW can use those), and the resulting MIDI file has 3 for pedal, 2 for Great, and 1 for Swell. Of course, HW playback is wrong.

I’m aware that Mac computers allow multiple devices to access ASIO or whatever is the output device. For some reason, Microsoft decided that their MIDI drivers could only access one app at a time. I found instructions for an app called loopMIDI to allow multiple apps to access a MIDI input device at the same time, but I don’t know if it will work for output devices. That comes later, anyway. I haven’t installed Dorico on my HW PC yet because of this MIDI channel problem. I see no point in installing it there until I get it to behave on my laptop.

Romanos, I noticed in your screen shot you have routing set to . . . instead of HALion Sonic. I think it makes sense that I would want to do that, but when I set routing to . . . and then set the channel numbers i want, Dorico changes the routing back to HALion Sonic and assigns its own channel numbers.

In Windows MIDI outputs are usually multi-client friendly. It’s USB connected MIDI inputs that are single client only.

Launch Dorico first, it will grab MIDI input. Launch other apps that need access to your MIDI controller(s) later, and they won’t see them. Now you can route MIDI through Dorio out through the stave you wish to play.

If you need to use your MIDI controller(s) with multiple clients at the same time, you might like to try bidule or bome. Run one of those FIRST, and route controllers out to loopMIDI. The loopMIDI virtual ports will be multi-client friendly.

On the ASIO end, check in your device settings, both in Dorico, and perhaps in OS as well. Be sure to untick anything that allows a single app to take ‘exclusive control’ over your audio device. If that doesn’t fix it, there are still options, but we’ll need to get more info on specifics about your system.

On the MIDI file = wrong channels issue.

Post a partial score here if you can. Also, if you don’t mind, render a MIDI file with that score from your system, zip it up, and post it here as well.

Here is the Dorico project and the exported MIDI file for a trivial 3-staff organ demo:
MIDI Export Demo.dorico (522.5 KB)
MIDI Export Demo.mid (239 Bytes)

If you open the Dorico project and switch to Play mode, you will see that the top, middle and bottom staves are assigned channels 3, 2 and 1, respectively. However, in the MIDI file the notes for the top, middle and bottom staves are assigned channels 1, 2 and 3, respectively. In other words, Dorico assigns channels in the MIDI file in the order the voices are shown in Play mode without regard to the channel assignments in the Track Inspector.

@johnkprice , thank you for confirming the very problem I’m having! It’s depressing to think that I will have to use my Javascript editor to change the channels in my MIDI files every time I re-export from Dorico after making changes to a score. Surely there is a way to get Dorico to write the desired channel numbers. I greatly appreciate your providing files that demonstrate the problem for others to see.

I’ll have a look ASAP.

Tried using forced channels in the expression maps? Set init and natural base keys to use desired Abs. Channels.

Shouldn’t be necissary but if there is a glitch in rendering maybe that’ll fix it.

Might be some ‘settings’ buried in Dorico that we’re missing too.

I’ll run some tests when I get home.

I think this may be the solution.

Yes, I suspect something about the type of stave being used here forces it to go in channel order for the different voices.

Like Joel and John, I get 1,2,3 when rendering to MIDI.

I did try forcing a new channel for each voice using expression maps, and that fixes it.

  1. Clone your Default Map 3 times (A new one for each stave).
  2. Set init and natural to use the Abs. Ch. desired, and then the rendered MIDI file works out.

MIDI Export Demo 2.dorico (529.9 KB)
MIDI Export Demo 2.mid (239 Bytes)

I’ll continue to look deeper into this, but for now this seems to be a solution.

If you have the full version of HW, it should come with a plugin that’ll take care of streaming MIDI from Dorico to HW. If not, you should be able to use loopMIDI to make a virtual port connection between the two.

On the AUDIO front…

You might first check your Windows Device drivers to make sure those are not set to allow Exclusive Control. I find these sorts of things easier to locate and check in the ‘old school’ Windows UI.

Tap your Windows key, and type “control”. Open the “Control Panel”.

Double click the, “Sound” control panel…

In the “Playback” tab, locate the Audio Device you intend to use and Click the “Properties” panel. I have a ton of Devices on my system here, so I’ll just go to my Tascam US-1200 USB interface as an example.

When my Device’s properties dialog pops up, I’ll be sure that “Allow applications to take exclusive control of this device” is NOT checked, and then click “Apply”.
image

This takes care of the WDM/WASAPI driver side of things.

I’m not sure about HW. It might have options to use an assortment of driver types, or it might force you to go with ASIO. If it grants ‘options’, go ASIO to begin with. If you can’t get things working under ASIO, and it has other driver options, you might later try those as well.

Dorico will only work with an ASIO driver. If your audio interface has a proper ASIO driver, you’ll go with that if possible (for both HW and Dorico).

If your audio interface doesn’t come with an ASIO driver of its own, then Dorico will supply a special WDM<>ASIO backend called “Steinberg bult-in ASIO Driver” and/or “Steinberg Generic Low Latency” (Some of us who have been installing and updating various Steinberg clients for years might even have ‘both’ of these drivers installed and available to try).

“Steinberg bult-in ASIO Driver” 1.0.7 should be newest rendition of the driver.

In Dorico, go to Edit/Device Setup.

If your audio interface has proper custom ASIO drivers of its own, connect to those.

Check the “Device Control Panel…” button. Hopefully it will call up your interface’s control panel. If it doesn’t check your system tray to see if you can find it there. Study the control panel to see if there is any mention of ‘exclusive control’. If so, disable it. You might also check for hints like, “enable multi-clients” or terms of that nature (enable it if you see something like that).

If your audio interface doesn’t come with ASIO drivers of your own, connect to the “Steinberg bult-in ASIO Driver”.

It should pull up a Dialog where you can choose the system devices that you wish Dorico to interface with. Again, if you see anything about Exclusive device control, disable it.

Hopefully this info can help you running HW and Dorico on the same system. If your exploration at this point doesn’t yield the ability to launch ‘both’ Dorico an HW, please let us know more about your system. What kind of audio interface you have will be a great place to start.

Typically you’ll want to start Dorico FIRST. It will grab the input from all of your MIDI controllers. If any of them are plugged in Via USB, chances are high that the next App you launch cannot use the MIDI INPUTS from such devices. You’ll need to divert MIDI to HW ‘through’ Dorico. If your version of HW has the ‘VST Transit’ plugin included, try using that. If not, use a virtual MIDI port to connect the two apps.

If you use any sort of Tracking DAW at the same time as Dorico, you might opt to launch that first, and then use Virtual Ports (like loopMIDI) to forward MIDI on to Dorico/HW (or where ever you want it).

Personally, I use a standalone instance of bidule to sort the dreaded ‘single client’ USB MIDI driver issue on Windows. It’s one of the very first things that runs on my system (I even have it configured to auto-boot). Bidule grabs all of my MIDI controller ‘inputs’ and diverts them to Virtual Ports, which are then quite ‘multi-client’ friendly. I get a lot of bounus perks and abilities from Bidule as well…I can process and route input from my Controller(s) before it goes out to any host(s).

I’m super happy to report that @Brian_Roland 's solution of forced channel mapping with cloned default maps works for me, both in a new, empty score, and in the one that brought this issue to light.

Strangely, I first tried this solution in a ridiculously simple organ score that contained one note on each staff - that’s all I needed to see if the MIDI channels were correct. My custom maps for tracks 2 and 3 (channels 2 and 1, respectively) rendered properly, but every time I entered ANY expression map for track 1, not just my HW Ch 3 one, it changed to — as soon as I clicked off of it. In case I had done something to the project that was causing this, I threw it out and created a new project for solo organ with expression maps for tracks 1-3, and it renders properly.

Question: if I tell Dorico to apply edits to all flows, will my added expression maps remain available for future projects?

Thanks so much,
Joel

In Dorico Pro, there are a number of ways to keep up with custom instrument(s) and associated expression maps. Personally, I recommend taking advantage of the custom playback template abilities of Dorico Pro. These make it easy to save and store all sorts of custom instruments that’ll be automatically be assigned by Dorico according to your rules.

Revisited…

I’ve attempted to set up a Playback Template that will hopefully create organ staves automatically for you. Here is the template:
My Organ, HALion Sonic Selection.zip (202.7 KB)

Unzip the archive above to somewhere convenient for you. Perhaps in a “My Organ” sub folder where you keep your Dorico Projects.

Once you’ve got it unzipped, in Dorico go to Play/Playback Template…
Click the Import button, and locate the “My Organ, HALion Sonic Selection.dorico_pt” file from the archive above. Click Open


Now you should find that you have a new Playback Template.

The template looks like this if you click the edit icon…

What happens in this case is, Dorico will first check the “My Organ v1” ‘end point’ that I saved for a custom Instance of HALion Sonic, along with expression maps for the task. If the sound for the stave isn’t there, it moves on to the HALion Sonic Selection library and looks there for instruments to auto assign.

You can Clone, Rename, and add the My Organ v1 end point to the top of any of the other factory templates you like.

If you have a score loaded and then Apply it you should find that the first Organ Stave create in a project gets the Channels you’ve requested set up by default. Note, you might need to go to the Play Tab and ‘enable Independent Voice Playback’ before it plays/renders as expected.

Subsequent Organ Staves should pick up where that one left off (Channels 4 - 16 in order). Of course you can change expression maps at will to force alternate channel output.

You can change the default expression map if you like in Edit/Preferences.

Or you might prefer to Build a Nice Organ template first (set everything so it LOOKS as you like, Enable Independent Voice Playback for your Organ Stave/System in the play tab), Choose and Apply our new Organ Playback Template, and then Save the entire project as a Template.

If you make a nice ‘empty’ Organ Template all set up and ready to go, you should find that the instruments start out properly assigned. They should be good to go across as many new flows as you wish to add to a project.

How/Why it works…
First I started an empty project, and threw up 16 Organ Staves.

Without enabling Independent Voice Playback for any of the staves, I connected them all to the same Sonic Instance, Manually built Sonic as I want it, set up the channels in order (1-16) from top to bottom; then, built and assigned the Expression Maps that should be auto assigned.

I Then saved an Endpoint…

Through this construct, if the new “My Organ, HALion Sonic” Playback Template is applied, Dorico goes down the line attaching any calls for the Organ instrument to this custom Sonic instance in order from Channel 1 - 16. The endpoint saved lets Dorico know it can continue to use this one instance of Sonic for up to 16 organ channels. Organ Staves will be assigned to this Sonic instance in score order from Top to Bottom. If Dorico runs out of channels for organ staves in this instance, it will start a new Sonic instance and go down the list all over again.

I hope this helps you out.

P.S. Also inside the zip archive near the top of this post, I’ve included a doricolib file that contains the expression maps used in the template, just in case you ever wish to ‘import them’ manually into the Expression Map editor.

2 Likes