13
0
Commit Graph

15557 Commits

Author SHA1 Message Date
8d557dd56a fix old write source names being used after a track is renamed 2020-02-19 15:07:42 -07:00
95773f6bb7 fix compiler warning about dynamic_cast<T*>(ptr_to_T)
This is in a Route method, so it is obvious that dynamic_cast<Route*>(this) will return true
2020-02-19 15:07:42 -07:00
ad402e76af remove "destination_sample" from API for Session::set_transport_speed()
This was a leftover from changes made for Tracks Live, related to
the concept of an auto-return preference. We don't use this anywhere in Ardour
or Mixbus, and the concept should eventually be removed entirely.
2020-02-19 15:07:42 -07:00
f62fb6dd98
Remove unused dummy control class
PBD::IgnorableControllable() is no longer used.
It also was problematic, because in every case where a
Controllable is required, min/max range and usually also
get/set value are significant.
2020-02-19 17:03:46 +01:00
d6315618da Enumerate the polarity buttons from the polarity processor itself, not the Input count. 2020-02-18 20:15:05 -06:00
720664d9d3
Fix loading send gain automation
This cleans up various issues that have been accumulated over the past
and fixes bugs introduced in d4e023e1 and e31f5d99.

Previously GainControl as saved as part of the Amp, however the
automation was saved via Send (is-a Automatable).

In d4e023e1cb, the GainControl was changed a "BusSendLevel"
parameter, but AutomationList was not updated. This prevented
loading existing automation (control parameter was not found).
2020-02-18 21:14:52 +01:00
6f205f857b
Replace missing .mid files with silence
This fixes a crash: missing playlist due to missing .mid,
and retains regions for missing MIDI files.

As opposed to missing Audio, we cannot use a SilentFileSource,
because MIDI files are destructive.

