Commit Graph

620 Commits

Author SHA1 Message Date
Paul Davis 6a8946a746 NOOP: whitespace fix 2023-09-17 20:38:34 -06:00
Paul Davis 75e12993c6 temporal: fix grid generation in trivial case (1 tempo, 1 meter at zero)
We need to do the same "round up to bar/beat" trick that we do when we reach a BBT
marker
2023-09-17 20:38:23 -06:00
Mads Kiilerich d220f477ed wscript: drop unused "mandatory variables" 'top' and 'out' in libs
Variables by these names are only used from the local wscript and when
running "waf configure", which already for other reasons only can run at
the top-level.

These variables are thus not mandatory and not used.
2023-09-17 07:34:55 -06:00
Mads Kiilerich a0916ef368 wscript: drop unused APPNAME assignment in libs
https://waf.io/book/ says
  By default, the project name and version are set to noname and 1.0. To
  change them, it is necessary to provide two additional variables in
  the top-level project file

- and waf code inspection confirms that waf itself only will use the top
level APPNAME.

Also, the 'waf dist' comment doesn't seem relevant - especially after
this change - and is removed too.

(Note: libs/evoral/wscript and libs/temporal/wscript still use APPNAME
for other purposes.)
2023-09-17 07:34:55 -06:00
Mads Kiilerich 3b4cf9191c wscript: drop unused VERSION assignment in libs
https://waf.io/book/ says
  By default, the project name and version are set to noname and 1.0. To
  change them, it is necessary to provide two additional variables in the
  top-level project file

- and waf code inspection confirms that waf itself only will use the top
  level VERSION.

Some wscripts will use
  bld.env['VERSION']
but that will also just use the value set in the top wscript.
2023-09-17 07:34:55 -06:00
Mads Kiilerich 7737c17d52 wscript: drop unused imports, scripted
Done with ad hoc scripting hacks processing unused imports found by pyflakes:

for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.Logs.* but unused' | cut -d: -f1 | while read f; do sed -i 's/^import waflib.Logs as Logs,/import/g' $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.Options.* but unused' | cut -d: -f1 | while read f; do sed -i 's/import waflib.Options as Options, /import /g' $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.Options.* but unused' | cut -d: -f1 | while read f; do sed -i 's/^from waflib import Options,/from waflib import/g' $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep ' imported but unused$' | sed "s/^\([^:]*\):[0-9]*:[0-9]* '\(.*\)'.*/\1 \2/g" | while read f lib; do sed -i "/^import $lib$/d" $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.Options.* but unused' | cut -d: -f1 | while read f; do sed -i '/from waflib import Options$/d' $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.TaskGen.* but unused' | cut -d: -f1 | while read f; do sed -i '/from waflib import TaskGen$/d' $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.Task.Task.* but unused' | cut -d: -f1 | while read f; do sed -i '/^from waflib.Task import Task$/d' $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.Tools.winres.* but unused' | cut -d: -f1 | while read f; do sed -i '/^from waflib.Tools import winres$/d' $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.Utils.* but unused' | cut -d: -f1 | while read f; do sed -i '/^import waflib.Utils as Utils$/d' $f; done
2023-09-17 07:34:55 -06:00
Ben Loftis 8ba74e2a51
Add an argument to move markers during tempo-map 2023-09-14 23:13:11 +02:00
Paul Davis eca4c83b7b temporal: remove concept of inactive tempos 2023-09-11 10:26:54 -06:00
Paul Davis 58b667c6c0 temporal: fix crash caused by unsafe use of tempo map iterators 2023-09-06 14:46:24 -06:00
Paul Davis 269699c340 temporal: fix get_grid() to work in the presence of "weird" BBT markers 2023-09-04 19:41:25 -06:00
Paul Davis 13bdfda81a temporal: add Meter::round_up_to_beat_div()
reimplement round_up_to_beat() in terms of round_up_to_beat_div()
2023-09-04 19:41:25 -06:00
Paul Davis f1f5df7c9a temporal: add BBT_Time::round_up_to_beat_div() 2023-09-04 19:41:25 -06:00
Paul Davis 7c5e7ddf59 temporal: improve operator<<() for MusicTimePoint (BBT markers) 2023-09-04 19:41:25 -06:00
Paul Davis 0266d98a3b temporal: add TempoMap::{max,min}_notes_per_minute() API 2023-08-31 18:23:40 -06:00
Paul Davis cda0d6ce9f temporal: fix totally broken implementation of TempoMap::shift (timepos...) 2023-08-31 18:22:59 -06:00
Paul Davis c778a6df67 ripple backwards when cutting a section 2023-08-31 18:22:25 -06:00
Paul Davis c4cb8dbda9 arithmetic simplification 2023-08-30 16:07:48 -06:00
Paul Davis 6c44dbf9d6 temporal: a guess at how to use BBT markers from within TempoMap::paste()
Basically, if the paste position is not zero and not on a bar line, we will a BBT marker there,
using the existing tempo & meter at that position before the paste.

