Commit graph

495 commits

Author SHA1 Message Date
Paul Davis
1179b022da temporal: fix error in TempoMap::previous_tempo() 2022-05-21 18:58:41 -06:00
Paul Davis
8de52a74bb temporal: better fix for tempo ramp setting during ::reset_starting_at() 2022-05-21 17:28:38 -06:00
Paul Davis
5c8b7519c1 remove debug-only direct-to-output debug info that duplicates a DEBUG_TRACE msg 2022-05-21 16:38:36 -06:00
Paul Davis
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
Paul Davis
029ef88059 temporal: wrap some calls to TempoMap::dump() in appropriate DEBUG stuff 2022-05-21 16:35:00 -06:00
Paul Davis
5476a20fc4 temporal: fix conditional when deciding which log expression to use inside ::superclock_at() 2022-05-20 11:20:39 -06:00
Paul Davis
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
Paul Davis
7c2cb31b63 temporal: use boost::intrusive ::iterator_to to improve efficiency of ::next/previous_tempo() 2022-05-15 17:49:09 -06:00
Paul Davis
be5c64f737 temporal: NOOP - add blank line 2022-05-13 19:05:13 -06:00
Paul Davis
1ccda17504 temporal: add a new version of tempo twist based on pre-nutempo code 2022-05-13 19:05:13 -06:00
Paul Davis
60159acd33 temporal: slightly change const positioning in definition of ::stretch_tempo() 2022-05-13 19:05:13 -06:00
Paul Davis
b0ff612572 temporal: add DEBUG_TRACE message 2022-05-13 19:05:13 -06:00
Paul Davis
4defa3ae8f temporal: fix logic bug in TempoMap::reset_starting_at() 2022-05-13 19:05:13 -06:00
Paul Davis
c9b7f012e4 temporal: helpful comment for future readers 2022-05-13 19:05:13 -06:00
Paul Davis
f0f8f15cce temporal: missing change from 072a7b17a22f 2022-05-13 19:05:13 -06:00
Paul Davis
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
Paul Davis
f679cd6eab temporal: remove Rampable, change name of method to set end note types per minute
Rampable only existed to provide exclusive access to ::set_end() for the
TempoMap. More idiomatic C++ but now that _type has also gone away, so has
::set_ramped() and it really was not worth keeping it around.
2022-05-13 19:05:13 -06:00
Paul Davis
8770df611c temporal: remove TempoMap::_type concept
Ramped/Constant is really a function of start/end note_types_per_minute. Having
a separate member is really just caching it and leads to errors or risk thereof.
2022-05-13 19:05:13 -06:00
Paul Davis
43b3ec005f temporal: use new debug bit for debug output in reset_starting_at() 2022-05-13 19:05:13 -06:00
Paul Davis
5d22e522d1 temporal: add new debug bit for debug tracing just TempoMap::reset_starting_at() 2022-05-13 19:05:13 -06:00
Paul Davis
45de3694cc temporal: add reimplemented version of 6.x's TempoMap::gui_stretch_tempo() 2022-05-13 19:05:13 -06:00
Paul Davis
db9cc04230 temporal: remove debug output from TempoMap::reset_starting_at() 2022-05-13 19:05:13 -06:00
Paul Davis
a57f4fbce6 temporal: after changing a tempo point, reset the map starting at that point 2022-05-10 09:46:08 -06:00
Robin Gareus
46117303da
Fix some potentially uninitialized variables 2022-05-07 04:19:09 +02:00
John Emmas
2554302281 Export a variable which can't be accessed via a 'get()' function
Temporal::most_recent_engine_sample_rate is used in performance-critical code so shouldn't be accessed via a 'get()' function. But (via the TEMPORAL_SAMPLE_RATE #define) it does get accessed outside of libtemporal and therefore needs to get exported.
2022-05-04 16:09:34 +01:00
John Emmas
2245e362b9 TempoMap::twist_tempi() gets used outside of libtemporal so needs to get exported 2022-05-03 11:31:43 +01:00
Paul Davis
b5487415ec editing: a partiaally implemented version of TempoTwistDrag, to be completed. 2022-05-02 16:47:23 -06:00
Paul Davis
86e7a1b259 temporal: no reason for Point::set() to be virtual 2022-05-02 16:45:33 -06:00
Paul Davis
55755d5453 temporal: fix TempoMap::reset_starting_at()
We were using a given tempo or meter point as part of the metric used when
recomputing its position. In fact, the metric should be only use the
tempo/meter immediately preceding the given point.
2022-05-02 16:44:15 -06:00
Paul Davis
00b9e3f86a temporal: change return type of TempoMap::next_tempo()
It is more useful to get the actual TempoPoint than just the Tempo
that we discover.

