View Issue Details

IDCategoryLast Update
0007071features2019-11-14 17:16
ReportercolinfAssigned To 
Reproducibilityhave not tried 
Status newResolutionopen 
Product Version5.X git (version in description) 
Fixed in Version 
Summary0007071: MIDI tracks not available for stem export
DescriptionMIDI tracks aren't available in the list of tracks offered for stem export (they're specifically excluded, in fact). Being able to render MIDI tracks without faffing around with extra buses would be quite handy.
Additional InformationI made a half-baked trivial patch to make this work: it works exporting audio outputs from MIDI tracks, but obviously exports nothing when exporting region contents of MIDI tracks. I'm not sure what should happen in that case: I imagine implementing a full-blown MIDI export would be a non-trivial task, but it feels a bit weird to have tracks visible in the stem export dialogue that will only be exported when 'track outputs' is selected.
TagsNo tags attached.


has duplicate 0007606 new Unable to export MIDI tracks as stems 
related to 0007838 new Offline Rendering for Midi Tracks 



2017-09-05 11:01


midi-stem-export.patch (1,213 bytes)
diff --git a/gtk2_ardour/ b/gtk2_ardour/
index 9043da312..4dd2fb587 100644
--- a/gtk2_ardour/
+++ b/gtk2_ardour/
@@ -651,6 +651,7 @@ TrackExportChannelSelector::select_none ()
 TrackExportChannelSelector::track_outputs_selected ()
+	fill_list();
@@ -676,13 +677,27 @@ TrackExportChannelSelector::fill_list()
 	for (RouteList::iterator it = routes.begin(); it != routes.end(); ++it) {
-		if (boost::dynamic_pointer_cast<AudioTrack>(*it)) {
-			if (!(*it)->active ()) {
-				// don't include inactive tracks
+		if (!(*it)->active ()) {
+			// don't include inactive tracks
+			continue;
+		}
+		if (!boost::dynamic_pointer_cast<Track>(*it)) {
+			// not a track, we've already handled it
+			continue;
+		}
+		if (track_output_button.get_active()) {
+			if ((*it)->output()->n_ports().n_audio() <= 0) {
+			// track has no audio outputs
+				continue;
+			}
+		} else {
+			// can only do pre-processor export of audio tracks for now
+			if (!boost::dynamic_pointer_cast<AudioTrack>(*it)) {
-			add_track (*it);
+		add_track (*it);
midi-stem-export.patch (1,213 bytes)


2018-07-04 12:23

administrator   ~0020335

Colin - do you think we should still apply this patch?


2018-07-04 12:37

updater   ~0020337

The patch is definitely no more than half-baked: it'll allow MIDI tracks to be selected in the stem export dialogue even if 'Apply track/bus processing' isn't ticked, but then the export won't produce anything for those tracks. Ideally, it should export a MIDI file in that case. Otherwise, at least it should not allow MIDI tracks to be selected for an export that wouldn't produce an audio file.

I toyed with the idea of refreshing the list of tracks when 'Apply track/bus processing' is toggled, so that MIDI tracks would only appear when it's enabled, but I seem to remember finding some annoying snag with that scheme: I think it was that all tracks became unselected for export when the list is refreshed, but I can't remember for sure: it was a long time ago...


2019-03-20 23:42

updater   ~0020616

Remarkably, the patch still seems to apply cleanly. I'll look back into this when I have a spare moment or two.

Issue History

Date Modified Username Field Change
2016-10-12 19:46 colinf New Issue
2017-09-05 11:01 colinf File Added: midi-stem-export.patch
2018-06-26 11:57 colinf Relationship added has duplicate 0007606
2018-07-04 12:23 paul Note Added: 0020335
2018-07-04 12:37 colinf Note Added: 0020337
2019-03-20 23:42 colinf Note Added: 0020616
2019-11-14 17:16 colinf Relationship added related to 0007838