If the end of the paste is not on a bar line, we will place a BBT marker there,
using the tempo & meter that existed before the paste.

TempoMap::paste() now also accepts an optional final argument that if provided is
used to name the BBT markers, if they are created
2023-08-30 15:21:55 -06:00
Paul Davis 7aa1863c0f somewhat working tempo map cut/copy/paste 2023-08-30 14:16:21 -06:00
Paul Davis a5055a2227 various changes related to tempo map copy/cut/paste section
Tempo map is currently still excluded from the editor operation
2023-08-30 14:16:21 -06:00
Paul Davis 2e08ff01f5 temporal: add TempoMapCutBuffer::empty() 2023-08-30 14:16:21 -06:00
Paul Davis 32ef2d5a0f temporal: add a music-time (BBT) point at the cut site 2023-08-25 17:39:00 -06:00
Paul Davis 4d8ba938f1 temporal: during cut(), break out of loop once we pass the end time 2023-08-25 17:39:00 -06:00
Paul Davis e9be3beb2a add get/set state methods to TimeDomainProvider
These are not used yet, because only the Session really acts as a Provider
and it uses the Config::default_time_domain to serialize that state
2023-08-16 16:33:17 -06:00
Paul Davis 0227eab138 remove unused source file 2023-08-16 12:33:09 -06:00
Paul Davis 076cb86912 next iteration of changes to handle time domain bounces as undoable 2023-08-14 23:42:08 -06:00
Paul Davis 47a7a16c43 temporal: move another domain-swapping object to the right header 2023-08-07 16:33:16 -06:00
Paul Davis d87b10037b temporal: new object to try to make domain swaps undo-able 2023-08-07 16:33:16 -06:00
Paul Davis ada7fc16aa temporal: another place to ensure that a BBT marker defines a beat position 2023-08-02 15:23:43 -06:00
Paul Davis ca348ce0d9 temporal: add TempoMap::replace_bartime() 2023-08-02 15:23:43 -06:00
Paul Davis 7fe3becf2d temporal: fix TimeDomainProvider::set_time_domain_parent() to unset have_domain 2023-08-02 15:23:42 -06:00
Paul Davis 0c9bdd817d temporal: fix TimeDomainProvider::set_time_domain() 2023-08-02 15:23:42 -06:00
Paul Davis 1fce815e2d temporal: expand TimeDomainProvider API 2023-08-02 15:22:52 -06:00
Paul Davis 3b565693c8 objects don't have a time domain, they have a time domain provider (libs) 2023-08-02 15:22:52 -06:00
Paul Davis af2e0e279c temporal: initial version of a time domain provider object 2023-08-02 15:20:58 -06:00
Paul Davis 961fdc9de6 use a more explantory object name 2023-08-02 15:20:20 -06:00
Paul Davis fa225846af new Temporal API to allow keeping MIDI notes in position after a map-tempo operation 2023-08-02 14:11:06 -06:00
Paul Davis 7fbe17c802 BBT markers must define an on-beat position 2023-07-24 16:20:38 -06:00
Robin Gareus 8a371bcaa2
Fix tempo-map backward compatibility
Moving forward tempo-type is saved without `Tempo::`
prefix again.
2023-07-17 00:35:05 +02:00
Paul Davis c31c1906f7 temporal: fix dangling confusion about "omega"
Remove all reference to "omega_sc" and rename "omega_beats" as omega
2023-07-15 21:45:11 -06:00
Paul Davis ea2d2b4760 temporal: rename ::get_grid_with_iterator()
Because I like polymorphism
2023-07-15 11:23:45 -06:00
Paul Davis 422fa7255b temporal: further extensions to GridIterator API to handle bar_mod/beat_div parameters
Also try to comment class definition to add a little clarity
2023-07-15 11:08:45 -06:00
Paul Davis cbaa335946 temporal: some cleanup of the GridIterator API 2023-07-14 21:32:40 -06:00
Robin Gareus a857a0af4d
Update Luabindings for new TempoMap API 2023-07-14 23:48:13 +02:00
Paul Davis 509efdb290 temporal: refactor ::get_grid() for performance reasons
the API now provides the option to call ::get_grid() with an iterator which may
be re-used on subsequent calls. This avoids unbounded O(N) "walks" from the
marker preceding the start point of the grid to the start point.

