13
0

triggerbox: add follow length property to triggers (not used yet)

This commit is contained in:
Paul Davis 2022-01-07 10:43:30 -07:00
parent 2342caae46
commit 1afc0ce69c
2 changed files with 6 additions and 2 deletions

View File

@ -282,6 +282,7 @@ class LIBARDOUR_API Trigger : public PBD::Stateful {
PBD::Property<int> _follow_action_probability; /* 1 .. 100 */
PBD::Property<uint32_t> _follow_count;
PBD::Property<Temporal::BBT_Offset> _quantization;
PBD::Property<Temporal::BBT_Offset> _follow_length;
PBD::Property<bool> _legato;
PBD::Property<std::string> _name;
PBD::Property<gain_t> _gain;
@ -688,6 +689,7 @@ namespace Properties {
LIBARDOUR_API extern PBD::PropertyDescriptor<bool> passthru;
LIBARDOUR_API extern PBD::PropertyDescriptor<bool> legato;
LIBARDOUR_API extern PBD::PropertyDescriptor<Temporal::BBT_Offset> quantization;
LIBARDOUR_API extern PBD::PropertyDescriptor<Temporal::BBT_Offset> follow_length;
LIBARDOUR_API extern PBD::PropertyDescriptor<Trigger::LaunchStyle> launch_style;
LIBARDOUR_API extern PBD::PropertyDescriptor<Trigger::FollowAction> follow_action0;
LIBARDOUR_API extern PBD::PropertyDescriptor<Trigger::FollowAction> follow_action1;

View File

@ -52,6 +52,7 @@ namespace ARDOUR {
PBD::PropertyDescriptor<bool> passthru;
PBD::PropertyDescriptor<bool> legato;
PBD::PropertyDescriptor<Temporal::BBT_Offset> quantization;
PBD::PropertyDescriptor<Temporal::BBT_Offset> follow_length;
PBD::PropertyDescriptor<Trigger::LaunchStyle> launch_style;
PBD::PropertyDescriptor<Trigger::FollowAction> follow_action0;
PBD::PropertyDescriptor<Trigger::FollowAction> follow_action1;
@ -84,6 +85,7 @@ Trigger::Trigger (uint32_t n, TriggerBox& b)
, _follow_action_probability (Properties::follow_action_probability, 0)
, _follow_count (Properties::follow_count, 1)
, _quantization (Properties::quantization, Temporal::BBT_Offset (1, 0, 0))
, _follow_length (Properties::quantization, Temporal::BBT_Offset (0, 1, 0))
, _legato (Properties::legato, false)
, _name (Properties::name, "")
, _gain (Properties::gain, 1.0)
@ -1222,7 +1224,7 @@ AudioTrigger::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_sa
maybe_compute_next_transition (start_sample, start, end, nframes, dest_offset, passthru);
const pframes_t orig_nframes = nframes;
DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1 after checking for transition, state = %2, will stretch %3\n", name(), enum_2_string (_state), do_stretch));
DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1 after checking for transition, state = %2, will stretch %3, nf will be %4\n", name(), enum_2_string (_state), do_stretch, nframes));
switch (_state) {
case Stopped:
@ -2280,7 +2282,7 @@ TriggerBox::process_midi_trigger_requests (BufferSet& bufs)
continue;
}
if (trigger_number > (int) all_triggers.size()) {
if (trigger_number >= (int) all_triggers.size()) {
continue;
}