13
0
Commit Graph

15501 Commits

Author SHA1 Message Date
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