This commit also includes "fast-path" code for the common case of a single
tempo and single meter
2023-07-14 13:03:36 -06:00
Paul Davis 81384537ef temporal: remove useless _floating member and API from TempoMapPoint 2023-07-14 13:03:36 -06:00
Paul Davis 039f2d5d0e remove TempoMap::count_bars()
It's the only place in libtemporal that would require
a TempoMapPoints allocation, and there's no reason to do
this inside the library.
2023-07-14 13:03:36 -06:00
Paul Davis 52f1b88749 temporal: remove ill-conceived lookup tables from tempo map (never publically visible)
These were not thread safe, and could not be: to be useful, a thread looking up a time
conversion could cache the result, but it would be using the global (shared) copy
of the map (because lookup is read-only, and so no write-copy is required). But
inserting into the lookup table wasn't lock protected (and shouldn't be because otherwise
that defeats the point of RCU).

So just drop it.
2023-07-14 13:03:26 -06:00
Paul Davis 20e1b6b287 temporal: add API to clear tempos in various ways 2023-06-30 15:50:25 -06:00
Paul Davis 3307dcfcb2 temporal: reference time for BBT_Argument is always superclocks 2023-06-30 12:10:50 -06:00
Paul Davis 16c9d91641 temporal: remove impossible get_tempo_and_meter (..., bbt, ...) method 2023-06-30 12:10:50 -06:00
Paul Davis a591fb64a3 temporal: rework ::get_grid() to avoid get_tempo_and_meter (..., bbt, ...) 2023-06-30 12:10:50 -06:00
Paul Davis 3513debba8 temporal: NO-OP (tiny variable rename) 2023-06-30 12:10:50 -06:00
Paul Davis bb97ade440 temporal: special case editing of the initial tempo (#9339) 2023-06-12 16:46:13 -06:00
Paul Davis 50232a23a7 temporal: hide superclock_t variant of TempoMap::metric_at()
This fixes several callsites that were passing samplepos_t to get a TempoMetric,
some of them somewhat significant (e.g. VST plugins that want tempo information).

Bad API design on my part, apologies.

This commit combines libs/ and gtk2_ardour because the new private status
of the ::metric_at() call would be a blocking point for git bisect
2023-06-12 12:36:16 -06:00
Paul Davis 733d59c65b temporal: unit testing more like unit testing
But still not really.
2023-06-08 14:01:17 -06:00
Paul Davis 01b8187cd3 temporal: add rudimentary paste test 2023-06-08 14:01:17 -06:00
Paul Davis 1cf4f9293c temporal: paste needs to add to _points 2023-06-08 14:01:17 -06:00
Paul Davis 24f6c51de6 temporal: more nuances for ::cut_copy() 2023-06-08 14:01:17 -06:00
Paul Davis a09a37049b temporal: get guard point values before altering the tempo map 2023-06-08 14:01:17 -06:00
Paul Davis 6039cea3dc temporal: improve cut buffer slightly by using different meters 2023-06-08 14:01:17 -06:00
Paul Davis d761ccb59b temporal: the second variant of shift() (untested) 2023-06-07 11:25:44 -06:00
Paul Davis e6b6340f3e temporal: more nuances for shift() 2023-06-07 11:25:44 -06:00
Paul Davis ad45778edc temporal: shift() with BBT must allow negative motion 2023-06-07 11:25:44 -06:00
Paul Davis a456a10cdf temporal: first guess at a TempoMap::shift() implementation 2023-06-07 11:25:44 -06:00
Paul Davis 9d3ae4fc8d temporal: fix position of end guard points during map paste 2023-06-06 09:52:29 -06:00
Paul Davis 9e4b1d59a7 temporal: do something when pasting the cut buffer guard points
Don't think this is quite right yet - we get guard points even when
they are not really necessary
2023-06-06 09:04:34 -06:00
Paul Davis f5f87f86d4 temporal: adjust cut buffer API to better deal with start/end "guard points" 2023-06-05 17:27:12 -06:00
Paul Davis 7789df5b1c temporal: get cut/copy/paste test code slightly more useful 2023-06-05 16:35:17 -06:00
Robin Gareus 11157d9bd9
Fix some Wunused-variable 2023-05-22 21:26:26 +02:00
Ben Loftis c452a4816c tempo mapping: Re-implement tempo-twist with constant and ramped varieties (lib part) 2023-05-22 13:32:53 -05:00
Ben Loftis 54969d8aab fix thinko resulting in duplicate bar-names after a tempo-mapping op 2023-05-14 09:05:08 -05:00
Paul Davis b9e5621e03 during map reset, force meter to bars, and tempo to beats 2023-05-05 20:53:23 -06:00
Paul Davis 32a3591018 remove #warning 2023-05-05 18:57:16 -06:00
Paul Davis 9e8eed8a03 temporal: various tweaks to get TempoMap::get_grid() to be more correct/robust 2023-05-05 18:56:01 -06:00
Paul Davis 7c07a9964a temporal: add operator<<(ostream&) for BBT_Argument 2023-05-05 18:55:27 -06:00
Paul Davis fafc891ca6 add ripple option API for TempoMap::cut() 2023-05-04 18:49:06 -06:00
Paul Davis 7f977bf3e4 add skeleton unit test for tempo map cut buffer 2023-05-04 18:48:50 -06:00
Paul Davis b3a127d318 temporal: TempoMap::paste(), TempoMapCutBuffer::dump() and cut/copy fixes 2023-05-04 17:09:19 -06:00
Paul Davis a8424e8617 temporal: implement (maybe) cut-copy for tempo map 2023-05-04 15:45:09 -06:00
Paul Davis f7ba9af6b2 temporal: stub API for tempo map cut/copy/paste 2023-05-04 15:10:56 -06:00
Paul Davis b3040a31fc temporal: a basic data structure to hold the result of a TempoMap cut/copy operation 2023-05-04 15:10:56 -06:00
Ben Loftis 912f9e5ea3 provide functions for both linear and ramped tempo-twists 2023-05-04 09:22:28 -05:00
Paul Davis b936fd12cd temporal: reset the tempo map in sections bounded by BBT markers (if any)
This avoids total SNAFUs caused by the impossibility of globally ordering
by BBT time.
2023-05-03 21:55:23 -06:00
Paul Davis faac648502 temporal: add TempoMap::{next,previous_}meter() 2023-05-03 21:55:23 -06:00
Paul Davis 0ddacb8ea2 when abort()-ing due to a failed assert in tempo map code, dump the map 2023-04-28 15:57:42 -06:00
Paul Davis 907d3f82a7 temporal: fix grid generation in the presence of MusicTimePoints 2023-04-27 19:54:44 -06:00
Paul Davis e7f4c9dcb5 temporal: fix removal (and thus moving) MusicTimePoints 2023-04-27 19:54:14 -06:00
Paul Davis d66f3e7c9d temporal: factor out twist iteration, add debug output 2023-04-16 10:33:37 -06:00
Paul Davis f29557348e remove debug output 2023-04-13 17:47:32 -06:00
Paul Davis b362d2b6ba temporal: don't abort() for illegal omega value, just leave it as it was 2023-04-13 10:57:12 -06:00
Paul Davis f17a516cef temporal: fix comment explaining when/how TempoMap::set() can be used 2023-04-10 09:18:44 -06:00
Robin Gareus 295dbd8e1e
Make RCU reader return a const pointer (omnibus commit) 2023-04-08 00:15:37 +02:00
Paul Davis e9f71824a1 temporal: change API for TempoMap::stretch_tempo()
This will likely be modified because it is actually impossible to do
what this code is attempting to do.
2023-04-07 12:56:57 -06:00
Robin Gareus 151fceea54
Add missing include
This fixes "error: ‘isfinite’ was not declared in this scope"
2023-03-30 01:10:23 +02:00
Robin Gareus ef7b7f4c89
Fix timecnt_t less-than-equal operator 2023-03-30 00:37:23 +02:00
John Emmas c771eccd0e 'Temporal::DomainSwapInformation' needs to be exportable 2023-03-25 12:29:17 +00:00
Paul Davis 5dbbac0bc2 temporal: operator<< for Range and RangeList 2023-03-24 14:19:16 -06:00
Paul Davis 393929a55b tempo twisting: various fixes and improvements to core logic 2023-03-24 14:19:16 -06:00
Paul Davis 7040ad1b74 temporal: API changes and implementation to support new twist operation
this includes using two different omega members for tempo objects,
a change that likely will not persist beyond the merge back to master.
2023-03-24 14:19:16 -06:00