Use Fixed-length when drawing percussive events
authorRobin Gareus <robin@gareus.org>
Wed, 4 Sep 2019 22:40:48 +0000 (00:40 +0200)
committerRobin Gareus <robin@gareus.org>
Wed, 4 Sep 2019 22:42:29 +0000 (00:42 +0200)
Previously adding percussive-hits created sustained notes
using the current grid as duration. This allowed to create
overlapping notes with the overlap not being visible.

Most hardware MIDI drumkits do send an immediate note-off event
after each hit (if they send note-offs at all).
Ardour now follows suit and does the same when using the draw/edit tool.

gtk2_ardour/editor_drag.cc

index 87d74b65c99f1815fad9d4d968d80e54f61c97c9..ad3f8478e958730deb67f3fd5b0d16ad0e3eef4c 100644 (file)
@@ -6818,7 +6818,7 @@ HitCreateDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
        }
 
        const samplepos_t start = map.sample_at_quarter_note (eqaf) - _region_view->region()->position();
-       Temporal::Beats length = _region_view->get_grid_beats (pf);
+       Temporal::Beats length = Temporal::Beats(1.0 / 32.0); /* 1/32 beat = 1/128 note */
 
        _editor->begin_reversible_command (_("Create Hit"));
        _region_view->clear_editor_note_selection();