13
0
Commit Graph

379 Commits

Author SHA1 Message Date
4dbdaf7fe9 fix possible negative return from TempoPoint::quarters_at_superclock() 2022-06-21 11:39:10 -06:00
f60b35483d temporal: fix major conceptual error managing Point reference to owner map
When TempoMap::copy_points() is called, the new points are intended to belong
to the (nascent) new map. But the copy constructor for the points leaves the
_map member of a Point unchanged, and so the new points reference the old
map (forever!). ::copy_points() must reset each Point to reference the new map.

Refactored the object that has the _map member, so that we could limit access
to its ::set_map() method to TempoMap.
2022-06-16 22:11:56 -06:00
32096afc90 temporal: remve debug output 2022-06-16 10:36:02 -06:00
2cfc013b0c temporal: fix loading tempo map from XML
We need to clear out all 4 intrusive lists before we start, not just the 3 typed ones
2022-06-16 10:18:37 -06:00
477b136e97 temporal: if requested via -Dtemporalmap, dump tempo map after any update 2022-06-16 10:18:37 -06:00
637971a7df
Fix Beat duration calculation
bbt_duration_at() calls bbtwalk_to_quarters() which already
subtracts the origin's position. Previously `pos` was subtracted twice.
2022-06-04 04:33:48 +02:00
88a035b000 temporal: changes in API to better support BBT markers 2022-06-03 13:19:56 -06:00
531db75a27 temporal: when dragging tempo/meter, move in points list as well
We spliced the point back into the tempo and meter lists correctly, but failed
to do the same thing for the same object's position in the points list.
2022-06-03 10:53:01 -06:00
7dadb1407b temporal: when copying points between TempoMaps do not double-count MusicTimePoints
They were counted as tempos, and meters, and bartimes individually, which
generated new tempo and meter points in the map, which is incorrect.
2022-06-03 10:53:01 -06:00
1b904285be temporal: improve utility of TempoMap::dump() output 2022-06-03 10:53:01 -06:00
2d24bcdf4a temporal: add operator== and operator!= for ratio_t 2022-05-31 12:36:54 -06:00
192b2fd839 temporal: fixes for TempoMap::move_meter() 2022-05-30 21:14:57 -06:00
710cca9ccf change logic for memory management when adding tempo,meter,bartime points
Because a bartime point IS-A tempo point and IS-A meter point, we cannot just delete the tempo
point passed into core_add_tempo() if the new point replaces an existing one. Ditto for meter.

So, leave that logic up to the caller
2022-05-29 15:01:54 -06:00
cca3e6e061 temporal: fix bug introduced in 48f4f9bf9c
timecnt_t and timepos_t constructors with the initial argument as an int64_t
are assumed to be using samples. We need to use the explicit factory methods
instead.
2022-05-28 12:59:35 -06:00
03649dc32a temporal: fix bug in TempoMap::get_grid() when next point (eg. BBT) is not on grid 2022-05-27 18:46:06 -06:00
48f4f9bf9c temporal: remove some arithmetic operators and rewrite others to use muldiv() 2022-05-27 12:47:44 -06:00
5175260af4 temporal: remove dangerous muldiv methods and use explicit method name not cast 2022-05-27 12:47:44 -06:00
30c073f669 temporal: fix double negative causing semantic confusing and crashing 2022-05-25 21:53:27 -06:00
60e5b84d78 temporal: alternative solution to overflow in timeline operator*()
This uses boost::multiprecision::int512_t when multiplying and dividing by the numerator
and denominator of a ratio_t. 128 bits would be sufficient but for some reason, the boost
docs show the 512 bit variant being very slightly faster.

