13
0
Commit Graph

20362 Commits

Author SHA1 Message Date
b66bb61650 audioengine thread(s) should have their actual numbered name 2023-04-21 12:16:37 -06:00
074516cdb4 libpbd: provide access from a ScopedConnection to the underlying UnscopedConnection 2023-04-21 12:16:37 -06:00
5dc75694f0 libpbd: fix return type of Signal<>::size() 2023-04-21 12:16:37 -06:00
70e56ba4e9
Amend 2f3841a8, fix Mixbus build 2023-04-21 03:01:26 +02:00
Nil Geisweiller
57a5f96a98
NO-OP: use Tab to indent 2023-04-21 01:00:41 +02:00
Stefan Westerfeld
55dc3113f3
ace-fluidsynth: fix free_path initialization in save 2023-04-21 00:58:24 +02:00
2f3841a81d
Add support for MIDI subgroup busses
This also fixes the channel-count use by the bus,
depending on the type (aux or direct out).

Mixbus detection is also moved from the GUI to the
backend.

This also limits the number of subgroup busses to one,
so that "Remove subgroup bus" works properly.
Eventually we should allow multiple subgroup busses
for aux-sends.
2023-04-21 00:40:59 +02:00
d2a4e0ac9a import_pt: Fix PT import to session with existing tracks
Previously, the PT import would place regions on tracks
numbered from 0, therefore landing on unrelated tracks
when pre-existing tracks were present in the session.

This change skips all existing ardour tracks and imports
the PT regions onto the correctly named, appended tracks.

If any tracks exist with the same names as the ones in the import,
the new tracks get an incremented number at the end of them and
the imported regions are placed on the new track, as expected.
2023-04-20 15:45:32 +10:00
03b4635bea
Fix a small memory leak 2023-04-19 14:20:48 +02:00
7094c82e75
Add Lua bindings to std::shared_ptr<T const>
This is required after the recent RCU change to return
const shared pointers for read (295dbd8e1).
2023-04-19 01:46:58 +02:00
9f52bc05de fix a minor conflict after reverting a couple of commits 2023-04-18 13:48:59 -06:00
6cc116e6de Revert "add ProcessedRanges element to Session and update its contents appropriately"
This reverts commit 33047987a7.
2023-04-18 13:48:59 -06:00
909a2ad639 Revert "modify API of MIDI Clock ticker to use ProcessedRange"
This reverts commit 720102f98a.
2023-04-18 13:48:59 -06:00
328b4f2d1a Revert "further steps towards correct (or more usable) MClk output"
This reverts commit fe6beee68e.
2023-04-18 13:48:59 -06:00
d66f3e7c9d temporal: factor out twist iteration, add debug output 2023-04-16 10:33:37 -06:00
f29557348e remove debug output 2023-04-13 17:47:32 -06:00
b362d2b6ba temporal: don't abort() for illegal omega value, just leave it as it was 2023-04-13 10:57:12 -06:00
dbc3008163
Add Lua Bindings for const shared_ptr lists (295dbd8e1e) 2023-04-12 20:47:35 +02:00
c3102ab8a5
Add preference to set PPQN of exported MIDI files
This also changes the default from 19200 to 1920
2023-04-12 13:12:41 +02:00
def884e26c remove debug output 2023-04-10 09:18:44 -06:00
f17a516cef temporal: fix comment explaining when/how TempoMap::set() can be used 2023-04-10 09:18:44 -06:00
a1e9dfb672 canvas lineset: C++11-ification 2023-04-10 09:18:44 -06:00
4f87506e5c do not sort lineset every time a coord is added; use RAII to create scope and sort at end 2023-04-09 14:36:03 -06:00
dde366d6ef
Fix Wreturn-std-move 2023-04-09 00:52:29 +02:00
4b1d5d9b63
Resolve boost/std unique_ptr issue 2023-04-08 13:31:50 +02:00
a27a88f9f2 import_pt: Update session range to largest audio extents imported
Tested before and after on a small audio-only PT8 session;
session range gets set to [0 to max] extent with this change.
2023-04-08 18:35:26 +10:00
295dbd8e1e
Make RCU reader return a const pointer (omnibus commit) 2023-04-08 00:15:37 +02:00
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
f3e13848fa
Do not modify read-only RCU copy of routelist
RCU reader returns a shared ptr to the current object which
can also be used in other places at the same time.

Sorting the shared-ptr list invalidates iterators which can
throw off other users of the same object.

This fixes a bug in PT-import which calls get_nth_audio_track().
2023-04-07 19:37:30 +02:00
979f9876a7
VST3: skip redundant parameter-changes
This reduces initial parameter-changes during session-load
due to Controllable (PluginControl) state restore after
restoring the plugin state. This likely fixes #9287
2023-04-07 00:23:39 +02:00
2713c40b7d extend midi-controllable params with new well-known-controls 2023-04-06 14:52:09 -05:00
8b59bf47df
Add a dedicated PlaylistSet type
This is to consolidate various locations that use
`typedef std::set<std::shared_ptr<Playlist>>`
throughout the codebase.
2023-04-06 02:12:32 +02:00
0b8d5d3dc5
Tweak Window system-exec, wait for process to terminate 2023-04-05 00:16:37 +02:00
d09c049fee
Clarify plugin scan log message 2023-04-05 00:16:37 +02:00
d9c35199cc CoreAudio: Update latency when buffesize changes 2023-04-04 19:26:17 +02:00
112bf87436
VST3 scan, do not clutter up Log
This prevents excessive "Cache file is valid and up-to-date."
messages in the log window. - Plugin manager has verbose log.
2023-04-04 15:44:21 +02:00
850cf3e035
Add vst3/win debug messages to investigate #9273 2023-04-04 14:00:46 +02:00
29c6817599
Check that export-channel is not empty 2023-04-04 01:35:27 +02:00
473f575a05
Catch Glib::ConvertError when checking for files
This fixes some edge-cases when scanning recent sessions
in get_state_files_in_directory() and likely some other
places that use run_functor_for_paths in case the folder
contains files with non UTF-8 names.
2023-04-03 22:10:11 +02:00
2c4d1e011c
CaptureProcessor should not be reused
This lead to potentially silent stem-exports. It
should not be possible to hold a shared-ptr reference
of a processor that is not part of the processor chain.
2023-04-03 16:01:24 +02:00
a3a30e39df
Fix silent stem export channels (#9294)
When toggling a channel-configs the following happens:

 1. TrackExportChannelSelector::update_config
 2. ExportProfileManager::clear_channel_configs
 3. RouteExportChannel::create_from_route
[...] CriticalSelectionChanged
 4. ExportDialog::update_warnings_and_example_filename
 5. ARDOUR::ExportProfileManager::get_warnings
 6. ARDOUR::ExportProfileManager::build_filenames
 7. ARDOUR::ExportFilename::set_channel_config
[...]


Step 3 creates a RouteExportChannel, Step 7 retains a
shared-pointer to it in the config's ExportFilenamePtr.
When toggling another channel: step 2 release the reference
and step 3 creates a new RouteExportChannel.
This new channel reuses the existing Route::_capture_processor (!).

Now Step 7 releases the first RouteExportChannel in order
to get_warnings for the new one. Since ExportFilenamePtr holds the
the last reference, the d'tor of RouteExportChannel runs,
which removes the capture-processor from the route.

The newly created RouteExportChannel now has a reference
to a CaptureProcessor that is not in the signal-flow.


Note: the order of adding/removing RouteExportChannel matters.
With a two track session:
 * Disable "with track/bus processing
 * Enable Track 1
 * Enable Track 2
 * Disable Track 1
 * Enable Track 1 // << Track 2 becomes silent
2023-04-03 15:53:50 +02:00
9b23587886
Add missing processor-locks to iterate over processors 2023-04-03 15:17:12 +02:00
b03358615c
NO-OP: whitespace (re-align after boost:: -> std::) 2023-04-03 00:17:37 +02:00
4ba1ccc09b
NO-OP: use Tab to indent 2023-04-01 17:21:32 +02:00
a6401763a3
Fix interpolation when iterating over sequence (#9288)
When a control-point is exactly at tick (N * 8), iterating
over the List (Sequence<Time>::const_iterator::operator++)
skipped the point.

Sequence::time_between_interpolated_controller_outputs == 8.
2023-04-01 17:21:04 +02:00
9e0c1ff510 Revert "canvas: when an item is shown, potentially pick it as the current item"
This reverts commit 37cae2f971.

This changes causes issues with recursive calls to the enter/leave event handling
stacks in gtk2_adour. Semantically, the change makes perfect sense, but finding
a solution to the recursion is challenging.
2023-03-30 09:54:56 -06:00
151fceea54
Add missing include
This fixes "error: ‘isfinite’ was not declared in this scope"
2023-03-30 01:10:23 +02:00
32be8aa96a
Fix veclib_find_peaks interface
vDSP_maxv, vDSP_minv set the return value to -INFINITY
or INFINITY respectively before starting to process.

Ardour expect the value to be input values to be part of the set.

https://developer.apple.com/documentation/accelerate/1450621-vdsp_maxv?language=objc
https://developer.apple.com/documentation/accelerate/1450267-vdsp_minv?language=objc
2023-03-30 01:04:40 +02:00
ef7b7f4c89
Fix timecnt_t less-than-equal operator 2023-03-30 00:37:23 +02:00
8c2454238e
Remove explicit well-known ctrl enum string functions
This is better provided by Plugin::print_parameter, which
is called by PluginControl::get_user_string(). This removes
special cases for the mode enums.
2023-03-29 17:32:22 +02:00
c1d6456d58
FP8: fix duplicate makeup control 2023-03-29 16:39:32 +02:00
f2a07e711d Fix the incorrectly generated Korean translation 2023-03-28 02:42:33 +02:00
Xavi Ivars
3d360b9ea1 gtkmm2ext Catalan file 2023-03-28 01:39:54 +02:00
886d7b9069
FP8: update for Mixbus v9
* add expander/gate
* show/hide mixer-strip controls
* add plugin-presets for channelstrip (if any)
2023-03-28 00:32:02 +02:00
9ef6ee21de
FP8: show value as formatted by the plugin 2023-03-28 00:31:45 +02:00
fe6beee68e further steps towards correct (or more usable) MClk output 2023-03-26 22:30:30 -06:00
1dce50e787
Fix another CAS (amend 4ba4cd69ff) 2023-03-26 22:16:47 +02:00
e36938f305
Fix peak-meter atomics (amend 4ba4cd69ff) 2023-03-26 20:37:25 +02:00
305606ed24
Document export-graph signal flow 2023-03-25 18:24:06 +01:00
John Emmas
c771eccd0e 'Temporal::DomainSwapInformation' needs to be exportable 2023-03-25 12:29:17 +00:00
168c439ee8
Fix vfork wrapper for macOS 2023-03-25 07:46:47 +01:00
4b5333a721
Disambiguate export formats with different encoder settings
Disambiguate export formats with different encoder
qualities, sample-formats or settings (wav/bwav).

This allows to export multipe mp3 with different bitrates.
2023-03-25 06:43:46 +01:00
3715154a8e
Allow concurrent child processes
When multiple child processes are running, closing the
stdin of one child did not send EOF or cause POLLNVAL,
as long as a dup()'ed filedes still existed.

This fixes an issue when running an mp3 encoder while the
video monitor is visible, and will allow to concurrently
run multiple mp3 encoders or other child processes.

Previously this caused Ardour to hang indefinitely in CmdPipeWriter
```
 _proc->close_stdin();
 _proc->wait(); // << here
```
2023-03-25 06:43:46 +01:00
70df054d68 try to patch over some type confusion 2023-03-24 17:27:49 -06:00
8075b55919 Fix amiguity in atomic load
operator _Tp() const volatile _NOEXCEPT {return load();}
operator _Tp() const _NOEXCEPT  {return load();}
2023-03-25 00:07:56 +01:00
b18fe9f412 add method accidentally removed during rebase with spp-atomic 2023-03-24 16:35:18 -06:00
dad40f960d fixup various mistakes when rebasing boost->std shared_ptr changes 2023-03-24 14:19:16 -06:00
720102f98a modify API of MIDI Clock ticker to use ProcessedRange
This solves the faulty MClk output when we locate due to a loop end.
2023-03-24 14:19:16 -06:00
bcc1aeeb86 change MidiClockTicker to use Session& not Session* 2023-03-24 14:19:16 -06:00
33047987a7 add ProcessedRanges element to Session and update its contents appropriately 2023-03-24 14:19:16 -06:00
af37406ed8 new data type to describe sample ranges processed during Session::process 2023-03-24 14:19:16 -06:00
5dbbac0bc2 temporal: operator<< for Range and RangeList 2023-03-24 14:19:16 -06:00
393929a55b tempo twisting: various fixes and improvements to core logic 2023-03-24 14:19:16 -06:00
edca8209aa canvas: fix debug output after auto-fication 2023-03-24 14:19:16 -06:00
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
3036414e08 tempo: auto-fication of another loop 2023-03-24 14:19:16 -06:00
37cae2f971 canvas: when an item is shown, potentially pick it as the current item 2023-03-24 14:19:16 -06:00
b36a0493df tempomap: use muldiv_round() not int_div_round to avoid errors 2023-03-24 14:19:16 -06:00
45490bf43f more functional tempo mapping 2023-03-24 14:19:16 -06:00
d513653912 API development for time domain flipping 2023-03-24 14:19:15 -06:00
1cd1430975 skeleton code for global temporal domain change during tempo mapping 2023-03-24 14:19:15 -06:00
5c69aef56e add memory fences to try to avoid a conceptual memory ordering issue between capture & the butler 2023-03-24 14:19:15 -06:00
4137271188 int62_t: use explicit memory order for all loads and stores
Also, improve implementation of CAS loops for operator <X>=.

Ideally, we ought to test this on ARM, both before and after.
2023-03-24 14:19:15 -06:00
fe17b98079 use explicit memory order for rcu reader/write exclusion 2023-03-24 14:19:15 -06:00
d601e78e06 signed/type mismatch fix 2023-03-24 14:19:15 -06:00
9e4d7e3224 comments and reordering for atomic fencing on dsp filter 2023-03-24 14:19:15 -06:00
a486fba3e9 std::atomic - 2nd batch of changes to convert from glib to std::atomic 2023-03-24 14:19:15 -06:00
4ba4cd69ff switch from glib atomic to std::atomic (libs edition) 2023-03-24 14:19:15 -06:00
d7922738f0 add required glib-atomic-related header, after rcu change 2023-03-24 14:19:15 -06:00
945c19b8b4 libpbd: make RCU more C++-ish 2023-03-24 14:19:15 -06:00
b35518e212 switch from boost::{shared,weak}_ptr to std::{shared,weak}_ptr
This is mostly a simple lexical search+replace but the absence of operator< for
std::weak_ptr<T> leads to some complications, particularly with Evoral::Sequence
and ExportPortChannel.
2023-03-24 14:19:15 -06:00
90c5524e7b libbd: add required <cassert> include 2023-03-24 14:19:15 -06:00
39ed528e25 std-ize: convert all boost shared/weak ptr includes to <memory>
Also fix stdint.h -> cstdint and alphabetically order std includes
2023-03-24 14:19:15 -06:00
197157ecf8
Fix concurrency issue when adding/removing ports of latent plugins
This fixes an issue when changing port-configuration
or toggle strict-i/o of latent multi-out plugins.

`Session::auto_connect_thread_run` can run concurrently
while ports are added/removed from the GUI thread.
The latter invalidates IO::_port PortSet, while
the former thread iterates over ports.

This also changes the IO-Mutex into a RWLock to allow
concurrent access when possible.
2023-03-22 22:06:38 +01:00
5453e6f1f7
Fix distance calculation during relayer (#9286)
Due to rounding (r->position_sample() - start.samples())
can become negative even if (r->position () >= start).

with k = start_division and start_division < 0 this
caused an invalid vector access `layers[j-1][k]`.
2023-03-22 01:42:14 +01:00
73bc7e6cb7 temporal: fix ::get_tempo_and_meter() for BBT arguments 2023-03-19 10:13:06 -06:00
c3c44d61a4
VST3: fix typo in 03263950b, use plugin's SpeakerArr
This fixes a crash in some plugins (e.g. Auburn Sounds Couture)
when disconnecting all inputs (e.g. moved before a synth).
Previously run was called with numChannels = 0
Even though the plugin refused to be configured that way.
2023-03-19 01:22:13 +01:00
5be4674adb
NO-OP: clang-format 2023-03-17 16:00:07 +01:00
2a3eb6dc88
VST3: match pin-mapping with VST speaker-arrangement
This enables all channels left of the last connected pin
for each given bus. e.g. when using just the 2nd (right)
input of a given bus, the plugin is configure in stereo
mode, with the 1st (left) input being fed with silence.

VST3 does not have a "right-channel mono" configuration.

It is also preferable to have Ardour do the pin/channel
mapping.
2023-03-17 15:46:34 +01:00
03263950b7
VST3: query plugin's BusArrangements
This fix an issue in case a given plugin does not
support zero or less than expected numChannels.
2023-03-17 15:12:36 +01:00
6cb90471fe
VST3: set numChannels to match the speaker-arrangement
This fixes an issue with recent JUCE when using a stereo
plugin on a mono track.

`juce::validateLayouts` requires that numChnanels matches
the configured channel-mapping:
69795dc8e5/modules/juce_audio_processors/format_types/juce_VST3Common.h (L630)
JUCE could be more liberal and accept
`(int) mapIterator->size() > it->numChannels`
2023-03-17 05:58:10 +01:00
05a13e151e
PI: Leave unconnected buffers when split processing
Otherwise a stereo plugin on a mono bus will still
have two valid input buffers, and a map saying so
during process().
2023-03-17 05:58:10 +01:00
John Emmas
f8557cc00f Export AudioGraphper::Source and AudioGrapher::ListedSource
after an MSVC update this morning, these classes need to be exportable now - I'm not quite sure why :-(
2023-03-15 13:39:56 +00:00
ca67752dc5
Add missing well-known ctrl implementation (amend prev commit) 2023-03-14 20:47:09 +01:00
f1a0004d38
Expose new well-known ctrls to stripable API
This allows to use new those in ctrl surfaces
2023-03-14 18:24:12 +01:00
1d9c2004be
Backport Mixbus9 well-known ctrls
This also removes the mixbus specific implementation
from ardour's codebase
2023-03-14 17:27:05 +01:00
0b50bec6f4 MCU: Update view modes for Cue, Foldback, and VCA
This changes the function of the Inputs, Instruments, and Outputs
buttons as follows:

Inputs = Cue Tracks
Instruments = VCA
Outputs = Foldback Busses
2023-03-13 12:21:49 -05:00
d0fac54261
Always call cycle-end after a cycle-start
This fixes an assert (_in_cycle) when changing backends
since 77bb262c2.
2023-03-12 16:59:02 +01:00
Marijn Kruisselbrink
8810c36c6e
Fix audio source names when importing files with > 2 and <= 26 channels.
This code presumably intended to name sources "foo%a", "foo%b" etc, but
since it was incorrectly appending the character as an integer sources
instead ended up being named "foo%97", "foo%98" etc.

Also changes the branching logic to use this branch upto 26 channels,
rather than just upto 25 channels, as that seems to have been the
intention.
2023-03-11 18:53:26 +01:00
339d3e1265
Drop another debug message 2023-03-09 18:23:20 +01:00
cf4056cf34
Fix alignment of unconnected tracks
This is relevant when bouncing track -> track -> n/c.
It also helps to balance send latency route [send to bus] -> n/c
when the bus is connected to master or outputs.
2023-03-07 20:50:11 +01:00
5a8b69555f
Fix metronome capture alignment
This undoes edd68d8682, "ExistingMaterial" worked IFF
the click playback was exactly 1 cycle delayed and the
disk-writer _playback_offset was set to 1 cycle.

Now that audio buffers are flushed (see prev commit), the
click I/O's output is directly available and CaptureTime
is the correct alignment (as it always was).
2023-03-07 20:50:00 +01:00
62fc1d3c2e
Flush audio-buffers for internal connections
Forward data for ports that are both internally and
externally connected.

e.g. click-io may be connected to a track as well as physical
outputs. Since the port is externally connected, data is written
to an internal buffer _data[], and only at cycle-end resampled
to engine-buffers.

However a track's recording the metronome is not externally
connected. Hence data is directly read from the engine-buffers.
Summing also happens at engine level, so data has to
be written back for downstream ports to read them in the same cycle.
2023-03-07 20:49:54 +01:00
77bb262c26
Add API to check for internal port connections 2023-03-07 20:49:37 +01:00
7a18ef6ceb
Fix LADSPA log-scale default (correct e1ef2c7e0d) 2023-03-06 20:38:11 +01:00
alex
4ca947f078 changed parantheses and lines 2023-03-06 00:43:34 +01:00
alex
777c7c6c03 added trackcolors to X-Touch, added _is_xtouch to device info as condition for trackcolors 2023-03-06 00:08:38 +01:00
JungHee Lee
3b0a19d30e Update Korean translation 2023-02-24 02:00:10 +01:00
4c4f659c5d libmidi++: allow tracer to print tick message 2023-02-23 15:34:27 -07:00
95ad72bda6 libmidi++: add the hitherto unknown and unsupported MIDI "tick" message
See http://midi.teragonaudio.com/tech/midispec/tick.htm
2023-02-23 15:34:27 -07:00
94570e0e1e midi clock: no changing tempo when we're not using an external sync source 2023-02-23 15:34:27 -07:00
27205c7639 midi clock: provide option to quantize incoming BPM values 2023-02-23 12:15:26 -07:00
e430d13d53 midi clock: allow user to "quantize" MIDI clock resolution 2023-02-23 10:17:47 -07:00
866876c903
Update MClk DLL, fix calculating coefficient
For whatever reason, previously the DLL bandwidth was set
to (10 Pi bpm^-2).
2023-02-23 17:26:30 +01:00
e1ef2c7e0d
Fix LADSPA default values for log-scale controls 2023-02-23 15:05:14 +01:00
52cfa9ff19
Another step towards fixing MIDI Clock sync
* Fix reset on timeout: Reset needs to be called before
  processing any messages.
* use DLL to compute BPM (remove 1st order LPF)
* set BPM before calculating ppqn
* Fix speed at 1.0, change BPM only. MIDI clock must
  vari-speed (which changes pitch). MIDI clock is acts as
  "Conductor" that specifies when a beat happens at a given
  wall-clock time. timecode moves at speed 1.0 only the BPM
  changes.
2023-02-22 18:41:11 +01:00
93b68fea89 mclck: compute "predicted_clock_interval_in_samples" correctly 2023-02-20 21:40:02 -07:00
Ayan Shafqat
2773199fa3
Fix clang build error 2023-02-21 02:02:08 +01:00
83d7114597 transport master: fix think in 58c5f75fc9 which stopped checking both port arguments 2023-02-20 17:35:24 -07:00
6721fe4697 mclk: fix debug output arguments 2023-02-20 17:35:24 -07:00
cd6c88c964
Fix loading VST2 presets at instantiation time
This fixes a crash when dragging a VST2 presets from
the mixer-sidebar to a track.
2023-02-21 01:33:47 +01:00
78c89fcbae
Fix MIDI Clock transport master (#8750)
MIDI Start and Position messages need to leave
the clock timestamp alone. They are not relevant
to compute BPM.
2023-02-19 22:49:23 +01:00
cf0b119b45
Towards fixing MClk transport master (#8750)
* Honor MCLk stop messages, do not auto-start as soon as
  the tempo is locked (after 3 clock ticks).
* Retain MIDI beat position, do not rewind in ::update_midi_clock
  Do not directly start when receiving the position message,
  transport speed should be zero (regardless of clock speed),
  until the "continue" message arrives.
* Mclk start needs to rewind (not reset)

There is still an issue with start, when
_session->transport_sample() is not zero. Ardour ends up
constantly locating, rolling for a short time and re-syncing
by locating again.
2023-02-19 18:19:18 +01:00
e83898cf88
Use correct flag for MMC 2023-02-19 18:09:01 +01:00
c1c913be9d
Fix MClk generator position 2023-02-19 18:08:58 +01:00
b6f0e547bb
Pick a more sensible arbitrary number 2023-02-18 18:44:40 +01:00
cba8fd090f Fix widget retina scaling (#9243)
For normal cairo-widgets ardour should not use image surfaces on macOS,
because that bypasses retina scaling. In theory explicit upsampling could
be performed (compere to openGL/cairo), but for the case at hand that is
overkill and inconvenient.

Performance critical widgets that render periodically can enable openGL
backing. Casual widgets (buttons with text, knobs, sliders etc) can be
rendered directly without any significant performance penalty.
2023-02-17 15:57:32 +01:00
5b6bc3f358 Revert "tempo map: use lookup tables to speed up time conversions"
This reverts commit 644ebe37a8.

Adding entries to the lookup table is (a) not thread safe (b) not appropriate
from RT context.
2023-02-16 18:25:23 -07:00
cfb31e3257 AU: update to new tempo-map API (amend 259499fc) 2023-02-17 01:19:10 +01:00
edbcaa24fb
VST3: initially only enable default-active busses
This works around a problem with some JUCE plugins, notably
https://github.com/surge-synthesizer/surge/issues/6847
2023-02-16 20:43:03 +01:00
31a3c3c6f3 temporal: fix bad escape sequence in test source code 2023-02-15 18:36:23 -07:00
a59059c15e temporal: map used for ::reftime() must be the one pointed at by TempoMetric 2023-02-15 18:36:23 -07:00
92f5046ae6
Update BBT Lua bindings, add missing BBT_Argument 2023-02-16 02:20:18 +01:00
ee64390c48 fix libtemporal tests after API changes to the library 2023-02-15 17:51:28 -07:00
644ebe37a8 tempo map: use lookup tables to speed up time conversions 2023-02-15 16:02:56 -07:00
6f095b91ce tempo map: add data structure and methods for (fast?) lookup tables
As of this commit, none of the data structures are used.
2023-02-15 16:02:56 -07:00
92bd8461ca tempomap: provide improved reftime() method for TempoMetric
This now looks backwards in time for a BBT_Marker or the start of the
tempo map, whichever comes first.
2023-02-15 16:02:56 -07:00
6cde958480 BBT_Time: provide conversion to/from integer format
This is not guaranteed to be lossless, but with 44 bits for bars,
256 beats per bar and up to 4095 ticks per beat, it should be fine.
2023-02-15 16:02:56 -07:00
259499fc5f require use of BBT_Argument as both parameter and return type from most methods (libs edition) 2023-02-15 16:02:56 -07:00
f033b5717d tempo map: fix lookup of tempo/meter for a BBT time
Find the first point/tempo/meter after the reference time of the BBT argument
2023-02-15 16:02:56 -07:00
43c8fae709 initial addition and use of BBT_Argument
Currently this is interchangeable with BBT_Time, but soon will
be handled differently
2023-02-15 16:02:56 -07:00
3c57085756
VST3: fix deadlock when loading a preset in some plugins
Some plugins call back to restartComponent() directly from
IEditController::setComponentState.

This lead to a deadlock since VST3Plugin::load_preset
takes a lock (since 7.2-85 b27467157b), and restartComponent
takes the same mutex again.
2023-02-15 23:50:50 +01:00
62d4e0789a tempo map: fix error in TempoMap::copy_points() that fails to reset _map ptr
This left the _map ptr of all points in a copy of a map pointing
to an old/dead TempoMap.
2023-02-14 10:14:55 -07:00
423a921301
VST3: prevent deadlock when restartComponent is called from Process
This fixes an issue with Blendeq (and likely other plugins)
that call `restartComponent(Vst::kLatencyChanged) from the
in realtime context from plugin's process
2023-02-13 17:32:21 +01:00
21d86b264a
VST3: synchronize AC when plugin's internal state changes
e.g. loading a u-he zebra preset using the plugin's GUI
internally changes the controller state without using the
`performEdit` API, but instead calls `restartComponent` wit
the `kParamValuesChanged` flag to perform a a batch update.
This now also updates Ardour's AutomationControl to match.
2023-02-11 13:36:23 +01:00
83d6b87249
VST3: load custom state after setting parameters (#9206)
This broke in b27467157b. Control port changes were
postponed (written to ringbuffer) and only evaluated
at first run.
2023-02-11 13:31:27 +01:00
441a6ec069
Revert "Prefer symbols from plugins"
This reverts commit 102c48d7a1.
This breaks various plugins, notably all JUCE based ones,
during instantiation.
2023-02-09 23:39:34 +01:00
102c48d7a1
Prefer symbols from plugins
Now that we can require glibc 2.3.4, we can use RTLD_DEEPBIND.
This can help with plugins that do no hide symbols for their
contained statically linked libraries, and instead would use
use symbols.

Note: This only works on Linux.
2023-02-09 21:08:36 +01:00
eeaf0bdadc
Fix non-intel arch builds (cpuid.h header) 2023-02-09 20:54:46 +01:00
Ayan Shafqat
bb31125c94
Fix CPUID to detect AVX512F
CPUID is part of x86_64 ISA to query CPU features. In order to determine
AVX512F ISA extension, EAX and ECX needs to be set to 7 and 0
respectively before invoking `cpuid` instruction. This commit also
removes inline assembly for __cpuid in favor of using compiler provided
intrinsic functions. Both GCC and clang provides __cpuid like function
via __cpuid_count intrinsic.

This commit also creates a portable wrapper over compiler intrinsic
functions, __cpuid and __cpuidex. `cpuid' provides base level ISA query
and `cpuidex` provides extra extension information like AVX512F. These
wrappers lean towards MSVC like API.

References:
CPUID Docs: https://en.wikipedia.org/wiki/CPUID

GCC's ``docs" on __cpuid_count:
https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/config/i386/cpuid.h

Clang's docs on __cpuid_count:
https://clang.llvm.org/doxygen/cpuid_8h.html

MSVC's docs on __cpuid and __cpuidex:
https://learn.microsoft.com/en-us/cpp/intrinsics/cpuid-cpuidex
2023-02-08 23:20:20 +01:00
445e5162fd
VST3: assume left-only is Mono (#9229)
VST3 speaker arrangements (ie port is connected) can distinguish
between left only pin (of stereo pair) and Mono.
2023-02-08 22:53:26 +01:00
4429697799
VST3: deactivate plugin before calling setBusArrangements
This may currently happen from rt-context, further work
may be needed.
2023-02-08 04:42:57 +01:00
515881653d
VST3: debug setBusArrangements 2023-02-08 04:41:42 +01:00
b069b504f6
VST3: add SpeakerArr debug messages 2023-02-08 03:51:42 +01:00
cc7219636f
Ignore Steinberg's non-virtual-d'tor 2023-02-08 02:03:54 +01:00
53ab6cde1b
Add missing diagostics pop 2023-02-08 01:53:42 +01:00
7b3701d1ef
NO-OP: whitespace 2023-02-08 01:35:45 +01:00
58a846325b
Fix another const warning 2023-02-08 01:35:35 +01:00
bf9ed3f470
Fix loading Ardour 2 sessions with external redirects 2023-02-07 18:28:56 +01:00
4796a3643d use C++11 auto iterator 2023-02-06 21:04:17 -07:00
5979647c22
Fix const warning 2023-02-07 03:43:00 +01:00
fbb175df4e
Enable avx512f support for windows builds 2023-02-06 21:36:09 +01:00
5ee7941895 Only use render-group when container is not opaque 2023-02-05 22:34:38 +01:00
Ayan Shafqat
13562d94f4
Add AVX512F test to CPPUNIT 2023-02-05 16:16:59 +01:00
3d62ab1c53
Do not create sidechain ports by default
In many cases optional sidechain inputs are not used.
Previously sidechain ports were created, but remained
unconnected and silence was passed to the plugin's key input.

Plugins can detected if a pin is connected. Some plugins
(e.g. VST3  Waves SSL Comp) activate the sidechain processing
automatically when depending in connection.

It is more common that a user does not want to use an external
sidechain, and if they want they should use the pin-dialog
to connect it. So leaving it off by default is sensible.

see also #9223
2023-02-05 16:06:19 +01:00
55d1b66b72
Connect sidechain pins when adding sidechain [ports]
This is in preparation to allow to skip adding sidechain ports
by default. When a user later adds the SC input ports, it is
convenient to connect the pins just like they are when they
are connected when instantiating the plugin (via reset_map).
2023-02-05 15:55:29 +01:00
64ec70ec20
Fix plugin replication wrt. sidechains
Ignore sidechain pins, when no sidechain ports are present.
Otherwise a plugin with 1 audio input and 1 sidechain input
would match a stereo track when the sidechain port is not present.
2023-02-05 15:46:33 +01:00
Marijn Kruisselbrink
185fe497c6
Fix AutomationListPropertyTest
These tests use reference files that were generated with a particular
value for superclock_ticks_per_second. The default for that has changed
since the last time the reference files were updated though, causing
tests to fail. Rather than updating the reference files for the new
default value, this makes the test not depend on the default value by
hardcoding the value that was used to generate the reference files.
2023-02-04 23:48:13 +01:00
Ayan Shafqat
17b263dfda
Fix comment mistake 2023-02-04 23:07:17 +01:00
Ayan Shafqat
b3a10378cf
Add AVX512 optimized routines
The routines have been profiled using a test fixture.
https://gist.github.com/ashafq/50880bbbf7769f4f307e9ea9c7e71cf9
2023-02-04 23:07:17 +01:00
Ayan Shafqat
6b766e41f4
Integrate AVX512F support into Ardour
The current implementation is just a stub of AVX and is not
utilizing AVX512F.
2023-02-04 23:07:17 +01:00
Ayan Shafqat
bf8fced073
Add CPU detection 2023-02-04 23:07:17 +01:00
Ayan Shafqat
a050d9bf1f
Add newly created functions to libardour API 2023-02-04 23:07:17 +01:00
Ayan Shafqat
6a3ae8ad72
Add placeholder AVX512F functions
This file is just copied over from AVX and changed prefix
of function calls from `x86_sse_avx' to `x86_avx512f`.
2023-02-04 23:07:17 +01:00
pkubaj
387cac0ec5
Fix build on FreeBSD/powerpc64*
Only glibc has __ppc_get_timebase() function. On FreeBSD use the same assembly call that __ppc_get_timebase() actually executes.

This probably should be extended to musl and OpenBSD, but I have no way of checking that.
2023-02-04 22:40:52 +01:00
380005f50f Update preference to set macOS render performance 2023-02-04 22:34:12 +01:00
509504acf2 Add API to set openGL backing scale 2023-02-04 22:25:52 +01:00
ffafa5cfc7 NSGLView: clean up, allow optional scaling 2023-02-04 21:36:01 +01:00
d12dd4015d
Revert canvas debugging
This reverts commit 8359311849.
This reverts commit f377822891.
This reverts commit 859d6ebe4a.
This reverts commit 4cd7de7a6f.
2023-02-04 18:23:18 +01:00
17f2862f96
Emit signal when resampler-quality changes 2023-02-04 03:20:20 +01:00
caec9acf8d
Export: check all channel-configurations before export
This correctly sets up the filename, and lists all existing
files that will be replaced on export.
2023-02-04 00:21:09 +01:00
054e1c3c12
Retain pending state after recovery (#9215)
After recovering from a crash, the user still needs to
retain the option to ignore the changes that were done
just before the crash after investigating them (or save them
into a snapshot).

Previously crash recovery unconditionally overwrote the
session file (see discussion on bug tracker).
2023-02-03 07:50:32 +01:00
1434789103
Allow to profile session-state save (again)
This was removed in
 bf0a525647
 2316df357b

"SaveState" was chosen because "State" prefix overlaps with
"Stateful", and "SessionState" overlaps with "SessionEvent"
debug names. `-DState` or `-DSession` overlap respectively
with unrelated debug output.
2023-02-03 07:32:50 +01:00
dac8feb98b
VST3: fix plugin GUI value notification (#9212)
OnParameterChange uses the plain (not normalized value)
2023-02-03 05:18:34 +01:00
d0a51f017a
VST3: fix manually setting integer ctrls from UI (#9212)
set_parameter_internal() normalizes the value (C++ reference),
when setting a parameter manually (inline control, generic UI)
only the shadow_data is updated (which is supposed to be
normalized).
2023-02-03 04:44:17 +01:00
830dfdda24
Fix assert() when resolving impossible pin match (#9218)
Adding a MIDI only plugin at a point where there is no
MIDI data, and/or additional audio signals results in an
'Impossible' match.

Those are usually resolved by trying to replicate the plugin,
and the fallback is to "Replicate 1 time".

While this is effectively equivalent with ExactMatch (use
1 instance), it is semantically different: Audio sources
will be ignored and if there is no MIDI signal, the MIDI
input remains unconnected.

It is the opposite to "Hide" (plugin has more inputs
of a given type, which can be fed by silence), since it has
fewer inputs of a given type signals are "dropped".

Strictly speaking we should special case this "Replicate 1 time"
case to "Drop" [sic]. which only assert(!reconfigurable_io()).
2023-02-03 04:37:27 +01:00
26270db8ae
Fix EBU-R128 loudness analysis for mono signals
This removes the special case which assumed unity gain
when reproducing mono files on a stereo system.

ITU-R BS.1770 however specifies a channel weight of 0dB for
left, right and centre, regardless of the total channel count.

Tech 3344 6.16 mentions a 3dB attenuation to maintain the
loudness level of a mono audio signal in multi-channel signals,
and Tech 3343-2016 further specifies that "Ideally, a downmix
operation should be loudness-agnostic".
2023-02-02 17:58:46 +01:00
8359311849 debug: allow to profile exposure (revert this later) 2023-02-01 19:41:11 +01:00
7ca7eb0264 NSGLView: upscale when window is on retina screen 2023-02-01 19:40:03 +01:00
b7ac434584 canvas: invalidate scrollgroup, request redraw after scrolling 2023-02-01 02:57:10 +01:00
df3b8efbb9 triggerbox: fix stop-all-cue marker under very specific conditions
If the stop takes effect on a process cycle boundary, do not just blindly pick
the next trigger; instead using the same logic as if the stop was not on the
boundary.
2023-01-31 18:39:57 -07:00
e76b26acf0 triggerbox: disambiguate otherwise identical DEBUG_TRACE messages 2023-01-31 18:39:57 -07:00
902b98588e canvas: profile render time / area 2023-02-01 01:25:27 +01:00
24d8e5de2c NSGLView: implement partial exposure 2023-02-01 01:23:24 +01:00
72995741bb
Adjust resampler quality when sample-rate mismatches
This also ensures that engine/session resampling is possible
when the config `port-resampler-quality` is 0.
2023-01-31 01:07:04 +01:00
d89162745f
Consolidate base and nominal SR
Now that mismatched sample-rates are resampled, there is
no distinction between base and nominal sample-rate.
2023-01-31 00:54:28 +01:00
53cfbe9c7f
Add API to update port resampler
Previously resampler ratio could only set when creating
an audio port. This is in preparation for setting resampler
quality when the session rate mismatches.

The session's rate is only known after basic session-setup
is performed. At this time Click-IO already exists.
2023-01-30 23:17:29 +01:00
John Emmas
2ff05d9e9d class 'PBD::Configuration' now needs to be exportable 2023-01-28 17:44:11 +00:00
349d25a2d2 Update latency compensation when sends are added or removed
Previously only adding an aux-send triggered a graph-reorder but copying
or deleting sends did nothing.

Adding/removing an aux-send may not even change the graph, but
both upstream/downstream latency can change and delaylines need to be
configured (which is done by calling update_latency_compensation with
force_whole_graph = true).

This fixes an issue with incorrect initial latency compensation after
copying a send (any later change to connections will correctly
recalculate it).
2023-01-27 23:13:52 +01:00
a4fc52ab55 fixup preferences metadata handling (libs edition) 2023-01-27 15:13:27 -07:00
68f4c7ce8e add upcase() method; remove upcase version of internationalize() 2023-01-27 15:13:27 -07:00
7a3b42948d change base class for UIConfigurationBase, because it IS-A Configuration 2023-01-27 15:13:27 -07:00
3c1c6e7b68 continued work on use of Metadata in various Configuration objects (libs edition) 2023-01-27 15:13:27 -07:00
f7387a5d77 infrastructure for PBD::Configuration to deliver metadata 2023-01-27 15:13:27 -07:00
8071a085c4 add concept of a map-of-own-config-variables to RCConfiguration 2023-01-27 15:13:27 -07:00
f377822891 (temporarily) add nodraw bitflag to avoid gradient fills 2023-01-24 10:01:04 -07:00
38c613cd9a Towards arranging sections
This allows to move or copy whole sections of the timline (everything
you hear) to a differnt position on the timeline.

NB. Markers and tempo-map are not yet moved, and interpolated MIDI
events are lost.
2023-01-23 04:07:46 +01:00
c24c210cce Use Controllist's time-domain for guard-point delta
This fixes copy/paste of pan automation (amongst other things).
2023-01-23 04:02:08 +01:00
efe943c98e Reimplement Route::shift, move all automation 2023-01-23 04:02:08 +01:00
46a8073ff2 extend ArdourWidgets::Frame to allow no-draw of frame
Associated: disambiguate Frame use where necessary.
2023-01-22 17:41:43 -07:00
d982507085 move match_search_strings() function from plugin utils to PBD 2023-01-22 17:41:43 -07:00
79033d8ee5 Resample when engine and session sample-rates mismatch 2023-01-22 20:51:44 +01:00
5130a43d87 Remove direct use of audio-engine rate (1/2)
This is in preparation for sample-rate independence.
2023-01-22 20:06:14 +01:00
859d6ebe4a debug: log canvas exposure area 2023-01-21 17:36:22 +01:00
4cd7de7a6f debugging: allow selection no-draw for canvas fill, outline, text, lineset and waveview 2023-01-20 18:13:12 -07:00
a1dee6cba2 Fix printing from Lua DSP context (#9202) 2023-01-21 01:42:33 +01:00
a3095162de Prevent auditioner from writing files to disk 2023-01-21 00:37:41 +01:00
e6230bfd98 Add enum to configure Apple NSGLView mode 2023-01-20 21:46:11 +01:00
2226da1385
VST3: retain I/O from older versions (bump session format)
A VST3 plugin can have additional busses which were not
available in older versions of Ardour. For compatibility
reasons those should remain unconnected. This is achieved
by using a custom I/O config  (same way a user would configure
this).
2023-01-17 22:02:10 +01:00
e5e9b477d0
Force rescan of VST3 plugins 2023-01-17 22:02:10 +01:00
f221a5e47f
VST3: offer output bus configurations 2023-01-17 22:02:10 +01:00
1cbd2d3468
VST3: support VST I/O busses
This unconditionally enable all busses with connected pins.
It does not provide re/configurable I/O (like Audio Unit), nor
implement dynamic Vst::kIoChanged callbacks. But regardless
this allows for plugins with multiple I/O busses (e.g. drum synths).
2023-01-17 22:02:10 +01:00
617ec6f54f
Include bus number in IOPortDescription 2023-01-17 22:02:10 +01:00
e87b989501
Inform plugins about connected input pins
When not using inplace processing (because I/O pins connections
are not an identity matrix), dedicated inplace-buffers are used.
Those buffers contain silence on unused ports, and hence always
valid to use. However it is still useful for plugins to know
if a plugin-port is actually used. VST3 can disable busses
for unconnected pins.
2023-01-17 22:02:10 +01:00
f6eac0f03a
Clarify that plugin replication is exclusive to re-configurable I/O 2023-01-17 22:02:07 +01:00
John Emmas
7433ca7e8b Correct a couple of typos when calling 'g_fopen()' 2023-01-17 10:32:36 +00:00
e66a757154
Fix simple export when there is no session range 2023-01-17 00:23:08 +01:00
58594e2554
Fix SMF read/write when compiled on Windows 2023-01-16 22:57:03 +01:00
2c7f8eeb97
Indicate UTF8 literals - fixes glyph rendering with MSVC (1/2) 2023-01-16 21:41:09 +01:00
c635d15cf0
Use pipe with CmdPipeWriter (see b8d07b8) 2023-01-16 16:41:28 +01:00
2522deabda
SystemExec: tweak writing to stdin of child process 2023-01-16 16:39:37 +01:00
b8d07b8be2
Export CmdPipeWriter: add option to use tmpfile
Investigate issues with mp3 export (#9193)
2023-01-16 05:10:32 +01:00
Marijn Kruisselbrink
b0f5fea53a
Fix minor errors in temporal/wscript 2023-01-12 20:58:24 +01:00
0083c8fb9f Remove "using namespace" from header (part 2) 2023-01-12 19:19:41 +01:00
3a6f822381
Remove "using namespace" from header 2023-01-12 19:01:48 +01:00
6407ca51cd
Fix region-fade, time-stretch and other scaling operations (#9057)
This resolves an ambiguity between abs(int) and std::abs(T) which
depends on context and compiler version and optimization.

In context of #9057, (gcc-6.3 -O3) math.h `abs(int)` was used. This
truncated the superclock value to 31 bit in ControlList::extend_to.
2023-01-12 16:17:39 +01:00
117cfc844b
Fix 128 bit integer math rounding (#9057)
The previous code only used the 1st multiplicand was use to
determine the direction of rounding, breaking commutative property

`muldiv_round (1, 3, 4) != muldiv_round (3, 1, 4)`
2023-01-12 16:08:53 +01:00
34e12a5d78
Fix grid when tempo marker is not on a mod_bar/beat_div
Previously the current iterator bbt was moved to p->bbt().

From then on, no grid line is reached if the point p is not on
a bar and mod_bar != 0 or the point is not on an expected beat_div.

e.g. when using bbt += mod_bar, and a tempo-change is at 5|2|0.
iterations continues 6|2|0 7|2|0  is_bar() is always false
and no more grid-lines were added.

Rather than trying
   bbt = round-up-to-next-grid-mod-div
and then finding the metric for that position, this
approach only does the latter using the already incremented
BBT position.
2023-01-11 00:25:23 +01:00
b0a679a1af
Fix grid after last tempo-marker when showing bars
This is a copy/paste bug, compare to d77db816de
2023-01-11 00:06:43 +01:00
f658a4c0b2
Fix Region lock style property (#9191)
This allows to properly toggle "Glue to Bars/Beats".

Editor::toggle_region_lock_style uses Region::position_time_domain(),
However Region::set_position_time_domain() checked the duration's
time-domain.

Furthermore timecnt_t::set_time_domain() changes both the
position and the duration's time domain. This can lead to
various issues. We only need to change the time-domain of
the timepos_t _position.
2023-01-10 20:07:05 +01:00