View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0007321 | ardour | bugs | public | 2017-04-16 17:49 | 2017-04-23 12:10 |
Reporter | riban | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | confirmed | Resolution | open | ||
Platform | Windows | OS | Windows | OS Version | 7 |
Product Version | 5.8 | ||||
Summary | 0007321: MIDI notes do not sound if moved with cursor keys | ||||
Description | Moving 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 Reproduce | Enable "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 Information | This 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. | ||||
Tags | No tags attached. | ||||
|
I can confirm this issue with version 5.8.562 |
|
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 (); } |
|
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. |