Commit Graph

19532 Commits

Author SHA1 Message Date
e6570b2247
No longer save deprecated property
Now that the session-state version has changed, it is no longer
required.
2022-07-12 21:08:41 +02:00
b77eedf53e
Suggest WinMME as default (enable MIDI by default) 2022-07-11 21:45:55 +02:00
fe6aa0610c
ALSA: suggest ALSA Sequencer by default 2022-07-11 21:45:54 +02:00
82bdddb829 fix Follow-Count widget in clip properties GUI
* add follow_count to all_trigger_props so widget gets updated on selection
2022-07-08 11:10:46 -05:00
97317f3f86 triggerbox: correct an error in the computation of "frames covered" for audio triggers 2022-07-07 16:45:01 -06:00
4a30d8cebb NO-OP: add copyright notice 2022-07-07 16:45:01 -06:00
25d1209bb4
Only dump SessionEvent pool in debug builds
This ensures that the user will see a "POOL OUT OF MEMORY" message.
In rare case dumping the pool can segfault when printing the Event,
The pool is zero initialized and only ever contains events, so
in theory it is safe to print them..
2022-07-07 22:34:11 +02:00
ef2c1d990b
Prevent accumulating events during freewheel export
When exporting many ranges, locate and restarting transport for
every ranged a SessionEvent::TransportStateChange event is queued.
Since freewheel export does not process events. Those events
can accumulate:
https://discourse.ardour.org/t/pipewire-jack-export-freeze/107383/18?u=x42

During export those requests can be safely ignored because the only
purpose is to emit a TransportStateChange() signal when the playhead
passes a given location and notify the UI.
2022-07-07 18:28:27 +02:00
9e11ef4f39
MixerScene: handle edge-case with midi-cc/bender controllables 2022-07-07 16:06:08 +02:00
effc209070
Place Pool in PBD namespace
A public class named "Pool" in the global namespace just
calls for symbol name conflicts.
2022-07-07 05:21:54 +02:00
8418e7c954
NO-OP: clang-format 2022-07-07 05:21:49 +02:00
a8a4695466
Dump SessionEvent cross-thread pool when it overflows 2022-07-07 05:21:44 +02:00
1694c71cd5
Implement memory-pool debug-dump
This will allow to trace "POOL OUT OF MEMORY" and see
which events fill up the event/memory pool.
2022-07-07 05:21:31 +02:00
87d17f6624
Prevent rendering outside of canvas scroll groups
This fixes automation lanes bleeding into the ruler area.

The bounding box of all items in the main canvas group starts
at -0.5, and the cursor-scroll-group at -1.5. This is calculated
to include line-width, and outlines outside the item(s).

A scroll-group however must not extend its render area to
render those.
2022-07-06 20:50:03 +02:00
0d70be3a05 miscellaneous fixes for warnings from -Wconversion 2022-07-04 22:01:48 -06:00
b5947dd0a8
Use AudioTime for region-fade envelopes (see also 86e6df15cc) 2022-07-04 18:05:46 +02:00
cc07cde142
Simplify 86e6df15cc using a dedicated method 2022-07-04 18:05:43 +02:00
86e6df15cc
Fix region-gain when region is glued to bar/beats
The region-gain envelop is an Automation list that uses AudioTime
regardless of the regions own position.

Since the actual audio data is using always using samples this
results in reliable envelopes without the reduced granularity of
BeatTime.

All points the list have to be in the AudioTime domain.

Previously it was possible to have a mixed-domain list e.g.

- add 2h:30min long source
- lock it to music-time
- set grid and snap to 1/8 note
- range select some range shortly after 2:25
- draw region-gain for range

<events>
a0 1
a492113664000 1.0000001192092896
a492113737500 0
a494032822500 0
a494032896000 1.0000003048365
b34560000 1.0000003048365
</events>
2022-07-04 00:58:07 +02:00
d932d9365f fix crash in a debug build caused by trying to print debug info about a negative time value that will never be used 2022-07-03 16:53:30 -06:00
0295e05d04
Force latency update callback after measuring port-insert latency 2022-07-03 02:16:11 +02:00
c6566f3933 mackie protocol: add more null checks; remove some debug msgs 2022-06-30 16:47:17 -05:00
198df78cfe mackie debugging: ugly printouts 2022-06-30 14:04:51 -05:00
66bd195030 mackie protocol: potential crash-fix 2022-06-30 11:30:07 -05:00
13de664ae6
Provide jack2 compatible implementation for jack1
jack1 (which is Linux only) does not have a jack_client_stop_thread
API, and expects the application to call pthread_join().