This also adds an API to query missing files that have been replaced
with silence to report them to the user.
2020-02-18 01:26:20 +01:00
4c7cde0242
Fix seamless looping w/split-cycles
This fixes the following (loop-lennth > internal_playback_seek
length. Due to read-ahead on some cycles the following can happen
---
Loop From: 3528000 To: 3880800  (len: 352800)
start-sample: 3880971 playback_sample: 3528171 nframes: 96
start-sample: 3880875 playback_sample: 3528075 nframes: 192
---
which resulted in disk_samples_to_consume == 0;
2020-02-14 18:45:13 +01:00
1341e18cac
Fix potential deadlock (session-template with latent procs) 2020-02-14 18:42:45 +01:00
5794d21a76
Fix cross-compile linking (arm-linux ld)
Explicitly specify required libraries (waf does no longer
forward .uselib dependencies of libraries used by .use).
This leads to undefined symbols.
2020-02-14 00:20:45 +01:00
Jan Lentfer
d7fed7c52e
LCXL: make sends assignable for 32C
* add an option to the controller configuration gui
      to assign the 3x2 send banks in mixer mode
      to either the upper (1-6) or lower (7-12) Mixbus sends
    * This was a user request to better support the workflow
      of the CoMondo Mix system
2020-02-13 18:32:41 +01:00
45ff356819
Fix Mixbus well-known filter controls (HP/LP freq) 2020-02-13 17:21:38 +01:00
Jan Lentfer
b9b6a57245 LCXL: fix pan for Mixbus device mode, too 2020-02-13 09:53:38 +01:00
7e25298721
FP8: fix direction of panner bar on scribble-strip
(amend 4f90bd6298, see also c663a2d8ef)
2020-02-13 03:13:30 +01:00
3cb4678bb3
FP8: don't send non-ASCII chars to scribble-strip
In particular the degree sign (\u00B0) used by Mixbus' panner
caused issues.
2020-02-13 03:12:14 +01:00
46a6f47362
Address sidechain-port name uniqueness
[Re]name sidechain port directly when a plugin is added.

Usually plugins are constructed without an Route (owner is unset).
PluginInsert c'tor may already create a side-chain port, at the
time of construction the sidechain port will be created using
the port-name "toBeRenamed".

Previously the plugin had to be added to a route using "add_processor",
in order to set a unique name, before a new plugin with sidechain
could be constructed.

ProcessorBox::use_plugins() did that in the correct sequence,
however there may have been cases where this didn't work, and
Route::add_processors() was called directly..
2020-02-13 00:47:18 +01:00
Jan Lentfer
260e7ad5a9 LCXL: Make the pan fix nice again 2020-02-12 21:37:52 +01:00
c321bc82bb
FaderPort8: Don't lock shift, when using shift + encoder 2020-02-12 20:31:10 +01:00
4f90bd6298
Fix Faderport 2/8/16 pan azimuth knob direction
See also c663a2d8ef
2020-02-12 20:12:08 +01:00
6f755c3c02
Fix loop-fade and de-click buffersize calculation
Exponential approach to zero:
     1 / exp(t) == exp (-t)
we "stretch" it by a time-constant "c":
        gain(t) = exp (-t * c)

To find the time t, at which the exponential approach reaches gain "g":
                                  exp (-c * t) = g
take the log of both sides:  log (exp (-c * t) =  log (g)
since  log (exp (x)) == x :               -c t =  log (g)
divide by -c              :                  t = -log (g) / c
set g = 1e-5 and c = _a/sr and we get:       t = -log (1e-5) / (_a/sr)

The iterative approach using g += c * (target_gain - g);
converges faster than the exact exp() calculation.

Except with 32-bit float, if target-gain is 1.0f and "c" is small.

With 32bit float (1.0 - 1e-5) = .9999900 is represented as
   sign: +1 | mantissa: 0x7fff58 | exponent: 126
there are only 126 "steps" to 1.0. Rounding of the lowest
mantissa bit does matter. We have to assume worst-case,
and increase the required loop_fade_length buffersize.

vs. approaching 0, where there are over 2^110 steps between
zero and 1e-5.
2020-02-12 17:28:53 +01:00
f477dd088c
NO-OP: use #define for de-click + fade gain coefficient 2020-02-12 17:28:53 +01:00
cc4aeb1f40
Prevent out-of-bounds array access 2020-02-12 17:28:53 +01:00
79f0ad0533 fix missing MIDI playback by using correct (expanded) logic in DiskReader::declick_in_progress()
If use_transport_fades() is false, then the declick_amp will have its gain always set to the current target (no declick).
Therefore only testing if it has reached zero is not enough, we need to check if we are declicking at all.
2020-02-12 09:23:39 -07:00
John Emmas
a463a1e0ea Revert commit #39975dc3c6 from Feb 7th
'using namespace ARDOUR;' is needed for the MSVC build.

(I guess it could be enclosed by a #ifdef if it's causing issues for the gcc build)
2020-02-12 09:56:29 +00:00
fac8d84786 move the point of adding a new MIDI track until *after* the instrument is added
This seems ripe with all kinds of subtle breakage potential. Sigh.
2020-02-11 16:46:30 -07:00
Jan Lentfer
cc7eca7453
LCXL: Adopt pan knob behaviour
* "left/right" changed in A6, adopt for this
    * add a pick_up_rev function to honour this
2020-02-09 23:34:20 +01:00
8264865dd8 ptformat: Update to upstream 55f08d8 (simplify version detection) 2020-02-09 17:55:48 +11:00
4c29eb5b6a
Add missing include for compat (memcpy needs string.h) 2020-02-08 21:27:57 +01:00
39975dc3c6
Reduce used namespace
This partially reverts 40cca52b, this code is only
using ARDOUR::Session and nothing else from ARDOUR.
2020-02-07 23:14:48 +01:00
John Emmas
40cca52bbb Changes needed for building with MSVC
Mostly these are to do with TLSF which I hadn't in fact been building!! Hopefully there won't be any problems for the gcc builds.
2020-02-07 11:27:22 +00:00
d4dd756bf6 always use plugin's ::midnam_model() method to provide the name of a custom, plugin provided MIDNAM document 2020-02-06 14:43:58 -07:00
5fb38c7c53
Fix DSP::process_map edge-case (unconnected inputs)
previously this could result in signals being passed though
(in-place) when inputs were disconnected.
2020-02-06 21:40:02 +01:00
f2980e5f05
Prefer TLSF over realloc-pool for LuaProc
With 4MB RAM and 1.5MB locked base memory (C++ bindings),
TLSF has a better worst-case performance (-20% std-dev
execution time compared to realloc-pool).

Even though on average Realloc-Pool performs better (-9%
average time, compared to TLSF).
2020-02-06 17:30:22 +01:00
6f5d6e9ba2
Fix rt-safety of LuaProc w/o chanmapping
Since Lua function arguments are not typed, there is no
explicit "const", and a function can always modify the parameter.

When passing `ChanMapping const&` as argument, the object is
copy constructed. In this specific case the std::map<> members
of ChanMapping allocate memory.

Passing a pointer to the object works around this issue.

LuaBridge later dereferences the object as needed when calling
c++ methods, and copy-construction would only happen later.
2020-02-06 17:30:22 +01:00
01a75c04b1
Fix rt-safety (const reference, not const copy)
PluginInsert (and a few other places) iterate over channel
mappings using a const iterator. However mappings()
allocated memory since it was copied
2020-02-06 17:30:22 +01:00
00fcf6719c
Update DSP::Convolution
Expose zita-convolver bindings, to allow for
custom NxM convolution matrices, and dedicated FIR processors.
2020-02-06 17:30:22 +01:00
bfebe43a02
Audio ROM Lua Bindings 2020-02-06 17:30:21 +01:00
3483c3589a
Add a Read Only Memory Audio Source
This will come in handy for FIR, or short samples in combination
with a Lua convolution processor.
2020-02-06 17:30:21 +01:00
5d3feaf91b
Add Lua Bindings for Readable c'tor 2020-02-06 17:30:21 +01:00
56c1fa0c90
Break out API to create readables from files 2020-02-06 17:30:21 +01:00
34c4602e61
Lua Array, assert indices > 0 2020-02-06 17:30:21 +01:00
fbacb13d2d
Extend Lua binding for static methods
This add support for Lua bindings for static member
functions in weak/share ptr class bindings.
2020-02-06 17:30:21 +01:00
7e6427e667 Auto-Input should default ON (per irc discussion) 2020-02-04 13:12:23 -06:00
a9b614fc18 Fix a potential case where PresentationInfo type flag is not set (see comment for details) 2020-02-04 13:08:21 -06:00
788d77fe5c
Initialize uninitialized variable (Session StateProtector) 2020-02-03 17:29:48 +01:00
d14d396967
Lua bindings for locations and locate disposition 2020-01-31 01:45:07 +01:00
d887f5965a
Fix assert() when removing track(s)
ARDOUR::Session::remove_routes() explicitly calls
save_state (_current_snapshot_name)

Update assert() to treat an empty name
equivalently as explicitly specified _current_snapshot_name
2020-01-30 21:08:02 +01:00
cfea85b496
Use session-version when loading processor state
Stateful::loading_state_version vs.
Stateful::current_state_version

See also 0a5837ec71
2020-01-30 18:52:32 +01:00
6069c870f8
Fix recursive locks during undo/redo due to state save
undo may restore locations, which may trigger a state-save.
This can result in a deadlock:

Location::set_state () -> Locations::get_state()
both acquire a the same lock:

#2  0x000055a8421836d0 in Glib::Threads::Mutex::Lock::Lock(Glib::Threads::Mutex&) (this=0x7ffe38dcad40, mutex=...) at /usr/include/glibmm-2.4/glibmm/threads.h:687
#3  0x00007fc637731e9c in ARDOUR::Locations::get_state() (this=0x55a8466d4740) at ../libs/ardour/location.cc:1075
#4  0x00007fc637bf14b7 in ARDOUR::Session::state(bool, ARDOUR::Session::snapshot_t, bool)
   (this=0x55a846d0f050, save_template=false, snapshot_type=ARDOUR::Session::NormalSave, only_used_assets=false) at ../libs/ardour/session_state.cc:1406
#5  0x00007fc637bed2c8 in ARDOUR::Session::save_state(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, bool, bool, bool, bool)
   (this=0x55a846d0f050, snapshot_name="", pending=true, switch_to_snapshot=false, template_only=false, for_archive=false, only_used_assets=false) at ../libs/ardour/session_state.cc:815
#6  0x00007fc637b4d967 in ARDOUR::Session::auto_punch_start_changed(ARDOUR::Location*) (this=0x55a846d0f050, location=0x55a848fe11d0) at ../libs/ardour/session.cc:1395
#7  0x00007fc637b4da21 in ARDOUR::Session::auto_punch_end_changed(ARDOUR::Location*)
   (this=0x7fc637b4da21 <ARDOUR::Session::auto_punch_end_changed(ARDOUR::Location*)+67>, location=0x7ffe38dcbf10) at ../libs/ardour/session.cc:1403
[..]
#14 0x00007fc637730a2a in ARDOUR::Location::set_state(XMLNode const&, int) (this=0x55a848fe11d0, node=..., version=6000) at ../libs/ardour/location.cc:715
#15 0x00007fc637732428 in ARDOUR::Locations::set_state(XMLNode const&, int) (this=0x55a8466d4740, node=..., version=6000) at ../libs/ardour/location.cc:1130
#16 0x000055a842388dd7 in MementoCommand<ARDOUR::Locations>::undo() (this=0x55a84d1e5f10) at ../libs/pbd/pbd/memento_command.h:141
#17 0x00007fc635b50707 in UndoTransaction::undo() (this=0x55a84d513b80) at ../libs/pbd/undo.cc:128
#18 0x00007fc635b50e1c in UndoHistory::undo(unsigned int) (this=0x55a846d11338, n=0) at ../libs/pbd/undo.cc:267
#19 0x00007fc637c0dfff in ARDOUR::Session::undo(unsigned int) (this=0x55a846d0f050, n=1) at ../libs/ardour/session_state.cc:5577
2020-01-30 04:16:19 +01:00
0d127813fb
Allow StateProtector to save pending files
This is in preparation for saving state while the session is
record-arm'ed. Most notably config changes and undo/redo.

In case both normal and pending save happens, pending must be
last and is required to recover from crashes during recording.
2020-01-30 04:12:19 +01:00
998fadda57
Add some sanity checks for Session::save parameters 2020-01-30 04:09:48 +01:00
6452f62d64
Cont'd work on loading old route templates
This builds on top of 51d2bb:
 * v6 routes templates/states have a version per <Route>
 * older route-states are assumed to be from ardour-5
   Stateful::loading_state_version 3002,
   unless specified otherwise
2020-01-30 01:08:57 +01:00
51d2bb36ce
Save/Use state-version with route templates
Currently using Ardour-5 route templates (state version "3002")
with Ardour6 fails. As opposed to session-templates, Route
templates were not versioned.

This ensures future compatibility (and may allow to interpret
unversioned templates as "3002")
2020-01-29 23:20:37 +01:00
Nikolaus Gullotta
39dac5b20f Fix tests failing to build by adding LIB_FFTW3F 2020-01-29 10:12:04 -06:00
2731d494c2
Reduce overhead of Lua session-scripts 2020-01-29 16:51:14 +01:00
0ab46c342f
Fix MIDI loop capture alignment
Loop recording creates a single long source, regions have to be
"split" from this source, using "start" as offset.

Since MIDI uses absolute timestamps, offsetting this by accumulating
 buffer_position += (*ci)->samples;
like Track::use_captured_audio_sources() does, is not correct.

Furthermore, record_enabled() may be off when stopping recording,
MIDI needs to be flushed regardless.
2020-01-29 16:25:33 +01:00
ffe7fcd3b0
Allow to dis/engage rec-arm while looping 2020-01-29 05:35:36 +01:00
6bc4f69c5c
Fix loop recording alignment
DiskWriter::transport_looped() is called from the session
when engine loops. This does not take local disk-reader run()
latency offset into account.

finish_capture() needs to be postponed until the disk-writer
itself reaches the loop-position. This is achieved by
postponing loop() and calling it once loop-length of samples
has been captured.

This works because engaging loop always seeks to the loop-position
and first loop resets _capture_captured.
2020-01-29 01:32:06 +01:00
cb01a910d7
Micro optimization: query PI flags once
This also removes a Mixbus special case, explicit ->mixbus() tests
are no longer required.
2020-01-28 21:27:43 +01:00
6b0a3cfffe fix previous commit, and another instance of the same (incorrect constructor) issue 2020-01-28 13:04:39 -07:00
a5dbac0a9c fix assert-crash caused by not constructing a StopTransport event correctly 2020-01-28 12:54:04 -07:00
5d99526406 correct location of resolved note-offs after region is rendered 2020-01-27 22:17:07 -07:00
8e5e902b5c
Fix sending MMC Start/Stop messages
Ardour 5.x slave check was incorrectly ported to A6's TMM:
In Ardour 5 the comparison tested for *not* MTC:
```
  if (!dynamic_cast<MTC_Slave*>(_slave)) { ..send MMC.. }
```

Other MMC messages (Record, Locate) are sent unconditionally.
2020-01-27 21:49:53 +01:00
44440f9316
Add new requirements from AudioEngine::stop to ::drop_backend
This fixes an issue that after changing backends (::set_backend),
the session-transport was in inconsistent state. If it was rolling,
it continued to roll with "stop" being unavailable.
2020-01-27 20:26:06 +01:00
5c789547cb
Fix building unit-tests 2020-01-27 17:43:37 +01:00
f101a657f2
Fix two more clang static analysis warnings 2020-01-27 17:42:28 +01:00
f9cc630b10
Delete out-of-bounds metronome clicks 2020-01-27 03:35:28 +01:00
fc7dd5115d
Fix some clang-scan warnings 2020-01-27 03:31:49 +01:00
2d07e72d40
Fix the ability to set Session Start&End Range on a new, empty session
set_session_extents had a bug; it wasn't calling locations->add()
on the newly created location.

The correct implementation was in set_session_range_location,
but this was only called from one place.
This function was removed, and set_session_extents will be used in its place.
set_session_extents will create a session location if one no longer exists,
so there is no need for set_session_range_location.
2020-01-26 19:33:41 +01:00
db465b5b43
Fix Loop-length (no pre-roll on loop-iterations) 2020-01-26 05:15:24 +01:00
83e4b9f7eb remove debug output 2020-01-25 14:25:30 -07:00
3b65b430aa
Remove midi-event by iterator, not key -- #7885
With concurrent events removing by key, allowed for invalid
iterators.
2020-01-25 22:15:37 +01:00
4fe3036495
Update waf2.x "subst" feature uses obj attributes 2020-01-25 06:20:28 +01:00
7c381dab6e
Downgrade "using all channels" warning to info - part 2 2020-01-25 04:17:53 +01:00
5a841ef462
Tweaks to build/package scripts for new waf
* Windows: delete waf installed .dll.a files
* Windows: override waf's conf.env.LIBDIR = conf.env.BINDIR
  with explicit --libdir
* Windows: fix asm (`x86_64-w64-mingw32-as` -D flag is for
  debug messages, -D defines are not available)
* Mac: override waf adding -install_name (and
  -Wl,-compatibility_version -Wl,-current_version)
  by moving -dynamiclib from linkflags to ldflags
* Mac: Allow libs with compat version number suffix
  (not needed anymore, but may help in the future)
2020-01-25 04:07:42 +01:00
06b2eb1c27
Explicitly use OSX
Previously this was inherited via PBD.

On MacOS/X,  this adds
  "-undefined dynamic_lookup -flat_namespace"
and various "-framework .." options to linkflags

Without this flag, .dylibs fail to link usually because
of missing `-lintl` (Undefined symbols: "_libintl_dgettext")

On other systems this is a NO-OP:
CFLAGS_OSX, CXXFLAGS_OSX and LINKFLAGS_OSX
are only set on the darwin platform.
2020-01-25 04:07:41 +01:00
David Runge
2e9ac80e99
Towards waf python 2+3 support 2020-01-25 04:07:37 +01:00
0db559c0ac
Special case checkbox border color in Treeview 2020-01-25 03:40:04 +01:00
f9e7f10695
Downgrade "using all channels" warning to info message 2020-01-24 21:16:40 +01:00
df8c0d949e
Engine: debug-print alignment 2020-01-24 19:15:21 +01:00
72e385af46 tentative fix for stop-transport not working after a locate at loop end 2020-01-23 23:41:39 -07:00
71ccca52a9 add more debug output 2020-01-23 14:25:38 -07:00
7da3305a04 use Session::locate_initiated(), appropriately 2020-01-23 14:25:38 -07:00
5949fec987 add Session::locate_initiated()
This differs from ::locate_pending() by covering either phase of a locate - declick or refill
2020-01-23 14:25:38 -07:00
587631f1d9 add TransportFSM::declicking_for_locate() 2020-01-23 14:25:38 -07:00
56d00ef32a extend DEBUG_TRACE output 2020-01-23 14:25:38 -07:00
ef12a4f5a9 NOOP: whitespace/indent fixes from emacs 2020-01-23 14:25:38 -07:00
87a5990e54 MIDI-region specific naming logic
plus slight cleanup of Region::set_name().

Note that issues with ARDOUR::legalize_for_path() not excluding colons still remain
2020-01-23 14:25:38 -07:00
c3f7940f25 NOOP: remove blank line 2020-01-23 14:25:38 -07:00
31db7e91d8 remove no-longer used PostTransportWork bits and renumber the rest 2020-01-23 14:25:38 -07:00
9b7db16a0b after the butler has finished work, by definition there is nothing left to do 2020-01-23 14:25:38 -07:00
3f4021c4ea variable not used without debug mode 2020-01-23 14:25:38 -07:00
Nikolaus Gullotta
85f27b28be
Only select all routes in a given group if the group is active 2020-01-23 12:58:59 -06:00
61e7f3176b do not clear any PostTransportWork flags in butler thread
doing this was causing the TFSM to get stuck in "WaitingForButler"
2020-01-21 21:50:35 -07:00
a765e52b47 add a heuristic to avoid refilling playback buffers at transport stop
If we're within 1/6th of the size of the reserved buffer of the target sample, no need to refill
2020-01-21 21:50:35 -07:00
981ee0060a remove debug output 2020-01-21 21:50:35 -07:00
95f3977f07
Do not install static libs
There is no need to deploy .a with ardour installations.
2020-01-22 02:00:25 +01:00
6ce1c326a9
Display LV2 plugin-name with errors/warnings 2020-01-21 22:32:59 +01:00
9d2a209f60 Change tape-machine-mode to auto-input-does-talkback (libardour part)
In prior versions: if Auto Input was enabled, the default behavior was
to monitor the Input of all tracks when stopped; even if they aren't armed.

Tape Machine Mode changed the behavior of Auto Input so that it doesn't
always monitor the track inputs when transport is stopped.

After some discussion on IRC, we determined that Tape mode is likely
more practical for a DAW user, and therefore a better default.

Rather than default an ambiguously-named preference "on", we decided
to invert the behavior, rename it sensibly(?), and default it OFF.
2020-01-20 12:19:15 -06:00
ad82b443f4 fix API and use of Session::force_locate()
Because of the addition of LocateTransportDisposition, this call was unconditionally forcing a roll during startup
2020-01-20 11:07:27 -07:00