Commit Graph

19364 Commits

Author SHA1 Message Date
b95bb0bdac
Prefer atomic dec_and_test (instead of atomic get+set) 2022-06-14 18:19:52 +02:00
32b41037b5 libpbd: do not use debug transmitter inside BaseUI::signal_new_request() to avoid recursion 2022-06-13 13:43:31 -06:00
590b4165e8 use exception-safe inc/dec in TransportFSM::process_events()
Note: the processing guard variable is required because this code could be re-entrant
2022-06-13 10:52:31 -06:00
20997dfa78 add new exception-safe RAII object, that increments/decrements its argument 2022-06-13 10:51:04 -06:00
842fa3c708 NOOP: comment terminology update 2022-06-13 10:20:50 -06:00
5567f30213 triggerbox: output information rather than abort 2022-06-10 13:01:56 -06:00
6bef80ae60 triggerbox: use regular transport request mechanism to get transport started
if a slot becomes active, and the transport is not rolling, it still
asks the transport to roll. however, (1) there's only 1 request across
all triggerboxen (2) the request will not be handled till the next
process cycle (3) the triggerbox returns after the request i.e. it
waits until the transport is rolling
2022-06-10 11:59:12 -06:00
52047e108d
Fix windows builds (amend 01b06906b) 2022-06-09 18:13:33 +02:00
c16b7b6dd5
MixerScene: only request actual value changes
This is otherwise only caught later in the rt-thread after
scheduling a RealTimeOperation via AutomationControl::check_rt.

There is no need to schedule cross-thread events when the
value is not about to be changed.

This can greatly reduce the number of signals emitted by
restoring a slot, which improves performance and also prevents
the EventPool from filling up with useless events.
2022-06-09 02:25:51 +02:00
01b06906b0
Mitigate "POOL OUT OF MEMORY" when batch changing controllables 2022-06-09 02:25:49 +02:00
b1b57571e7
Prevent RealTimeOperation EventQueue clogging
It can happen that the EventQueue fills up with
SessionEvent::RealTimeOperation. Those are to scheduled to be
free()ed later the GUI thread via event_loop->call_slot().

However it can happen that the GUI EventPool is full, so the request
to call Session::rt_cleanup, is never executed.

In this case the SessionEvent pool can fill up with RealTime
Operations which remain there permanently.
2022-06-09 02:25:45 +02:00
95aa39d1c4
Update call_slot() API, inform caller if slot cannot be queued
It can happen that ::get_request() returns NULL if the
EventPool is full. In that case the slot is never called.

In this case the caller can now take action.
2022-06-09 01:46:27 +02:00
03e0fe0a73
Add API to query Session event pool size 2022-06-09 00:41:23 +02:00
fac6d6bf98
Use separate plugin-cache for Apple/M1
Plugins on Apple can be multi-arch (Intel + ARM), or AUs may
be bridged by Rosetta.

A user can also run Intel binary of Ardour or M1 binary on
M1 CPUs on macOS. Each can see different plugins - notably
VST3 plugins that are Intel only can be scanned using the
Intel binary, but are later not available with the M1 build.
2022-06-07 23:49:42 +02:00
b8c3f9342a
Fix typo for ARM MIDI ringbuffer alignment 2022-06-07 23:49:42 +02:00
75fe2ce095 generic MIDI: extend select function API and make argument be bank-relative, always 2022-06-05 15:37:04 -06:00
eb4ac77a7b control protocol: allow protocol implementations to override rid selection API 2022-06-05 15:36:41 -06:00
2e027e5894 generic MIDI: re-enable the "select" function 2022-06-05 15:03:48 -06:00
33b7c38e42 control protocols: add API to control selection by RID 2022-06-05 15:03:48 -06:00
c713841f39
Re-implement RTTaskList using Graph Threads
There is no longer an extra set of rt-threads, but existing
process-graph threads are reused.

There are two main benefits to this approach: graph-threads
have a SessioEvent pool and ProcessThread buffers. They are
also joined to work-groups (on macOS), or  JACK created threads
(cgroups).
2022-06-04 17:22:50 +02:00
7219791d22
Use a GraphNode base-class for processing
The process-graph trigger_queue only needs to call
::prep() and ::run() without knowing any further details.

