View Issue Details

IDCategoryLast Update
0007072bugs2020-04-19 20:18
ReporterrobscoAssigned Torobsco 
Reproducibilityalways 
Status closedResolutionfixed 
PlatformGNU/LinuxOSArch GNU/Linux x64OS Version4.7.6-1-ARCH
Product Version5.4 
Fixed in Version 
Summary0007072: Beats:Bars on Insert Time dialog is not working correctly.
DescriptionTry insert 003|000|000 in the insert time dialog and it is reset to 000|000|000 without any indication as to what went wrong.

I am not familiar with the code or internal working of the project but think I have traced this issue to
TempoMap::bbt_duration_at (framepos_t pos, const BBT_Time& bbt, int dir)
in the ardour/libs/ardour/tempo.cc file.

It seems also that this dialog is not aware of the current tempo and meter at the specific playhead position where one is trying to do the edit.
Steps To ReproduceTry insert 003|000|000 in the insert time dialog and it is reset to 000|000|000 without any indication as to what went wrong.
Additional InformationIn tempo.cc, changing line 3196 from:

const double bbt_ticks = bbt.ticks + (bbt.beats * BBT_Time::ticks_per_beat);

to:

const double bbt_ticks = bbt.ticks + (bbt.beats * BBT_Time::ticks_per_beat) + (bbt.bars * meter_at_frame(pos).divisions_per_bar() * BBT_Time::ticks_per_beat);

Allows the insert time dialog to work provided the meter and/or tempo has not changed since the start of the session. If it has changed, the amount of time inserted is calculated using the meter and tempo from the start of the session.
TagsNo tags attached.

Activities

nick_m

2016-10-15 15:37

reporter   ~0018818

Thanks for the patch.
3a0a628a75f should fix this along with some other problems with
duration clocks.

robsco

2016-10-17 17:30

reporter   ~0018831

Thank you very much nick_m. It seems like my initial issue of the bbt input box not working is solved. It also seems to insert the correct time relative to the tempo and meter at the start of the session.

The problem now comes (as before) that when setting a different meter, for example 5/4, at bar 4 of a session and then trying to insert 3 bars at bar 5. The bbt input box does not seem aware of the change in meter. If you insert 000|05|0000, it updates itself to 001|01|0000 which is 6 beats long in 5/4 time. Similarly, 001|00|0000 equates to 4 beats when the meter at the playhead position is 5/4. A similar thing happens for tempo. The tempo at the start of the session is the one used to calculate the amount of time that is inserted.

A workaround in the meantime is to temporarily set the meter and tempo you need at the start of the session, do the time insert, and then set the tempo back to what it was.

robsco

2016-10-17 17:57

reporter   ~0018832

Ok, so setting the edit point to "playhead" solved a few of my issues above. I previously had the edit point set to "mouse".

The insert time action is now, thanks to your set of commits, aware of the meter and tempo at the playhead position when edit point is set to "playhead". The issue of the bbt input box not being aware of the meter is still present. The issue of in 5/4 time, 000|05|0000 updating to 001|01|0000 is still present.

I think hardcoding the insert/remove time dialog to use the "playhead" edit point, regardless of the current edit point mode is the way to go. From what I can tell, there is no way of initiating an insert or remove time using the mouse in an area of "editor" view that makes sense for the edit point "mouse" to apply. I am always using "Track"->"Insert Time".

robsco

2016-10-17 18:06

reporter   ~0018833

The case of using insert time via a keyboard shortcut with an edit point of "mouse" currently inserts time at the playhead using the meter and tempo from the start of the session. The same behaviour as when using "Track"->"Insert Time" described above.

nick_m

2016-10-19 12:13

reporter   ~0018846

commit 3d38b4f58 should resolve the meter not being taken into account
when editing the duration clock.

nick_m

2016-10-19 16:42

reporter   ~0018847

sorry, commit 3fa9dd51b should fix the bbt duration clock editing behavior.
3d38b4f58 was completely wrong.

robsco

2016-10-20 11:54

reporter   ~0018848

Thanks nick_m. The duration clock now works as expected.

Unfortunately, I think this has broken the action of inserting time again. It does nothing to the regions of the selected tracks. I've tried using edit point 'mouse' and 'playhead' as well as using different duration clock types (bbt, time, samples etc) to no avail.

nick_m

2016-10-20 16:05

reporter   ~0018849

This seems to be working as expected as per our IRC conversation.
Can you confirm?

robsco

2016-10-20 17:36

reporter   ~0018850

Yes, all seems to be working. Before I had the session region settings set to lock instead of slide.

I have tested the following situations and they are all working:

split regions
y insert bbt
y insert bbt with new tempo
y insert bbt with new tempo and meter

stay in position
y insert bbt
y insert bbt with new tempo
y insert bbt with new tempo and meter

move
y insert bbt
y insert bbt with new tempo
y insert bbt with new tempo and meter

There is still a bunch more testing I need to do but I will create a new bug report if need be as the initial issue here is resolved. Thank you for the commits :)

system

2020-04-19 20:18

developer   ~0023662

Issue has been closed automatically, by Trigger Close Plugin.
Feel free to re-open with additional information if you think the issue is not resolved.

Issue History

Date Modified Username Field Change
2016-10-13 15:28 robsco New Issue
2016-10-15 15:37 nick_m Note Added: 0018818
2016-10-17 17:30 robsco Note Added: 0018831
2016-10-17 17:57 robsco Note Added: 0018832
2016-10-17 18:06 robsco Note Added: 0018833
2016-10-19 12:13 nick_m Note Added: 0018846
2016-10-19 16:42 nick_m Note Added: 0018847
2016-10-20 11:54 robsco Note Added: 0018848
2016-10-20 16:05 nick_m Note Added: 0018849
2016-10-20 17:36 robsco Note Added: 0018850
2016-10-20 17:37 robsco Status new => closed
2016-10-20 17:37 robsco Resolution open => fixed
2016-10-20 17:38 robsco Status closed => feedback
2016-10-20 17:38 robsco Resolution fixed => reopened
2016-10-20 17:39 robsco Status feedback => resolved
2016-10-20 17:39 robsco Resolution reopened => fixed
2016-10-20 17:39 robsco Assigned To => robsco
2020-04-19 20:18 system Note Added: 0023662
2020-04-19 20:18 system Status resolved => closed