Commit Graph

121 Commits

Author SHA1 Message Date
Robin Gareus f858316503
Plugins: Ignore offset for scratch/silent buffers
This allows to process buffers at an offset, as long
as the number of processed samples is less or equal to the
current buffersize.
2024-04-23 21:51:19 +02:00
Robin Gareus 6b3f25eb2a
Update Lua instances (2/4)
This is effectively a NO-OP.
2023-10-04 02:48:26 +02:00
Robin Gareus 771cc4581e
LuaProc: use effective sample-rate, like other plugin instances 2023-07-03 00:31:21 +02:00
Robin Gareus be3d3a6d00
LuaProc: allow plugin to prefer a regular block length
This equivalent to http://lv2plug.in/ns/ext/buf-size#coarseBlockLength
2023-06-30 17:21:49 +02:00
Robin Gareus 71d45286f4
LuaProc: sort MIDI events
This allows plugins to produce an unsorted list of events.
see also https://discourse.ardour.org/t/lua-arpeggiator-plugin-anyone/108862/64?u=x42
2023-06-30 17:12:16 +02:00
Robin Gareus c352347eaa
LuaProc: offset MIDI events when splitting cycles 2023-06-30 17:12:16 +02:00
Robin Gareus fc08771651
LuaProc: implement factory presets 2023-06-28 19:10:34 +02:00
Robin Gareus 877a2f3611
LuaProc: remove ill-defined bar time variable 2023-06-20 22:26:09 +02:00
Robin Gareus 0dc1c3f008
LuaProc: refine time API
See https://discourse.ardour.org/t/lua-arpeggiator-plugin-anyone/108862/8
2023-06-19 22:07:53 +02:00
Robin Gareus 8c513ceca7
LuaProc: expose sample-position of last beat 2023-06-19 05:12:47 +02:00
Robin Gareus ebcaffd19f
VST3, Lua: fix barPositionMusic
"last bar start position, in quarter notes", starts at zero
to match projectTimeMusic.
2023-06-18 23:00:42 +02:00
Robin Gareus 34789ff22f
LuaProc: add option to set time information 2023-06-18 22:39:45 +02:00
Paul Davis 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
Robin Gareus a1dee6cba2 Fix printing from Lua DSP context (#9202) 2023-01-21 01:42:33 +01:00
luz paz 1e640563d6
Fix source comment typos in `libs/ardour`
Found via `codespell`
2022-05-11 00:14:28 +02:00
Robin Gareus 396d2df127
Fix LuaProc API usage (typo in 10b05df189) 2020-10-12 04:14:48 +02:00
Robin Gareus 7ec10f7771
Update variable-i/o channel assignment, separate sidechains
We need to be able to distinguish
 * 2 ins: mono + sidechain
 * 2 ins: stereo input
2020-10-12 03:26:33 +02:00
Robin Gareus 10b05df189
Rename plugin pin I/O API (NO-OP)
This allows to distinguish Processor::configure_io from the
Plugin API with the same name. Despite the identical name,
both functions serve different purposes.
Likewise the ::can_support_io_configuration() API is renamed.
The signature of that function call has already diverged.

The Plugin-API has to handle optional busses (e.g. side-chain)
and replication. The PluginInsert processor provides context.

This change is in preparation for AudioUnit and VST3 busses.
Currently a stereo-input (1 bus) cannot be distinguished from
mono + sidechain (2 busses).
2020-10-09 02:19:43 +02:00
Robin Gareus 7ab664d5a4
Properly emit Plugin::DropReferences (1/2) 2020-10-05 19:57:14 +02:00
Robin Gareus f9cdf533ba
Event API consistency; reorder arguments (time, type, payload) 2020-09-20 19:18:09 +02:00
Robin Gareus 1a50b6b8ea
Update Plugin API to allow timestamped parameter changes
This is in preparation for VST3 automation.
2020-09-14 23:37:21 +02:00
Robin Gareus 6742a0961c
Ask LuaProc to drop references
This fixes a circular shared_ptr<> reference that prevents
plugin destruction.

LuaProc may hold references to Route that contains the plugin
or the PluginInsert of the LuaPlugin. These are only dropped
when the interpreter collects garbage.

Previously this happened in the d'tor or LuaProc, but while the
Plugin has a reference to the Insert, the Insert is not deleted
and the d'tor is never called.
2020-08-05 22:39:06 +02:00
Robin Gareus c03f3d81a6
Allow Lua DSP scripts to override strict-i/o
This is handy for 1in, 2out plugins or 2in, 1in out (and multiples
thereof).
2020-07-13 00:52:59 +02:00
Robin Gareus 23feb0491e
Remove using std::min/max from header 2020-06-18 01:05:48 +02:00
Robin Gareus a2f07f66a5
Consistent Lua script error and print() output 1/2 2020-04-18 18:16:12 +02:00
Robin Gareus 8fe3c367cf
Fix compiler warning 2020-03-26 02:17:22 +01:00
Robin Gareus 1d17993a29
Revert failed experiment, scripted multiple MIDI outputs via dsp_run()
This reverts commit 8702ff2189,
and b10d9cf09b.

There was a misconception on the iterator (port vs message
in sequence), besides Ardour's mixer-strip is preferably used
with a single MIDI port. Most plugin-standards also only support
one port.

If need be LuaDSP run_map() can be used to handle multiple
MIDI I/O ports already.
2020-03-09 22:12:23 +01:00
R 8702ff2189
Add support for Lua DSP scripts with multiple MIDI outputs 2020-02-26 20:28:54 +01:00
Robin Gareus d27cdb3855
Fix DSP::process_map() plugin-pin I/O map handing
The previous approach failed in case where PluginInsert
uses no-inplace buffers with a linear map.
Since buffers are replicated up to a total of number of
all (inputs + outputs), the number of output buffers
could not be determined. There was insufficient information
using the I/O map alone.

With a known number of outputs processing and applying
the i/o map is also a lot easier and faster.

This break the API of process_map().
2020-02-26 17:50:08 +01:00
Robin Gareus 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
Robin Gareus a5140f4558
Handle Lua DSP script load failure (unknown plugin)
This handles a very specific edge-case: A script that was
successfully parsed before, fails load on session state restore.
2019-11-01 15:54:36 +01:00
Robin Gareus bcd1391bf7
API to count max multi-channel plugin outputs 2019-10-15 14:48:32 +02:00
Paul Davis f470d3e856 remove all use of NO_PLUGIN_STATE #ifdef
We determined several years that we should never ever do this,
and changed the basis for the free/demo copy because of that.
2019-10-02 18:04:40 -06:00
Robin Gareus 6328f92665
Fix LuaProc script-parse return status 2019-09-06 15:39:54 +02:00
Robin Gareus a22f918d9d
Update libardour GPL boilerplate and (C) from git log 2019-08-03 15:53:16 +02:00
Robin Gareus 57c3eaacf6
Fix process-thread naming 2019-07-10 20:20:44 +02:00
Robin Gareus 484e0d0fb2
Remove generic parameter-printer
This has been superseded by value_as_string() along with meta-data
from parameter-descriptor, which is supported by all standards, except VST.
2019-03-11 02:10:50 +01:00
Robin Gareus cbef72b8a1 Optimize Plugin connect & run API, use const maps 2018-11-04 02:16:34 +01:00
Robin Gareus 7c3fd2fe79 Glib throws a const FileError exception 2018-10-26 13:40:03 +02:00
Robin Gareus c6955d4994 Allow Lua DSP processors to report latency 2018-10-20 00:24:38 +02:00
Robin Gareus 2fa6314fb4 Lua: Lock bindings into memory for rt-scripts
Empirically this decreases gc-spike duration (worst-case) by a factor of
two and speeds up the average gc-run by a factor of over 4 (depending
on the amount of memory used by the plugin).
2018-03-19 02:43:03 +01:00
Robin Gareus b8491014a5 Update plugin classification
* dedicated API for classes (effect, instrument, util)
* prepare for tags (rather than categories)
* prepare removal of per-plugin in_category() API
2018-01-30 01:33:48 +01:00
Robin Gareus 5fd723b1f0 Update LuaProc GC stat calc 2017-11-29 12:06:42 +01:00
Robin Gareus 77d16999b5 Tweak Lua GC 2017-11-29 12:06:42 +01:00
Paul Davis 30b087ab3d globally change all use of "frame" to refer to audio into "sample".
Generated by tools/f2s. Some hand-editing will be required in a few places to fix up comments related to timecode
and video in order to keep the legible
2017-09-18 12:39:17 -04:00
Robin Gareus fb745cc5a8 Lua may call C++ functions with throw. Catch them 2017-08-19 01:06:44 +02:00
Robin Gareus 0191a9c4c2 Centralize Lua sandboxing 2017-08-10 02:25:49 +02:00
Tim Mayberry 579d856cc7 Remove LocaleGuards from LuaProc class
All float <=> string conversions are done using PBD::to_string/string_to via
XMLNode so no LocaleGuard is necessary.
2017-06-22 10:48:38 +10:00
Tim Mayberry 113f1e7622 Use XMLNode::get/set_property API in ARDOUR::LuaProc class 2017-04-19 09:36:51 +10:00
Robin Gareus 64f40c09fa Fix setting Plugin-Owner (route) for analysis plugins 2017-04-12 17:37:26 +02:00