mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-09 07:05:43 +01:00
Midi region ghost note uses beat-based note time calculation.
This commit is contained in:
parent
62372b48ea
commit
cecbae1df4
1 changed files with 5 additions and 2 deletions
|
|
@ -3747,9 +3747,12 @@ MidiRegionView::update_ghost_note (double x, double y)
|
|||
|
||||
/* calculate time in beats relative to start of source */
|
||||
const Evoral::Beats length = get_grid_beats(unsnapped_frame);
|
||||
const Evoral::Beats time = std::max(
|
||||
const uint32_t divisions = editor.get_grid_music_divisions (0);
|
||||
|
||||
Evoral::Beats time = std::max(
|
||||
Evoral::Beats(),
|
||||
absolute_frames_to_source_beats (f + _region->position ()));
|
||||
Evoral::Beats (trackview.session()->tempo_map().exact_beat_at_frame (f + _region->position(), divisions))
|
||||
- (_region->beat() - midi_region()->start_beats().to_double()));
|
||||
|
||||
_ghost_note->note()->set_time (time);
|
||||
_ghost_note->note()->set_length (length);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue