View Issue Details

IDProjectCategoryView StatusLast Update
0007321ardourbugspublic2017-04-23 12:10
Reporterriban Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status confirmedResolutionopen 
PlatformWindowsOSWindowsOS Version7
Product Version5.8 
Summary0007321: MIDI notes do not sound if moved with cursor keys
DescriptionMoving a MIDI note to a different note value does not play the note when using the up / down keys but does when dragging or using undo after a move.
Steps To ReproduceEnable "Sound MIDI notes as they are selected in the editor".
Select a MIDI note - hear it sound.
Drag MIDI note - hear it sound for each note it is dragged to.
Press up / down arrow key.
Expected behaviour: MIDI note moves up or down and sounds for each not it is moved to.
Actual behaviour: MIDI note moves up or down but no sound.
Press Ctrl+z to undo move - MIDI note moves back to previous position and sounds.
Additional InformationThis behaviour is inconsistent with other note move functions and it is advantageous (expected) to hear a note's pitch change as it is moved. This facilitates correct change of note value.
TagsNo tags attached.

Activities

timbyr

2017-04-23 12:01

developer   ~0019627

I can confirm this issue with version 5.8.562

timbyr

2017-04-23 12:08

developer  

7321-sound-midi-notes-on-transpose.patch (1,539 bytes)   
diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc
index 968df4a..e03d4bf 100644
--- a/gtk2_ardour/midi_region_view.cc
+++ b/gtk2_ardour/midi_region_view.cc
@@ -3593,8 +3593,16 @@ MidiRegionView::transpose (bool up, bool fine, bool allow_smush)
 		delta = -delta;
 	}
 
+	typedef vector<boost::shared_ptr<NoteType> > PossibleChord;
+	PossibleChord to_play;
+	Evoral::Beats earliest = earliest_in_selection();
+
 	if (!allow_smush) {
 		for (Selection::iterator i = _selection.begin(); i != _selection.end(); ++i) {
+			NoteBase* n = *i;
+			if (n->note ()->time () == earliest) {
+				to_play.push_back (n->note ());
+			}
 			if (!up) {
 				if ((int8_t) (*i)->note()->note() + delta <= 0) {
 					return;
@@ -3616,6 +3624,27 @@ MidiRegionView::transpose (bool up, bool fine, bool allow_smush)
 		i = next;
 	}
 
+	if (!_selection.empty() && !_no_sound_notes && UIConfiguration::instance().get_sound_midi_notes()) {
+		if (to_play.size() > 1) {
+
+			PossibleChord shifted;
+
+			for (PossibleChord::iterator n = to_play.begin(); n != to_play.end(); ++n) {
+				boost::shared_ptr<NoteType> moved_note (new NoteType (**n));
+				moved_note->set_note (moved_note->note() + delta);
+				shifted.push_back (moved_note);
+			}
+
+			start_playing_midi_chord (shifted);
+
+		} else if (!to_play.empty()) {
+
+			boost::shared_ptr<NoteType> moved_note (new NoteType (*to_play.front()));
+			moved_note->set_note (moved_note->note() + delta);
+			start_playing_midi_note (moved_note);
+		}
+	}
+
 	apply_diff ();
 }
 

timbyr

2017-04-23 12:10

developer   ~0019628

I've attached a patch that should fix this issue. There is a bit of duplication with MRV::move_selection so there is further potential for refactoring.

I can/will commit it when I get time to do a bit of further testing etc.

Issue History

Date Modified Username Field Change
2017-04-16 17:49 riban New Issue
2017-04-23 12:01 timbyr Note Added: 0019627
2017-04-23 12:01 timbyr Status new => confirmed
2017-04-23 12:09 timbyr File Added: 7321-sound-midi-notes-on-transpose.patch
2017-04-23 12:10 timbyr Note Added: 0019628