This is a better solution than using a double, which although it will prevent overflow
has fairly limited resolution.
2022-05-24 21:46:10 -06:00
540a15efa0 temporal: remove debug output 2022-05-24 18:08:31 -06:00
a7ee848f70 temporal: improve accuracy of a comment/XXX item 2022-05-24 17:21:18 -06:00
Mads Kiilerich
2f5f917df2 libs/temporal: clarify superclocks-per-second usage comment 2022-05-24 17:15:37 -06:00
Mads Kiilerich
aadd24a4e5 libs/temporal/temporal/types.h: fix confusing indentation 2022-05-24 17:15:37 -06:00
25dc926f24 temporal: improve handling of MusicTimePoints and related matters 2022-05-24 17:10:25 -06:00
d48ee3df0e temporal: improve debug output when ::superclock_at() returns < 0 2022-05-24 17:10:25 -06:00
8ee7dc35f4 temporal: improve operator<< for MusicTimePoint 2022-05-24 17:10:25 -06:00
735835dff3 temporal: improve output of TempoMap::dump() 2022-05-24 17:10:25 -06:00
c48430f502 temporal: refactor methods to add tempo/meter points 2022-05-24 17:10:25 -06:00
ef1f814837 temporal: remove commented constructor 2022-05-24 17:10:25 -06:00
e3501a05f8 temporal: remove the concept of a time domain for the tempo map
TempoPoint and MeterPoint always have their position set in musical time; MusicTimePoint (BBT)
always has a position in audio time. It's that simple
2022-05-24 17:10:25 -06:00
7f5a576f66 temporal: fix continuing tempo section's tempo after end-stretch 2022-05-24 17:10:25 -06:00
e7e467264f temporal: add TempoMap::set_continuing() and make it and set_ramped return bool 2022-05-24 17:10:25 -06:00
f2a596669e temporal: set speed *and* tempo when setting tempo 2022-05-24 17:10:25 -06:00
20d7313e13 temporal: change "clamped" terminology to "continuing" (since that's what the GUI calls it) 2022-05-23 08:07:08 -06:00
1179b022da temporal: fix error in TempoMap::previous_tempo() 2022-05-21 18:58:41 -06:00
8de52a74bb temporal: better fix for tempo ramp setting during ::reset_starting_at() 2022-05-21 17:28:38 -06:00
5c8b7519c1 remove debug-only direct-to-output debug info that duplicates a DEBUG_TRACE msg 2022-05-21 16:38:36 -06:00
c4844b00e3 temporal: when calling TempoMap::reset_starting_at(), fix ramps
Even if we start at time T, if the tempo point before T is ramped, we need to
adjust it's omega value based on the beat time of the following tempo point. If
we don't do this, then using that tempo to compute ::superclock_at() for
subsequent points will be incorrect.

Note: there may be an ordering issue here with Tempo/Meter points. We might
need to pass over all tempo points first, then process meters etc. Something
like that.
2022-05-21 16:35:00 -06:00
029ef88059 temporal: wrap some calls to TempoMap::dump() in appropriate DEBUG stuff 2022-05-21 16:35:00 -06:00
5476a20fc4 temporal: fix conditional when deciding which log expression to use inside ::superclock_at() 2022-05-20 11:20:39 -06:00
9dd4931247 temporal: revert changes that created two different omegas; fix computation of ::superclock_at() for decelerando
changes in tempo can be negative (decelerando/slowing down), and thus so can _omega. We cannot call log() or its
cousins on negative values, so in this scenario use an alternate expression for "t from b" in the tempo.pdf paper
2022-05-20 09:06:25 -06:00
7c2cb31b63 temporal: use boost::intrusive ::iterator_to to improve efficiency of ::next/previous_tempo() 2022-05-15 17:49:09 -06:00
be5c64f737 temporal: NOOP - add blank line 2022-05-13 19:05:13 -06:00
1ccda17504 temporal: add a new version of tempo twist based on pre-nutempo code 2022-05-13 19:05:13 -06:00
60159acd33 temporal: slightly change const positioning in definition of ::stretch_tempo() 2022-05-13 19:05:13 -06:00
b0ff612572 temporal: add DEBUG_TRACE message 2022-05-13 19:05:13 -06:00
4defa3ae8f temporal: fix logic bug in TempoMap::reset_starting_at() 2022-05-13 19:05:13 -06:00
c9b7f012e4 temporal: helpful comment for future readers 2022-05-13 19:05:13 -06:00
f0f8f15cce temporal: missing change from 072a7b17a22f 2022-05-13 19:05:13 -06:00
51980b15cd temporal: split _omega into two values, for each time domain
omega can be computed from Beat or superclock duration. This gives rise to
different units for omega, and we must use the correct value in a given
context.

This commit also changes the way that the audio time omega is computed during
TempoMap::reset_starting_at()
2022-05-13 19:05:13 -06:00