This fixes an issue when the application is compiled using jack2 headers
but the application later runs using jack1's library.
2022-06-30 17:19:57 +02:00
1f6abbb756
Comment-out unused timepos_t modulo operator which is not implemented 2022-06-30 01:47:42 +02:00
f67e731a7f
Prevent session-range changes to create invalid loop ranges
When a session-range coincides with a loop-range location, moving
the session-range also updates the loop-range.

Keeping session and loop-range in sync can be useful if the whole
session is looped. However markers are treated individually, so
we need prevent invalid ranges.

If session-start and loop-start coincide, but loop-end is before the
end-marker, it is possible to move session-start beyond the loop-end.
2022-06-30 01:07:32 +02:00
3bcf75a35a
Remove Range::squish debug information, used fixed modulo operation 2022-06-30 01:07:32 +02:00
2c1f36201c
Fix timecnt_t modulo operation when mixing time-domains 2022-06-30 01:07:32 +02:00
ca49bc00f0
Remove old "user" API, use consistent get/set_double() 2022-06-29 01:39:02 +02:00
3623b39168
Replace ::user_double() with ::get_double() 1/2 2022-06-29 01:39:02 +02:00
a4a241c738
Prepare replacing ::user_double() with ::get_double()
Automation Controls (and controls in general) are now
only updated in realtime context. Either via automation-playback,
or via SessioEvent. This directly sets the Control:_user_value
(before emitting the Changed signal).

The GUI does not need to evaluate the control at a given point
in time, so the API call can be removed and unified.

This commit first removes all calls to "get_double" to ensure
that no special cases exist.
2022-06-29 01:39:02 +02:00
5cb6e1046b
Fix automated controllable display value
::automation_run() evaluates the value, possibly ahead of time
depending on latency-compensation. The actual value is set in
realtime-context via set_value_unchecked() -> actually_set_value()
which emits the Changed signal.

At this point in time Control::user_value is already set correctly.
There is no need to evaluate and interpolate again, at a potentially
incorrect (uncompensated) time: `_session.transport_sample()`.

This fixes an issue with the GUI Automation control showing an
outdated value when there is an "immediate jump" in the signal:
eg. add a latent plugin post-fader, then automate the Fader to jump
from 0dB to -inf dB (snap to grid) and play though that transition.

(Plugin controls were not affected by this bug, the process
cycle is split for those, but Mixbus internal AC were affected).
2022-06-29 01:39:02 +02:00
7a01f3cbcd
Fix automated fader display value (use cycle-end value) 2022-06-29 01:39:01 +02:00
b0b7750bc7
NO-OP, use default argument 2022-06-29 01:38:55 +02:00
ee350362d3
Debug loop range squishing
When the loop-range is defined in BeatTime, the disk-reader encounters
rounding issues due to time-domain mismatches.

With a simple session fixed BPM at 120,  48kHz.
looping 1 bar exactly 2 sec at the start of the session:
```
 Range::squish start: b0 end: b7680 squish: a113554560
 Range::squish using modulo:       b45 = a661500
 Range::squish using modulo in TD: a5760
 Range::squish using earlier():    a658560
```
The correct answer is a113554560 - 2 * 56448000 [SC/sec] = a658560