This is in preparation for using the graph-threads for rt-tasks
2022-06-04 15:22:05 +02:00
c1a1d12354
Disambiguate GraphNode::run and IOPlug::run 2022-06-04 15:19:18 +02: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
ac5fb9d1f9
Revert "Debug noseq's audition issue - silent plugin processing"
This reverts commit b3497b3f8f.
2022-06-04 01:40:38 +02:00
543bb85157
Use process-graph for silencing routes during audition
Route::silence() runs plugins. With a heavy session
that relies on multi-core processing, sending silence
to processors will have to be done in parallel.
Otherwise it can result in large DSP load and xruns.

This may allow to revert b3497b3f8f, which was
a prior attempt to resolve this, before understanding
the actual cause.
2022-06-03 22:50:13 +02:00
3e1e0d94c5
Add Process Graph API for Route::silence() processing 2022-06-03 22:50:13 +02:00
57a1dbb375
Update route API for silent processing 2022-06-03 22:50:13 +02:00
191fdfda72
Leave a note for RT-Tasklists (need macOS workgroups) 2022-06-03 22:50:13 +02:00
99e785541a
Coreaudio/M1: prefer device IOThread Workgroup 2022-06-03 22:50:13 +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
b3497b3f8f
Debug noseq's audition issue - silent plugin processing
When auditioning, ardour's process_audition calls Route::silence
for all routes. PluginInsert::silence simply fed all [ports of all
[replicated] plugins with silence, regardless of port-mapping.
This can cause some VST2/3 plugins to change state, and enable ports
(e.g. stereo VST2 plugins on mono tracks), causing glitches.

This commit is mainly intended to investigate how significant
this glitch is when starting to audition.
2022-06-03 17:17:07 +02:00
fa8f75c145
Fix yet another oversight when coding blindly in 6a513a11f 2022-06-03 07:29:23 +02:00
5417ddd792
Fix typo in 6a513a11f 2022-06-03 07:24:42 +02:00
58979af4f2
Coreaudio: update workgroup query 2022-06-03 06:42:42 +02:00
6a513a11fa
Coreaudio: set real-time constraint before joining the workgroup
The worker thread needs to have a real-time constraint set,
before it cab be joined to the workgroup.
2022-06-03 06:42:38 +02:00
87ee609339
Amend previous commit, fix debug print format 2022-06-03 05:32:19 +02:00
fd5d290217
Fix mach thread time constraints on M1
or any system where timebase is not 1 tick per ns.
2022-06-03 05:27:42 +02:00
74ee7ee091
Add parallel realtime threads to CoreAudio workgroup
This API is only available since BigSur (11.0), see also
https://developer.apple.com/documentation/audiotoolbox/workgroup_management/adding_parallel_real-time_threads_to_audio_workgroups?language=objc
2022-06-03 04:56:28 +02:00
88e9fc3e22
Remove unneccesary include (now handled by libpbd) 2022-06-03 04:52:38 +02:00
c2cff575b7
Add debug info to track down M1 time-constraint issue 2022-06-03 03:52:43 +02:00
972389e1bd
Tweak PluginInsert::silence (used during audition, etc)
Actually run plugins (use _pending_active), and feed silence
to the plugin. Also update timing stats accordingly.
2022-06-03 01:30:02 +02:00
ef4bbae02e
Fix logic in nth_mixer_scene (amend 00bd313e6e)
_mixer_scenes[nth] may not exist, size check condition needs
to happen first. Writer lock is only required when changing the
vector.
2022-06-01 16:26:51 +02:00
00bd313e6e Mixer Scenes: fix code thinkos for sparsely-populated vector of scenes
* don't create a new MixerScene if one already exists
* only resize the vector when necessary
* adding a new scene at position N should not shrink the vector size
2022-06-01 08:53:50 -05: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
60db5a827f
Use SYS_futex instead of __NR_futex
Use the C library definition for portability; also test
for support instead of unconditionally enabling it.
2022-05-30 21:56:49 +02:00
ce7d8ed8a1
Fix consolidating to FLAC file(s)
FLAC file needs to be re-opened read-only. FLAC files do not have a
read/write mode.
2022-05-30 20:46:23 +02:00
5658e18815
Fix occasional crash at end of clip playback
Previously it was possible to cause a 64bit signed to 32bit
unsigned overflow. `from_stretcher` is pframes_t aka. uint32_t.
With int64_t arguments a std::min() expression producing negative
result will result in large 32bit values:

(pframes_t) std::min<int64_t>(1024, 176400 - 187392) = 4294956304

This produced a segfault when used as n_samples to copy in
buf.accumulate_from()
2022-05-29 23:35:51 +02: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
ef07fb601a libcanvas: FramedCanvas::covers() method is ill-conceived. Use PolyItem::covers() 2022-05-29 14:19:02 -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
dancesWithBugs
e505407b76
fix boundary check 2022-05-28 19:14:57 +02:00
51b507b831
Skip any postprocessing when exporting for analysis only 2022-05-28 18:20:22 +02:00
c1f92861c6 triggerbox: fix responses to "Play Cues" button being clicked
Session handles the case when the button is used to enable cue triggering, by
forcing a locate to the current transport position.

TriggerBox now connects to the correct configuration object to notice when cue
triggering is disabled, and sets _cancel_locate_armed appropriately.
2022-05-27 23:05:34 -06:00
cc2e6b3cf8 libardour: change API of Session::request_locate() to include "force" argument
No behavior should be changed by this modification; the argument has a default value of false, which
matches previous semantics, and every instance where the argument is specified, it is given as false.
2022-05-27 18:49:11 -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
39248d682d add ::time_domain() methods to Playlist and Region
These are heuristics based on data type for now. That may evolve over time,
but it's a reasonable place to begin
2022-05-27 15:56:13 -06:00
c8feef51ab convert use of operator* for tim::line types with ::scale(ratio_t) 2022-05-27 12:47:44 -06:00
48f4f9bf9c temporal: remove some arithmetic operators and rewrite others to use muldiv() 2022-05-27 12:47:44 -06:00
12e5042ece libpbd: add muldiv() to compute v * (n/d) without overflow 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
927562678b
Do not emit MixerScene signal with locked mutex (fixes ndeadlck) 2022-05-26 16:18:00 +02:00
30c073f669 temporal: fix double negative causing semantic confusing and crashing 2022-05-25 21:53:27 -06:00
John Emmas
ee7e043855 class 'ARDOUR::Session::ProcessorChangeBlocker' gets used outside of libardour now (so needs to be exportable) 2022-05-25 12:26:09 +01: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
c1c95f538f evoral: fix ControlList::_x_scale to avoid ratio overflow when adjusting fade length
Region fades would sometimes get in a mode with weird behaviour. They
would be drawn in 2d with crossing lines, mainly moving back and forth
horizontally - not as a function of time. It would sound as it looked.
The fade would sometimes jump around when resizing. It could be worked
around by resetting the fade shape. It turned out the problem could be
reproduced by making minute long fades.

This change fixes or works around the problem.

Back story:

timepos_t (in temporal/timeline.h) uses 62 bit for integer value and the
max value is thus 4611686018427387904 ~ 5e18. timepos_t counts
superclocks, where superclock_ticks_per_second is 56448000 ~ 6e7. It can
thus store up to 8e10 seconds - thousands of years.

ratio_t (in temporal/types.h) can represent fractions as 64 bit (signed)
numerator and denominator. timepos_t avoids floating point operations,
but has operator* with ratio_t. To avoid crazy loss of precision it will
multiply the superclock count with the numerator before dividing with
the denominator.

Audio region fade in and out uses a number of increasing timepos_t
values (in a ControlList) up to the length of fade. When dragging to
resize, these values are (in_x_scale) multiplied with the ratio_t of the
new and old fade length. The problem is that the 62 bits will overflow
if using fades more than sqrt(5e18) ~ 2e9 superclock ticks ~ 38 seconds.
It will overflow into the "beat" flag and (at 58 seconds) into the sign
bit. The timepos_t values in the fade will thus jump and can be negative
or change to count beats.

To work around that problem, this changeset just use floating point
values for scaling the timepos_t values. All scaled values are stored as
integer anyway, so it should not make any actual difference for this use
case. There might however be other uses of ControlList where it matters.

As an implementation detail of this "workaround" of using double, it
could perhaps also be nice to implement timepos_t operator* (or
operator*=) for double. But I'm not sure we want floating point support
in timepos_t.

An alternative (and better) solution would be to convince the fraction
multiplication to use 128 bits. It is essential to avoid overflow -
mainly in static analysis, alternatively as runtime checks or asserts.
2022-05-24 17:15:37 -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
e863a7dbc9
Allow to configure vari-speed resampler quality
This also allows to disable the resampler, effectively disabling
varispeed support, for the benefit of adding no additional latency.
By default 2 * 16 samples latency are added, due to port-resampler,
this is not desirable if Ardour is used as mixer only.
2022-05-24 20:41:59 +02:00
bb4a45ebaf
zita-resampler: pass-through data if not configured
This is in preparation to allow fixed-speed processing without
resampler latency
2022-05-24 20:41:59 +02:00
f02e8d34e3
Make resampler reset idempotent 2022-05-24 20:41:56 +02:00
83b5be1add
Add static signal to indicate MixerScene changes 2022-05-24 20:08:05 +02:00
4d5ac90248
Only emit RouteProcessorChange if disk-i/o point actually changes 2022-05-24 02:26:56 +02:00
baa30262b8
Be more specific about RouteProcessorChange signals
Session::route_processors_changed accumulates signals emitted
in realtime and processing is delegated to a dedicated rt-safe
thread. Previously this resulted in any changed to be converted
to a `GeneralChange`, which unconditionally triggered a route-reorder.

Record-arming a track causes a MeterPointChange (meters change to "in"),
and this caused routes to be resorted and a latency-update.

While the former is reasonable (Ardour prefers to process
rec-armed routes first), the latter certainly is not.
2022-05-24 02:26:56 +02: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
a0810ed608
LV2: pass patch-set messages to replicated plugin instances
This also fixes impulse analysis plugin display
2022-05-22 00:16:22 +02:00
58372f5b78
Fix macOS builds, size_t serialization
See also e1905e779b
2022-05-21 21:09:21 +02:00
e1905e779b
Fix macOS builds, size_t serialization
libs/ardour/session_state.cc:1500:13: note: in instantiation of
 function template specialization 'XMLNode::set_property<unsigned long>'
 requested here
libs/pbd/pbd/string_convert.h:151:11: error:
  type 'unsigned long' cannot be used prior to '::' because it
  has no members
2022-05-21 07:44:39 +02:00
ba675fa0e9
Remove old, now unused freesound path config 2022-05-20 22:03:14 +02:00
5476a20fc4 temporal: fix conditional when deciding which log expression to use inside ::superclock_at() 2022-05-20 11:20:39 -06:00
2129552777
MixerScene: correctly restore controls with VCA master
The master needs to be restored first, otherwise setting
the master value with be propagated. Furthermore the
actual value is saved at the time of VCA assignment.
Restoring the vaule needs to scale by the master-reduced value.
2022-05-20 19:10:16 +02:00
7d6e429001
Add API to query control-masters
This allows to traverse VCA masters upstream, and potentially
build a graph.
2022-05-20 19:10:13 +02: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
c4307667fb freesound: add a DebugBit
Add a new DebugBit value for Freesound
2022-05-20 14:33:57 +01:00
e1f5fb0206 libpbd: change GlibEventLoopCallback to use C API not C++
We discovered in the past that the C++ API for GSource/Glib::Source has some fatal and unfixable flaws. Copy similar
code and just use the C API for GSource instead
2022-05-19 22:24:43 -06:00
04aaf23851
Add Lua bindings for MixerScene 2022-05-19 23:32:01 +02:00
48fdfbab53
Implement Session support for Mixer Scenes 2022-05-19 23:31:54 +02:00
bdc5711c31
Implement mixer-scene class 2022-05-19 20:08:24 +02:00
a811583380
Add API to query registered controllers 2022-05-19 20:08:08 +02:00
276172b8b1
Fix PhaseControl set_value()
Previously this resulted in excessive "000...000" state string.
2022-05-19 20:08:00 +02:00
5c85695362
Add Input Port meters for I/O Pre-Plugin outputs 2022-05-17 02:26:28 +02:00
cdf3b5209e
Generalize input-meters 2022-05-17 02:26:28 +02:00
4c1506e50e add copyright notices 2022-05-16 15:41:56 -06:00
9758e6280f use new event loop callback to ensure that all surface/control protocol threads have tempo map ptr set 2022-05-16 15:24:52 -06:00
968533cc23 (re)add mechanism for a callback in any glib event loop executed before the loop "executes"
This is based on code from earlier commits that were later reversed, but we need some mechanism
to ensure that threads have a thread local tempo map ptr set. The big difference is that this
time we do not implement this for all instances of an AbstractUI - implementation is left to
each thread/event loop
2022-05-16 15:24:52 -06:00
2079a150dd probable fix for Mackie vpot press/release misbehavior in sends (and plugin) subview
The accessed control needs to reflect the current subview banking
2022-05-16 15:24:52 -06:00
e528c4df92
Fix export-processor position, include triggerbox output 2022-05-16 14:32:47 +02:00
cd332a2af0 when pasting a Range of automation, first add guard points,
so the automation data before and after this range is retained
2022-05-16 07:16:25 -05:00
3a174ff914 add support for 'positive' guard points in ControlList 2022-05-16 07:16:25 -05:00
c98561e95c when cutting or clearing an automation range, always add boundary points
* these guard points are necessary to retain the automation that existed
 before and after the selected range is removed
2022-05-16 07:16:24 -05:00
44e273d713
Overhaul export channel state save/load
This allows to properly save/restore Route and Port
channel config states.
2022-05-16 04:54:17 +02:00
f6e67875f4
Implement MIDI ExportGraph processing 2022-05-16 04:54:17 +02:00
aa09a445e3
Bootstrap MIDI export writer
This leans on the AudioGrapher API for IdentityVertex.
2022-05-16 04:54:17 +02:00
719dda7701
Implement MIDI ExportChannel
Since MIDI Export is limited to Stem-Export, only a port-reader
and ExportProcessor have to be implemented.
2022-05-16 04:54:17 +02:00
4c4ab9cf51
Prepare PortExportChannel API for MIDI export 2022-05-16 04:54:17 +02:00
7c2cb31b63 temporal: use boost::intrusive ::iterator_to to improve efficiency of ::next/previous_tempo() 2022-05-15 17:49:09 -06:00
a522a98118
Add API to query fixed delay line's delay time 2022-05-15 19:32:46 +02:00
ae0aa50b6f
Fix MIDI delay-line (amend 25098ed)
Events in the delay-buffer must be shifted back every cycle.
Also in case of fixed-delay-lines events may not be in sequence
since events are only sorted at backend port-level.
2022-05-15 19:20:32 +02:00
d55d3a7360
Save/load export timespan realtime setting 2022-05-15 02:20:19 +02:00
4577f86aa0
NO-OP: clang-format 2022-05-15 02:19:46 +02:00
86597d7e1c
NO-OP: re-indent, and cleanup 2022-05-14 23:32:26 +02:00
0cfbc64e54 triggerbox: given no other info, assume a clip is 1,2,4,8 or 16 bars at 4/4
this solves the oft-recurring problem where we assign
 a beat-count of '3' or '7' because minipm  mis-detected the tempo,
 and that situation is vanishingly rare.  it's better to assume 4 or 8

the user always has the option to change the number of beats (and
 therefore the detected tempo) manually, for those clips that are
 in a different time signature.  but minibpm cannot be expected
 to help us there.

NOTE: this is a fallback to make things 'just work' lacking any other context.

* if the tempo is detected in the filename, we use that instead
* clips that were recorded to the timeline use that bpm+timesig
* in the future we can use file-metadata (acidized wave?) instead
* this is audio-only: midi files can have an embedded timesignature

but... given no other information, experience says the vast majority
of downloaded/purchased clips will be 1,2 or 4 bars at 4/4.
2022-05-14 14:16:21 -05: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
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
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
43b3ec005f temporal: use new debug bit for debug output in reset_starting_at() 2022-05-13 19:05:13 -06:00
5d22e522d1 temporal: add new debug bit for debug tracing just TempoMap::reset_starting_at() 2022-05-13 19:05:13 -06:00
45de3694cc temporal: add reimplemented version of 6.x's TempoMap::gui_stretch_tempo() 2022-05-13 19:05:13 -06:00
db9cc04230 temporal: remove debug output from TempoMap::reset_starting_at() 2022-05-13 19:05:13 -06:00
itmuckel
9178ca635a
Remove unused imports and modernize stateful.cc 2022-05-13 23:07:49 +02:00
9c9a7bbf97
Remove debug message 2022-05-13 21:02:37 +02:00
3b13dc9b54
Remove unused method declaration 2022-05-13 19:38:12 +02:00
f8aecc460c
Use new hard-stop API to stop transport before export 2022-05-13 19:38:11 +02:00
25098edfc1
Fix MIDI delaylines
MidiBuffer::read_from() clears the buffer, so events were not
accumulated into the delay-buffer.

This also includes a small optimization and comments for the
variable delayline.
2022-05-13 19:38:07 +02:00
a899136cae Fix egregious playlist copy+paste thinko
* when you copy a Range into a playlist, the playlist's 'timeline' should
 begin at the start of the selected Range.  Regions should retain the
 offset they had from the Range's start.
2022-05-13 12:05:04 -05:00
1fdfa53b9f region::absolute_time_to_region_beats() needs to incorporate start offset
* this fixes the Draw tool when adding notes;  if you tried to draw in
 a region with a trimmed front, the note would not get added in the correct
 location
2022-05-12 12:15:53 -05:00
luz paz
78f1205806 Fix typos in source foward(s)->forwards(s)
Fix source typos
2022-05-12 10:15:15 -04:00
luz paz
b3c0143df7 Fix typos in source functionmax_configurable_outputs
Fixes source typo
2022-05-12 09:18:32 -04:00
40fa6e2023
Improve PBD::Semaphore performance
Skip syscall if no threads are waiting and decouple atomic
value from futex address so that FUTEX_WAIT does not fail.
2022-05-12 05:27:27 +02:00
f849f3ce2c
Use futex semaphores on Linux only 2022-05-12 00:56:33 +02:00
13cac5c139
Grow Graph and RTTask MPMC queues as required
This fixes an issue if with sessions where a process-graph can
have more than 1024 routes to be processed concurrently.
2022-05-12 00:44:39 +02:00
5ca76789c5
Allow to query capacity of MPMC queue
This is in preparation to grow the queue as needed.
2022-05-12 00:40:31 +02:00
c87a5cdcfd
Remove mutex from RTTaskList, use MPMC queue 2022-05-11 23:55:41 +02:00
34678c094a
Implement Futex semaphore 2022-05-11 23:55:41 +02:00
luz paz
36ae8e7022
Fixed typo that may also be a bugfix 2022-05-11 00:14:28 +02:00
luz paz
1e640563d6
Fix source comment typos in libs/ardour
Found via `codespell`
2022-05-11 00:14:28 +02:00
a251ba3b76 pt_import: since we aren't using undo here, need to delete the diff_command manually 2022-05-10 15:47:56 -05:00
f50d5507c3 midi_model: rename some midi diff functions, to (try to) avoid confusion
syntax for beginning and ending a diff command is:
 "new_diff_command"  ->  "apply_diff_command"

syntax for applying a diff_command is:
 "_as_commit" :  Begins and Commits a standalone undo Command
 "_as_subcommand" :  adds to undo but does not Begin or Commit a Command
 "_only" : (new) applies the note_diff but does not have any effect on undo
2022-05-10 15:47:20 -05:00
c44d692390 Create a trap for overlapping or nested undo commands 2022-05-10 13:14:08 -05:00
a57f4fbce6 temporal: after changing a tempo point, reset the map starting at that point 2022-05-10 09:46:08 -06:00
be90b4e0ca US2400 - fix crash when no strip is selected
first selected could be null, so check that first.
This is untested since I don't have a surface.
2022-05-10 09:17:33 -05:00
834ca29cde
Silence DR after freewheel export 2022-05-10 16:01:39 +02:00
445e8c468e
Add TSFM API to immediately stop the transport
This is useful after a freewheel export, where a realtime-stop
is called, but the actual Locate/MustStop event is only processed
later. Once the session switches back to normal processing after
export the transport is still rolling, TSFM schedules a de-click
locate. This may play some remaining audio.

This new API allows to hard stop the transport, without going
via any session-events and process_with_events. It is intended to
be called from the freewheel process-callback in the last export
cycle.
2022-05-10 16:01:39 +02:00
2fc43c59c4
Fix audible hiccup at end of realtime export 2022-05-10 16:01:39 +02:00
1809b6ae9a
Reset port resampler after freewheeling
This clears out any data potently left there by export processing.
Previously this could cause an audible click.
2022-05-10 16:01:39 +02:00
a97e910b70
Debug efficiency of latency and graph order callbacks 2022-05-09 17:39:05 +02:00
3f1420880b
Implement IOPlug processing using the Process Graph 2022-05-09 17:39:05 +02:00
af6f8abdc7
Prepare IOPlug processing as GraphNode 2022-05-09 17:39:05 +02:00
c45a6b80c7
Session support to add/remove save/load IOPlugs 2022-05-09 17:39:05 +02:00
74f71c6683
Session-wide plugin support (IOPlug)
The idea is to run a plugin outside the process graph, and provide
its I/O as port (much like an external JACK app).

The intended use-case is NDI (provide additional I/O), but it could
also be useful for other cases.
2022-05-09 17:39:05 +02:00
8a90d4a414
Fix another possible memory leak in BPM detection code 2022-05-09 17:34:59 +02:00
f0a8b8cd6d
Fix an unlikely memory leak in zita-resampler 2022-05-07 04:19:16 +02:00
221975a982
Fix memory-leak in BPM detection 2022-05-07 04:19:12 +02:00
46117303da
Fix some potentially uninitialized variables 2022-05-07 04:19:09 +02:00
f5b280a850
Generalize graph processing
This allows to pass any GraphChain to the Graph to process.
It removes the need to use a mutex to swap two dedicated
chains (setup-chain <> active-chain, pending-chain).

Also various special cases pertaining to graph interaction
while auditioning and route-deletion can be removed.

This also unconditionally creates a graph-thread for GraphChains
to be processed, even if the main callback uses a special-cased
sorted RouteList if there is only one process thread.
2022-05-06 17:43:01 +02:00
5fa7d481c1
Optimize Route::direct_feeds_according_to_reality
Consolidate duplicate function calls, cache result in local variable.
2022-05-06 14:02:35 +02:00
44bb8caa65
Use new Route fed-by API (2/2) 2022-05-06 14:02:35 +02:00
9ad154f265
Untangle Graph from Route
The process-graph should only be concerned with GraphNodes,
which may or may not be Routes.

This also removes intrinsic connection information from
the graph-node. Connection information is to be kept separate
from the nodes.

When the graph is re-calculated in the background, old information
has to be retained until the new graph becomes active.

Previously *new* information was already stored in the nodes
while the graph is sorted, even though the new graph was not
active.
2022-05-06 14:02:34 +02:00
3862d13e21
Prepare for GraphNode::feeds () and fed-by API update (2/2) 2022-05-06 14:02:34 +02:00
078e652859
Implement rt-safe deletion - delegate to butler 2022-05-06 14:02:32 +02:00
226dadbd19
Further reduce DSP load of debug builds
In all years of using these assert()s never triggered. Besides
there are valid_port() tests in other strategic locations that
are not periodically hit in realtime context.
2022-05-06 02:04:55 +02:00
ed21ea8fc6
Speed up valid-port changes O(n) -> O(log(n))
This significantly reduces DSP load of sessions with many ports
when using debug builds.
2022-05-06 02:04:49 +02:00
37c0fceeac
Prefer comparison operators as part of the class 2022-05-06 02:04:43 +02:00
ce95c9fb09
Fix std::set< BackendPortPtr> lookup by key
The set uses a custom sort-by-name comparator.
Previously it was possible to have an inconsistent set iterator.
std::set::find() did not find a given port while std::find() did.

This fixes using std::set::find() on the PortIndex set.
2022-05-06 02:04:33 +02:00
668cb1ca3b
Set names of RT tasks threads 2022-05-05 00:54:47 +02:00
6c2c3a49c4
Update comment about required buffers 2022-05-05 00:54:47 +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
28231d6365
NO-OP: cleanup public API, re-indent source 2022-05-04 05:58:06 +02:00
96c138c985
ALSA: prevent excessive slave-device latency updates on underrun 2022-05-04 05:57:52 +02: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
Caleb Potter
b689d2881e M: US2400: allows user to bank over sends while in TrackView.
Sends only appear on the last 8 vpots, which means sends to matrices 9-12
are unreachable without banking.
2022-05-02 22:41:40 -06:00
Caleb Potter
20fff72370 US2400: Use Bank- and Bank+ to page over sends on pots 2022-05-02 22:41:40 -06:00
Caleb Potter
0d05cd231b US2400: maps track parameters and sends to vpots
Pots 0-4 now display the 5 parameters from the Mackie track subview when a
track is selected and pots 8-23 will display up to the first 16 sends.
2022-05-02 22:41:40 -06:00