Paul Davis
e50032ecb5
for debug builds, show stacktrace for TempoMap::fetch_condition() failure
2025-11-11 14:35:55 -07:00
Paul Davis
e975fc5b7d
slightly more debug information when starting local tempo scope
2025-10-20 14:58:16 -06:00
Paul Davis
901e32f17f
temporal: add stacktraces to DEBUG_TRACE output for start/end local tempo map
2025-09-01 11:17:24 -06:00
Paul Davis
f6ec3828ed
temporal: fix local tempo map depth mgmt when starting a local tempo map
2025-09-01 11:17:24 -06:00
Paul Davis
27ffd1628d
temporal: remove iterative bbt_delta() since unit test shows breakage
2025-08-22 10:51:16 -06:00
Paul Davis
fd53cf87ed
temporal: new non-iterative implementation of Meter::bbt_delta()
2025-08-22 10:45:12 -06:00
Paul Davis
e9460bb372
temporal: fix unused variable warning in TempoMap::paste()
2025-08-20 17:43:45 -06:00
Paul Davis
de843db102
temporal: lots more DEBUG_TRACE statements for grid debugging
2025-08-20 17:43:34 -06:00
Paul Davis
607f3577bd
temporal: in the event of the most common logic failure, provide more info
...
TEMPORAL_MAP_ASSERT() doesn't give us any actual values or context.
2025-08-20 17:43:24 -06:00
Paul Davis
a8168f826d
remove incorrect bbt_delta() in BBT_Time, provide Meter::bbt_delta
...
There are two implementations here, the more efficient one (commented out) does
not work correctly yet.
2025-08-20 17:43:05 -06:00
Paul Davis
1312e8f992
temporal: implement TempoMap::bbt_distance() but do not use it
...
This was implemented to try to fix paste() but was not needed. It might be
useful in the future, or just as an expression of the logic of this. Note that
the BBT_Offset it returns only has the beats field set, which is ... odd. So
this is likely not quite finished.
2025-08-19 10:53:06 -06:00
Paul Davis
29be601cce
temporal: undefine macro after use
2025-08-19 10:53:06 -06:00
Paul Davis
7c9b9ceb7e
temporal: show BBT marker point names in operator<<
2025-08-19 10:53:06 -06:00
Paul Davis
2aad1ac5f5
temporal: fix TempoMap::paste() to pass unit test
...
the BBT times of the newly inserted points during paste() are meaningless until
we recompute them using ::reset_starting_at(). So don't try to compute some
sort of likely value, just use the value from the cut buffer, and call
reset_starting_at() after every point inserted.
2025-08-19 10:53:06 -06:00
Paul Davis
f0111bcea5
temporal: BBT_Time cannot have any round_to_*() or round_up_to_*() methods
...
A meter (time signature) is required to do the math correctly for any operation that may
cross or reach the next bar boundary, which round_to_*() and round_up_to_*() may do.
2025-08-19 10:53:06 -06:00
Paul Davis
f010133c5f
slightly improve a DEBUG_TRACE message for DEBUG::Grid
2025-08-13 10:51:44 -06:00
Paul Davis
46f2dba306
temporal: fix Meter::to_quarters (BBT_Offset)
...
Because Paul can't do math
2025-08-13 10:51:44 -06:00
Paul Davis
20b984384d
NO-OP: move TempoMap destructor in code to be after constructors
2025-08-12 21:44:50 -06:00
Paul Davis
b205c0bc4b
scoped tempo maps: logic fixes and some comment-documentation
2025-08-12 07:53:30 -06:00
Paul Davis
2fc669964e
Revert "A new class ('ScopedTempoMapOwner') exposes functions which need to be visible outside of libtemporal"
...
This reverts commit d3a15b11ba .
This arrived at an awkward time as ScopedTempoMapOwner was being rearranged at
the source level. It will be reapplied in a subsequent commit.
2025-08-12 07:15:17 -06:00
John Emmas
d3a15b11ba
A new class ('ScopedTempoMapOwner') exposes functions which need to be visible outside of libtemporal
...
(and since there's no 'scope.cc', libtemporal itself needs to #include scope.h for those symbols to get exported)
2025-08-12 13:19:24 +01:00
Paul Davis
dd41fddcad
temporal: fix up some logic relating to scoped tempo maps
2025-08-11 15:41:34 -06:00
Paul Davis
1ecbdf164d
moved scoped tempo map from GUI to libtemporal
2025-08-11 15:41:34 -06:00
Paul Davis
b80b4b7869
remove debugging output
2025-08-05 11:42:23 -06:00
Paul Davis
b65adb59cd
temporal: fix some subtle misbehavior in TempoMap::cut_copy()
2025-08-05 11:37:35 -06:00
Paul Davis
0f1c5a9d7d
temporal: add new smf_*() API for building a tempo map from SMF info
2025-08-05 11:37:35 -06:00
Paul Davis
ba00dc0920
temporal: add TempoMap::duration() method
2025-08-05 11:37:35 -06:00
Paul Davis
b6f1ff336e
when adding a tempo/meter at end of map, no reset necessary
...
Also, the reset would malfunction which really ought to be fixed
2025-07-30 22:18:12 -06:00
Paul Davis
0e42868d35
fix arithmetic error in Meter::to_quarters
2025-04-11 11:23:36 -06:00
Paul Davis
9f3a41b96b
manually revert fa376b709d and debef6ab
...
Quantizing superclocks to samples in libtemporal negates the whole purpose of superclocks,
and breaks a variety of things, not limited to moving forward to markers and the grid
2025-02-28 13:39:45 -07:00
Paul Davis
debef6ab25
lighter, simpler math for sample-aligned superclocks
2025-01-30 11:26:41 -07:00
Paul Davis
fa376b709d
add new sample_aligned_superclock() method and use it when converting Beats to superclock
...
There can never be fractional audio time, and since superclock_t is used to represent audio time, when we
convert from Beat time, we should never, ever return a superclock value that does not correspond to
an integer number of samples.
This fixes a number of bugs, including any use of ARDOUR::Filter which writes a new (audio) file
to disk that must be an integer number of samples long, but may be derived from and later used
by a region that had an audio-time duration that is slightly longer (less than one sample)
than the audio file
2025-01-29 17:40:57 -07:00
Paul Davis
baef68b1e6
clean up/improve API used in 5ebf8152e
2025-01-10 09:25:03 -07:00
Paul Davis
5ebf8152ec
temporal: tempo changes must be on meter-provided grid, not quarter notes
2025-01-09 22:30:17 -07:00
Paul Davis
5f943295fc
copying a tempo map should not bail out just because there is only 1 tempo & meter
2024-12-18 16:46:07 -07:00
Paul Davis
364598e94f
temporal: add round_up_to_bar() methods to Meter, Metric and TempoMap
2024-10-31 12:22:35 -06:00
Robin Gareus
2d7cce44f1
Replace PBD::Signals (1/2)
2024-10-18 20:41:08 +02:00
Robin Gareus
e75ad3399e
Fix BBT marker calculation when removing time
2024-05-14 03:20:04 +02:00
Paul Davis
da175cc2e8
temporal: remove TempoMap::insert_time() and use shift() instead
...
The former was incorrectly implemented, and the latter has already been tested more
in real life.
We should likely remove ::remove_time also and use shift() there too, but that
requires testing negative shifts more broadly.
2023-11-19 12:14:10 -07:00
Paul Davis
5723c9bf9c
temporal: slightly more debug info when computing quarters from superclock
2023-11-13 22:32:15 -07:00
Paul Davis
04523dee97
temporal: NOOP reindent #ifdef'ed out code
2023-11-13 22:32:15 -07:00
Paul Davis
ce4d1ffe51
temporal: after loading an old tempo map, reset it to compute omega etc.
2023-11-13 22:32:15 -07:00
Paul Davis
fbc578fdb6
temporal: use "pulses" info from old tempo maps
...
Note: pulses are whole notes
2023-11-13 22:32:15 -07:00
Paul Davis
f8d86c8d19
temporal: add a new ::set_tempo() method for use when loading older tempo maps
2023-11-13 22:32:15 -07:00
Paul Davis
ea02c49856
a better solution for the problem being addressed in b40513ff7
2023-10-22 17:31:29 -06:00
Paul Davis
b40513ff7d
temporal: workaround (perhaps temporary) for rounding issues in ::midi_clock_beat_at_or_after()
2023-10-22 17:15:20 -06:00
Paul Davis
afe74bb460
use Meter::round_to_bar() rather than BBT_Time::round_(up|down)_to_bar
...
this gives slightly better behavior when dragging a meter marker
2023-10-07 11:11:31 -06:00
Paul Davis
64458c2430
prevent meter changes being dragged "through" a BBT marker
...
might want to do this for tempo drags too
2023-10-07 11:11:31 -06:00
Paul Davis
ec34c2137d
avoid a crash when dragging a meter change near a BBT marker
2023-10-07 11:11:31 -06:00
Paul Davis
bdd0fda188
remove debug output
2023-10-06 17:08:28 -06:00