Calculating the modulo iteratively is not great, however usually
only one iteration is required.
2022-06-28 03:01:41 +02:00
873f78de78 NOOP: rearrange code DiskReader::get_midi_playback() to follow the "early exit for conditional" style guide 2022-06-25 13:36:55 -06:00
64f9829b56
AudioBackends: ignore setting latency of invalid port(s) 2022-06-24 19:55:17 +02:00
fe0e997335
Backend: prefer debug_msg over PBD::Transmitter in threads
PBD::Transmitter is neither thread-safe nor rt-safe. This likely
fixes a crash on macOS when process-threads are started.
Many threads simultaneously enter coreaudio_process_thread() and
log a message calling `PBD::info << .. << endmsg` simultaneously.
2022-06-24 19:27:57 +02:00
9ab32d7cb4
Fix builds on platforms without execinfo (amend cd4549aff7) 2022-06-23 01:59:58 +02:00
5831ddd40b amend b30ac5e221 to actually replace the assert with a return 2022-06-22 16:09:38 -06:00
0d9656ef82 use new macros to cleanup #ifndef NDEBUG as much as possible (libs edition) 2022-06-22 13:31:08 -06:00
0004ca2c41 add useful DEBUG_RESULT and DEBUG_RESULT_CAST to pbd/debug.h 2022-06-22 13:31:08 -06:00
d917d7b351 fix actual x_assert macro definition 2022-06-22 13:31:08 -06:00
df641765ec add new header for x_assert() macro 2022-06-22 13:31:08 -06:00
4599b07217 fix optimized unused variable warning 2022-06-22 13:31:08 -06:00
046cdf1295 fix unused variable warning by removing it. 2022-06-22 13:31:08 -06:00
41948821e2 fix optimized unused variable warning 2022-06-22 13:31:08 -06:00
ebb9d3d4dc fix optimized unused variable warning 2022-06-22 13:31:08 -06:00
26d2c8a7fa handle compiler stupidity with early return 2022-06-22 13:31:08 -06:00
bb5798ee66 fix may-be-used-unset warning and bizarre brace/indent style 2022-06-22 13:31:08 -06:00
6fd4c01fc9 fix optimized unused variable warning 2022-06-22 13:31:08 -06:00
4878c48386 fix optimized unused variable warning 2022-06-22 13:31:08 -06:00
7a32ff33d4 handle compiler stupidity with early return 2022-06-22 13:31:08 -06:00
f7b91d577b handle compiler stupidity with early return 2022-06-22 13:31:08 -06:00
9922daf284 handle compiler stupidity with early return 2022-06-22 13:31:08 -06:00
24f1a65d5f use C style cast in C code, rather than C++ constructor 2022-06-22 13:31:08 -06:00
48a109e8c8 fix snprintf buffer size warning 2022-06-22 13:31:08 -06:00
660d2fc8ab fix strncpy() size argument error (Windows only, needs review) 2022-06-22 13:31:08 -06:00
9b80d6558a fix optimized unused variable warning 2022-06-22 13:31:08 -06:00
ad8e1c1cfd fix optimized unused variable warnings 2022-06-22 13:31:08 -06:00
45403dd2f1 fix may-be-used-unset warning 2022-06-22 13:31:08 -06:00
b30ac5e221 replace unnecessary assert(0) with return; 2022-06-22 13:31:08 -06:00
4ee854e7df fix optimized unused variable warnings 2022-06-22 13:31:08 -06:00
123cc92fff fix may-be-used-unset warning 2022-06-22 13:31:08 -06:00
7436a110dc fix optimized unused variable warning 2022-06-22 13:31:08 -06:00
ecefe29d5e fix optimized unused variable warnings 2022-06-22 13:31:08 -06:00
6fdd745dc5 fix may-be-used-unset warning 2022-06-22 13:31:08 -06:00
311e36b28f fix optimized unused variable warnings 2022-06-22 13:31:08 -06:00
168b540959 fix optimized unused variable warning 2022-06-22 13:31:08 -06:00
0e1f62e605 fix optimized build unused variable warnings and abort not assert 2022-06-22 13:31:08 -06:00
f1a24fac98 fix optimized unused variable warning 2022-06-22 13:31:08 -06:00
f78d384281 fix may-be-used-unset warning 2022-06-22 13:31:07 -06:00
1e09e0f6fa fix may-be-used-unset warnin 2022-06-22 13:31:07 -06:00
ed645761d0 fix optimized unused variable warning 2022-06-22 13:31:07 -06:00
ae9c11fb01 fix redefined CANVAS_DEBUG warning 2022-06-21 17:35:01 -06:00
670b1fe3e2 fix initialization order warning 2022-06-21 17:34:48 -06:00
ac18b84351 remove always-true-condition from if() to avoid compiler warning 2022-06-21 17:34:09 -06:00
b51c4b7ef9 fix signed/unsigned warning 2022-06-21 17:33:37 -06:00
181f40a349 fix signed/unsigned warning 2022-06-21 17:33:22 -06:00
83b5fdf569 fix unused code warning 2022-06-21 17:33:04 -06:00
cd4549aff7 fix signed/unsigned warning 2022-06-21 17:31:50 -06:00
dc4235efbe fix left-shift of negative value warning 2022-06-21 17:31:17 -06:00
e2ef135161 remove unused warning 2022-06-21 17:30:59 -06:00
f679da4e1e simplify implementation of Beats::operator%= (Beats) 2022-06-21 14:46:20 -06:00
5d81535588 remember to use muldiv() when doing a*b/c; also no need to call to_ticks(), just use _ticks 2022-06-21 14:46:20 -06:00
1be136adbd allow construction of Beats with a beat count that exceeds INT32_MAX 2022-06-21 14:46:20 -06:00
d6d9792dcb fix construction of Beats from an int64_t that exceeds INT32_MAX 2022-06-21 14:46:20 -06:00
71ee12af6a
Add API to format keyboard modifiers for tooltips 2022-06-21 22:11:49 +02:00
5b03bf72fa
NO-OP: code style 2022-06-21 22:11:08 +02:00
af38528174
Physical modifier abstraction is constant 2022-06-21 22:09:54 +02:00
8a5fc65df4
Expose newly added semantic modifiers 2022-06-21 21:38:37 +02:00
3266b1acb0
Add API to query currently held modifiers keys 2022-06-21 21:37:14 +02:00
f1eb45e129
NO-OP: clang format 2022-06-21 21:37:08 +02:00
696e05c3e5 convert internal implementation of Temporal::Beats to just use a 64 bit tick value
This expands significantly the maximum number of Beats that can be represented, which is a good
thing in itself. It slightly speeds up some Beats::operator methods, and slightly slows down
::get_beats() and ::get_ticks().