Aside: it would be awesome to understand how to use boost::intrusive to get the
next tempo point directly from the tempo hook.
2022-05-02 11:40:23 -06:00
Mads Kiilerich
06f8936a73 wscript: remove trailing whitespace 2022-04-09 12:16:37 +02:00
Paul Davis
7fd8544e31 temporal: fix copy-n-paste error in TempoCommand cosntructor 2022-04-08 11:58:04 -06:00
Paul Davis
e466736e2d temporal: remove MementoBinder API for tempo map undo/redo 2022-04-08 11:58:04 -06:00
Paul Davis
a806ede94d temporal: add TempoCommand, a Command-derived structure for managing undo/redo w.r.t TempoMap 2022-04-08 11:58:04 -06:00
Paul Davis
7c3268d12f temporal: TempoMap::use() returns a const ptr to enforce semantics (library version)
This commit leaves two issues outstanding:

1. unclear/ugly semantics for drag operations that reset the GUI thread's tempo map to the writable copy
2. undo/redo for the tempo map

These will be addressed in future commits
2022-04-08 11:58:04 -06:00
Paul Davis
7bf89ce109 Constification: make Stateful::get_state() const, with all other required const-ness added (libs) 2022-04-06 21:56:59 -06:00
Paul Davis
1d10408bd1 temporal: add some relatively useless code to one of the timeline test functions 2022-04-05 20:52:10 -06:00
Paul Davis
ae3548c1da temporal: fix location of enum conversion decls
Without these changes, minor changes in include file
ordering or extent elsewhere can cause compiler errors.
2022-04-05 20:52:09 -06:00
Paul Davis
dae649d79c temporal: add namespace to macro definition to make it usable everywhere 2022-04-05 20:52:09 -06:00
Paul Davis
bf2618e97b temporal: fix crash during reset_starting_at() 2022-03-23 18:03:42 -06:00
Paul Davis
857856431e temporal: remove debug output and stacktrace 2022-03-23 17:42:52 -06:00
Paul Davis
74a4678c04 temporal: NOOP add explanatory comment 2022-03-23 17:42:52 -06:00
Paul Davis
214c291e55 temporal: fix ::set_state() for old sessions where initial meter was moved to non-zero location 2022-03-23 17:42:52 -06:00
Paul Davis
b4cf61304c fix meter point removal
std::upper_bound() was not the correct tool to find the existing point,
it should have been std::lower_bound(). For code consistency, this
change doesn't use either but like ::remove_tempo() and similar methods,
just iterates over the whole list
2022-03-21 11:35:34 -06:00
Paul Davis
d29c70a2a2 temporal: add new variant of TempoMap::bbtwalk_to_quarters() 2022-03-19 15:25:14 -06:00
Paul Davis
8ebd097df9 move #includes so that they are only used if needed 2022-03-17 17:43:43 -06:00
Paul Davis
a803dd0df8 superclock_ticks_per_second: use an (inline) accessor, change value
We do not want a value as large as the previous one, which limits the time
range that can be represented in 62 bits unnecessarily. The new value is
9 times smaller than the previous value, and loses only 384000 as a significant
factor.

This commit also switches to using an (inline) accessor for superclock_ticks_per_second,
making it possible in debug/testing phases to spot early/illegal uses of the value.
2022-03-17 14:15:59 -06:00
Robin Gareus
e603b2e12d
Remove debug messages (1/2) 2022-03-16 17:08:14 +01:00
Paul Davis
10dc09fcd4 temporal: extend TempoMap thread local ptr API a little
This allows checking to see if the map has changed compared with the thread's
current local pointer.
2022-03-14 14:03:07 -06:00
Paul Davis
da95a0a0ee replace sample rate callback used for superclock<=>sample conversion
Now using a globally-scoped static variable which is updated by the
AudioEngine whenever an SR change occurs. Defaults to 48kHz and can
be used even before there is a backend.
2022-03-14 14:03:07 -06:00