13
0
Commit Graph

29028 Commits

Author SHA1 Message Date
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
48e59dab90 reverse occurence order of "General MIDI" and "MIDI" in the generic MIDNAM file
General MIDI now comes first and so is used by default when using "Generic"
2020-02-11 22:10:02 -07:00
0d1eb8c96c expand comment 2020-02-11 17:40:38 -07:00
a48a2b26de remove unnecessary code
There's no reason to store the first device mode in a gui property if the model is also not a gui property
2020-02-11 17:40:07 -07: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
9d60197ffb remove unnecessary code
If there's no GUI property for the MIDNAM model name, and the plugin has no MIDNAM, there's no reason to set the property to the default

It will pick up the default ("Generic") during update_patch_selector() calling into model_changed
2020-02-11 14:16:47 -07:00
ca28404a2a NOOP: line unwrapping and vertical spacing 2020-02-11 13:59:05 -07:00
de74cca6b8 further attempts to rationalize MIDNAM mess
Attempt to re-use GUI property for MIDNAM device mode, and if it doesn't exist, use the first from the model's device mode list.

Also require at least one device mode in the MIDNAM file (via assert) - consider anything else to be malformed
2020-02-11 13:41:44 -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
beaa6a7ae4 pt_import: Bump thread pool constant from 64 to 2048 to prevent import crash 2020-02-09 17:55:48 +11: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
d5c1ad805d NOOP: add whitespace/blank line 2020-02-07 12:20:11 -07:00
46277acb40 Fix incorrect assignment of MIDNAM device mode 2020-02-07 12:20:11 -07:00
e93150cb3f NOOP: remove line wrapping 2020-02-07 12:20:11 -07: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
8242478da5 try to fix awful confusion and misbehavior for plugin-provided MIDNAM situations
We do not store the MIDNAM model as a GUIObject property if the using the plugin-provided MIDNAM. Selecting a different MIDNAM for
the plugin should now result in that choice being saved/restored correctly.

This all feels crazily complicated, but I don't want to change more of the architecture at this time
2020-02-06 14:43:58 -07:00
55d158816e NOOP: avoid unnecessary and distracting line wrapping 2020-02-06 14:43:58 -07: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
39e0c0a084 add AxisView::remove_gui_property() 2020-02-06 14:43:58 -07:00
c791d5970f add GUIObjectState::remove_property() 2020-02-06 14:43:58 -07:00
Nikolaus Gullotta
a13fabf344 Resize session dialog back to initial height and width on "back"
This fixes an issue where the size of the window stayed much larger
than its content if there are no sessions in the session search path
after attempting to make a new session and then pressing "back"
2020-02-06 14:45:09 -06: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
016970df25
Readable and AudioROM Lua script examples 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
ee43db8b54 revert/change part of a666429d12 so that user-selected non-plugin MIDNAM model names are still shown (they were already used) 2020-02-05 12:53:15 -07:00
be45193f3f fix old bug from 2007 (bbf4175713) in which a return statement was accidentally (presumably) dropped 2020-02-05 12:53:15 -07: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
Nikolaus Gullotta
00d1a0ed4d
Mixer Reset now resets automation state of all plugin inserts 2020-02-03 16:07:13 -06:00
Nikolaus Gullotta
a655997749
Add more options to Mixer Reset script
Added the ability to unassign all slavables from their VCAs, and to
reset record enable controls
2020-02-03 15:38:37 -06:00
788d77fe5c
Initialize uninitialized variable (Session StateProtector) 2020-02-03 17:29:48 +01:00
Nikolaus Gullotta
70f72800c1
Fix plugin removal in Reset Mixer script
Removing processors while iterating over the route invalidates the
loop. Instead, queue the plugins for later handling
2020-01-31 09:16:57 -06:00
cb09a0884b
Clarify stop-at-marker transport position logic 2020-01-31 02:11:41 +01:00
e03136646d
Fix "stop at marker" script for A6 2020-01-31 01:49:56 +01:00
d14d396967
Lua bindings for locations and locate disposition 2020-01-31 01:45:07 +01:00