Commit Graph

464 Commits

Author SHA1 Message Date
Paul Davis 5450e80bd4 replace use of non-null region as test for "trigger can be used" 2024-03-10 05:44:31 -06:00
Paul Davis 4ff8cff024 add velocity sense for MIDI Learn-ed clip triggering 2023-09-08 15:27:11 -06:00
Paul Davis 36048ea651 triggerbox: change API to allow providing velocity information when "banging" triggers
... and by extension using it (based on the magnitude of the velocity effect setting) to set the gain of
audio triggers
2023-09-08 14:41:21 -06:00
Paul Davis aaadc3906c triggerbox: fix crashing bug while processing clips in rubberband
The read_index is adjusted in the loop, which means that the calculation of how much
data can be delivered to the stretcher must also be inside the loop
2023-09-06 14:46:24 -06:00
Paul Davis 68678aa957 triggerbox: add API to clear a cue (row) 2023-09-06 14:46:24 -06:00
Paul Davis 5deea0c077 libpbd: change static trigger property change signal to take Trigger*
When we add a region to a slot, we create a new Trigger, set its region,
then arrange for an "atomic" swap with the existing Trigger. This
means that the property change signal is emitted on a Trigger that
does not yet exist inside a TriggerBox, and so cannot be found using
row/col or x,y coordinates. Pass a raw pointer instead (lifetime
management is not an issue ... or is it.
2023-08-30 16:06:13 -06:00
Paul Davis 6cf7b89aaf triggerbox: fix argument ordering error in static trigger property signal 2023-08-30 16:06:13 -06:00
Paul Davis c81027fc84 triggerbox: add static signals to allow an object to watch all trigger state changes 2023-08-30 16:06:13 -06:00
Paul Davis 3b565693c8 objects don't have a time domain, they have a time domain provider (libs) 2023-08-02 15:22:52 -06:00
Paul Davis 3307dcfcb2 temporal: reference time for BBT_Argument is always superclocks 2023-06-30 12:10:50 -06:00
Robin Gareus 7e567468b2
Fix crash when resetting MIDI tracer
The GUI was able to free memory (MidiTracer::disconnect),
while the tracer is concurrently still in use in rt-context.
This lead to memory corruption in MIDI::Parser::scanner.
2023-06-04 01:15:11 +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
Paul Davis 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
Paul Davis 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
Paul Davis e76b26acf0 triggerbox: disambiguate otherwise identical DEBUG_TRACE messages 2023-01-31 18:39:57 -07:00
Robin Gareus 2c7f8eeb97
Indicate UTF8 literals - fixes glyph rendering with MSVC (1/2) 2023-01-16 21:41:09 +01:00
Robin Gareus 208aedaeaa
Fix "Invalid Source port" error with default config 2023-01-02 04:27:20 +01:00
Paul Davis bd8c3af2a2 fix crash on MIDI unlearn for cue slot (bad iterator 2022-12-13 17:43:16 -07:00
Robin Gareus 4f4b931ccc
Add import_markers option (1/4) 2022-11-22 01:44:53 +01:00
Paul Davis d7895ab1d2 triggers: remove sidechain and use global port for trigger control 2022-11-19 10:22:16 -07:00
Paul Davis fc611232d2 redesign and reimplement save/restore of MIDI learn for triggers 2022-11-18 14:04:59 -07:00
Paul Davis 10e004f0ec tweaks to TriggerBox::dump_custom_midi_bindings 2022-11-16 18:15:39 -07:00
Paul Davis 5a07da9255 triggers: code to dump MIDI learn-ed bindings as a binding map 2022-11-16 16:25:09 -07:00
Paul Davis 730064277d a start at custom MIDI learn for trigger slots 2022-11-16 08:37:57 -07:00
David Robillard bdacfb8724 Fix invalid use of Doxygen "@param" command
This is never for inline references to parameters, only for starting parameter
documentation blocks.  The "@p" command is for this, although unfortunately
Doxygen doesn't actually do anything with it and it's just an alias for code
text.
2022-10-30 20:44:28 -04:00
Paul Davis d69dfc26a6 no whole file regions in triggerbox slots 2022-10-11 12:56:41 -06:00
Paul Davis 3c0820e36e move default_triggers_per_box into a namespace ; change value for Ardour to 16 2022-10-04 19:55:05 -06:00
Ben Loftis 374ff2b12d fix thinko in unbang behavior 2022-10-03 13:47:55 -05:00
Ben Loftis 29dc388bbc triggerbox: change bang/unbang semantics. UnBang != Stop
'unbang' is better described as a mouse-up or button-release event

* if launch-style is Gate or Repeat, then UnBang will stop the playing clip
* in other launch-styles, UnBang is ignored

some prior code using UnBang will change to
  stop_quantized()  or  request_stop()
2022-10-01 09:13:14 -05:00
Ben Loftis 07f47ff6a5 remove unimplemented bang_trigger() and replace with bang_trigger_at(n)
normally we operate on TriggerPtr's which are a safe way to track
 trigger lifetime, safely modify their properties, and launch them.

bang_trigger_at() is a convenience function to look up a trigger by index,
 and launch it, in one step.  Potentially useful for control surfaces.
2022-10-01 09:13:14 -05:00
Paul Davis b2145521d9 triggerbox: handle tempo map changes better inside and around MIDI triggers
We now try to get to the right location within the MIDI data and continue
playing, rather than pretending that we reached the end.

This also fixes a thinko that caused only the first few notes of a
MIDI trigger to play.

This may also solve cases where due to length, sample rate and tempo
settings, a trigger finished precisely on a ::run() call boundary.
2022-09-30 17:23:41 -06:00
Paul Davis 6ff57ca37b improve accuracy of DEBUG_TRACE output 2022-09-26 16:40:08 -06:00
Robin Gareus be096edd8c
Use rubberband 3.0 API if available 2022-09-13 06:44:41 +02:00
Paul Davis 9781c1baca triggerbox: prevent downstream crashes if a tempo map or other change invalidates MidiTrigger iter
The iterator into the model can become incorrect in the sense that it is no longer the correct
next event to play. This can happen at least with a tempo map change, and possible under other
conditions. Catch this when it happens, and act as if we reached the end of the trigger
2022-09-09 09:21:43 -06:00
Paul Davis 406080f1b8 triggerbox: sort-of NOOP - fix null return object in ::get_next_trigger() 2022-08-28 18:58:12 -06:00
Paul Davis aef1adc6f0 triggerbox: implement TriggerBox::peek_next_trigger() 2022-08-28 18:57:39 -06:00
Paul Davis 45144d841e triggerbox: add new "queued" property for Trigger and properly register it
Also register "currently_playing"
2022-08-28 18:56:56 -06:00
Paul Davis f96946d566 remove more debugging output 2022-08-09 12:54:45 -06:00
Paul Davis 5cc28b4024 remove debug output 2022-08-09 12:37:48 -06:00
Paul Davis 1c59a2dff0 triggerbox/route: a cleaner method of ensuring trigger alignment
This change still runs the triggerbox during latency-preroll, but as with the disk reader,
the transport speed argument is set to zero. The triggerbox notices this and behaves
appropriately (I think !)
2022-08-09 12:33:37 -06:00
Paul Davis bedb94e534 triggerbox: do absolutely nothing if transport is moving backwards 2022-08-09 12:31:37 -06:00
Paul Davis fab0cacb2c triggerbox: marginally more useful debugging output 2022-08-08 09:13:04 -06:00
Paul Davis 34c6931807 triggerbox: fix up post-locate behavior following fix in Route 2022-08-08 09:13:04 -06:00
Paul Davis 774268ada8 triggerbox: fix use of cues container without checking for content (and drop goto) 2022-08-05 07:15:52 -06:00
Paul Davis 32d99aa64f triggerbox: convert fast forward (and other) cerr output to DEBUG_TRACE 2022-08-03 17:15:58 -06:00
Paul Davis dc5737a3bf replace INT32_MAX with CueRecord::stop_all (libs) 2022-08-03 11:42:51 -06:00
Paul Davis c25e96b545 triggerbox: rework fast_fwd code into a simpler design
Rather than start at zero, we now search backwards for the first relevant cue
before the locate position, making our task in ffwd'ing from there much simpler
since there are no other cues to consider
2022-08-03 11:00:37 -06:00
Ben Loftis 22faf6f426 fix transport-freeze in some cases of MIDI cue ffwding
* there are rare cases where a midi clip would not advance the ffwd position, looping endlessly
* this problem did not occur when the user chose an explicit Follow Length (different code path)
2022-08-01 14:52:16 -05:00
Robin Gareus e04311b647
Work around cleanup unused regions removing trigger-regions
This workaround bypasses RegionMap and SessionPlaylist APIs
(region_use_count, destroy_region) which are not directly
applicable to Triggerboxes. There are likely various edge
cases until TriggerBoxes integrate with Session Playlist.

e.g. whole file regions generated for regions/source used by
triggerboxes are cleaned up.
2022-08-01 20:48:02 +02:00
Paul Davis 371f386b8b improve comment accuracy 2022-07-29 14:04:28 -06:00