One minor change in an API user was required, and several tweaks to the unit tests due to the
macros being used by cppunit creating possible type confusion.

Units test pass
2022-06-21 12:26:54 -06:00
4661957091
Re-establish 47932fb7bf (which was lost in e557245bf7) 2022-06-21 20:17:01 +02:00
e557245bf7 implement group_override_modifier() (lib part)
Consistently use Tertiary for Group Override on all platforms (and be consistent about it)

Consistently use Primary-mod for Momentary on all platforms (partially reverts 47932f)
Primary modifier is used for fine-adjust on knobs and sliders, with no analogous operation on switches.
2022-06-21 13:01:30 -05:00
4dbdaf7fe9 fix possible negative return from TempoPoint::quarters_at_superclock() 2022-06-21 11:39:10 -06:00
47932fb7bf
Only special case middle-click modifier for macOS by default 2022-06-20 23:30:45 +02:00
bbb0b78a50 fetch thread local tempo map in potential peak-building threads 2022-06-20 14:25:40 -06:00
4825d67c4a
Fix record w/count-in
The pre-nutemo code used fmod() to calculate the offset into the bar:
`bar_fract = fmod (barbeat, 1.0); // fraction of bar elapsed`
with nutempo, beats start at 1, and the tick offset must also be
taken into account.

The bug was introduced in f67029bd0
2022-06-20 21:15:00 +02:00
65b7b3f2eb fix unset per-thread tempo map in AutomationWatch thread 2022-06-20 08:43:00 -06:00
0f2c3bf9c9
Fix mp3 export on big-endian systems 2022-06-20 16:05:28 +02:00
35612d26c6
Unify ::get_buffer, remove debug code 2022-06-18 22:54:09 +02:00
32161cf154
Fix valid_port race/crash when ranaming ports
PortIndex is sorted by name, and uses port-name as unique identifier.

Ports can be re-named concurrently with processing.
::set_port_name() updates the RCU in the background. The engine
may concurrently process with an old RCU reader value.

In this case valid_port() failed in the process-callback.
and ::get_buffer() returned NULL
2022-06-18 22:54:08 +02:00
fd9a76073b modifiers: add momentary_push_name (for tooltips) 2022-06-17 11:07:58 -05:00
12e703414d modifiers: make a new abstraction for momentary-click, instead of button_2 (lib part)
is_button2_event()  was used to detect the user's desire for a
  momentary-click on some buttons (mute, solo, mixer scenes)

is_momentary_push_event() disambiguates this action from is_button2_event()

for the special case of momentary, we can drop the workarounds for
  the lack of middle-mouse buttons on Mac, and instead just use
  shift+left-click on all platforms.
2022-06-17 11:07:49 -05:00
71833911a4 modifiers: publish button2_name (for use in tooltips) 2022-06-17 10:52:06 -05: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
d66bda9f07 mackie send subview: potential fix for send-enable banking (vpot push) 2022-06-16 13:27:30 -05:00
7e039d4f3f
Cleanup: retain sources used by triggers in this session
Note that ::find_all_sources_across_snapshots() finds and retains
all sources in the SourceList of other snapshots regardless
if they are used in those snapshots.
2022-06-16 20:03:58 +02:00
9964f20c63 when creating a session without a template, reset tempo map to default 2022-06-16 10:36:18 -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
41bce61552
Cleanup bindings key replacement arrays 2022-06-15 15:32:39 +02:00
047296060f
Fix printing keybindings #8924 (brace/bracket mismatch) 2022-06-15 15:28:57 +02:00
d037dff213
NO-OP: comments and cleanup 2022-06-15 14:16:16 +02:00
471330a292
Fix uninitialized variable (leading to crashes when adding routes)
A route may be processed before latency-compensation callback
sets the route's output_latency. In this case a random offset
was added to the start/end position (via latency_offset).
2022-06-15 14:15:24 +02:00
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