Commit Graph

18809 Commits

Author SHA1 Message Date
227815ebab fix crash introduced in d8b3 2022-02-12 09:34:42 -06:00
d8b3fbb94e beatcnt is a derived property from tempo and segment-length 2022-02-12 09:04:48 -06:00
b3ec5df8a8 triggerbox: some additional DEBUG_TRACE messages 2022-02-11 15:22:45 -07:00
40a1997c0e triggerbox: reimplement enqueue_trigger_source using a map of UISTate entries
* "Range->Bounce to Trigger Clip" needs to set tempo
* Range->bounce can operate on multiple tracks (regions) in one operation
2022-02-11 15:31:54 -06:00
742e3659ff triggerbox: add name, color and tempo to UIState; used for gui operations like d+d 2022-02-11 15:25:59 -06:00
37a5edb2cd triggerbox: initialize values of UIState (c++11 style) 2022-02-11 15:25:59 -06:00
1777f9af0c triggerbox: working (?) "stop all cues" cue marker 2022-02-11 13:36:58 -07:00
98f1b4364d triggerbox: implement function for translatable marker names 2022-02-11 11:33:27 -07:00
914b2447b8 triggerbox: a cue marker/event with cue-id < 0 means "stop all" 2022-02-11 11:33:06 -07:00
a1384d2789 triggerbox; fast-forward should do nothing if we are not use cue markers 2022-02-11 10:33:11 -07:00
d18426ee95 debug output to show contents of trigger property changes 2022-02-11 10:32:50 -07:00
f7881af554 do not recurse 2022-02-11 10:21:48 -07:00
008f0d4e4c triggerbox: do not send Trigger property updates while fast forwarding 2022-02-11 10:16:04 -07:00
e14b8a142d triggerbox: a cue marker that refers to an empty slot ends a previously playing slot (in fast forward) 2022-02-11 09:11:43 -07:00
9f39cca21f remove debug output 2022-02-11 08:47:59 -07:00
3553d56f05 tempo map: fix loading 6000-version or earlier tempo maps
Probably a copy-n-paste error meant the reversed logic was used
to decide if we had found an inital tempo and meter
2022-02-11 08:46:49 -07:00
2bf8b7ce11 triggerbox: mostly working fast-forward for MIDI triggers 2022-02-10 19:59:48 -07:00
395b759f42 midi state tracker: extend, fix, improve API for flushing state 2022-02-10 19:59:48 -07:00
bf273a90ca
Auditioner: collect MIDI Bank/Program changes
This will allow to directly set MIDITrigger PC override
from the auditioner.
2022-02-10 02:22:35 +01:00
771db9e238 NOOP: remove blank lines 2022-02-09 17:26:25 -07:00
f941041805 triggerbox: use C++11 syntax for iteration 2022-02-09 17:26:25 -07:00
439e112d32 triggerbox: pay attention to the fact that a trigger may have Stopped while fast-forwarding 2022-02-09 17:26:25 -07:00
baacd3bb50 triggerbox: no need to call reset_stretcher() explicitly in ::_startuo()
Trigger::_startup() calls ::retrigger() and that will call reset_stretcher()
2022-02-09 17:26:25 -07:00
0b5d449686 triggerbox: slightly improved DEBUG_TRACE output for property setters 2022-02-09 17:26:25 -07:00
0ad90f826e triggerbox: handle realtime part of transport stop explicitly in TriggerBox 2022-02-09 17:26:25 -07:00
19b844e054 triggerbox: sync ui property state with internal for inactive triggers 2022-02-09 16:34:03 -07:00
baf2323798 add PBD::PropertyChange::dump (std::ostream&) to make it easier to see what changed 2022-02-09 10:08:01 -07:00
f58b8e3cb4 fix accidental insertion of "x1" 2022-02-09 10:08:01 -07:00
e77e3b35b8 mackie: fix crash when using thread-local tempo map
TempoMap::use() assumes the thread_local pointer has been set up. This
is not the case for the control protocol event loop, so call ::fetch()
instead which does not require this assumption (and sets the thread_local
pointer too, though nothing else in the Mackie code uses it)
2022-02-09 10:08:01 -07:00
beffc7eb7f fix another ordering change introduced during a manual rebase fixup 2022-02-08 21:08:15 -07:00
93e1b77fe2 fix mistake introduced during rebase fixup 2022-02-08 21:07:07 -07:00
11042914e1 triggerbox: remove a bunch of cerr output and fix up audio stretcher reinitialization 2022-02-08 20:58:27 -07:00
629efe29f4 triggerbox: initial implementation of start_and_roll_to () for AudioTriggers.
This also required a mechanism to prevent the fact of a non-null "currently_playing" value in
the TriggerBox from starting the transport, which is handled with Triggerbox::_locate_armed. This
is set when _currently_playing is set from TriggerBox::fast_forward()
2022-02-08 20:58:27 -07:00
e8b6728d2e triggerbox: fix looping of MIDI triggers
Problems were caused by a variety of interlocking errors.
DEBUG_TRACE() output has also been enhanced and added.
2022-02-08 20:57:32 -07:00
f77e9aa6c8 triggerbox: architectural changes to facilitate fast-forward 2022-02-08 20:57:32 -07:00
da0d16c712 midi state tracker: invert use of 0x80 to indicate "unset"
If a state variable has the 8th bit set, that indicates that it is unset.
2022-02-08 20:33:46 -07:00
19a4f6a437
Fix restoring Trigger state 2022-02-09 02:30:40 +01:00
5f84209c30
Add API to ignore PC per TriggerBox 2022-02-09 02:30:40 +01:00
f9dbe34900
Add missing include 2022-02-08 21:24:54 +01:00
54b3a3bf6b less marimbas! 2022-02-07 19:43:34 -06:00
5f9d0743c9
Allow to loop auditioning 2022-02-07 04:39:05 +01:00
2328df23e5
Collect and postpone send delayline updates
In order to detect if route delaylines need to be updated,
aux-send delaylines need to be updated first. This was previously
done directly in the latency-callback, which may be concurrent
with processing.

Now only the information (pending_delay) is set, and the actual
change happens later at the end of process().
2022-02-07 04:31:42 +01:00
31b7e18d7d
Fix edge-case race initialize_latencies() vs process()
Due to _init_countdown when the engine starts, it is
extremely unlikely that Session::initialize_latencies(),
which is invoked by AudioEngine::Running runs concurrently
with Session::process, but at least in theory it would be possible.
2022-02-06 00:45:49 +01:00
77bca98fc0
Revert "Triggerbox: revert test-code"
This reverts commit 220b1386ab.
because it causes crashes when saving sessions.

_channel_map[] must not be empty, otherwise

Program terminated with signal SIGSEGV, Segmentation fault.
snprintf (buf, sizeof (buf), "%d", _channel_map[chn]);
#0  ARDOUR::MIDITrigger::get_state() (this=0x55d676b4c600) at ../libs/ardour/triggerbox.cc:1962
#1  0x00007f58ccb40b12 in ARDOUR::TriggerBox::get_state() (this=0x55d676b4d720) at ../libs/ardour/triggerbox.cc:33
2022-02-05 19:19:37 +01:00
77bfba1281
Revert "Fix playback of initial notes during MIDI audition"
This reverts commit 617697a823.
2022-02-05 19:16:44 +01:00
c870c22c87
Process Audition: process events before run
Calls DR::set_pending_overwrite() sets DR::run_must_resolve
before the first run.

Previously this variable was set after the first ::run,
which resulted in notes at the beginning of audition to be
cut short.
2022-02-05 19:16:00 +01:00
0db261cf64
Merge Overwrite request for the track
Previously events with different reasons where treated as two
separate events. Processing an Overwrite request causes
post-transport-work to set.

Since ::non_realtime_work_pending() is true, process_event()
is not called, and no further immediate events are evaluated in
the same cycle.

So Overwrite requests were repeated over multiple cycles.
2022-02-05 19:04:22 +01:00
cd53301d06
Significantly speed up loading SMF tempo-maps
Files that have many tracks, each with tempo information
were near impossible to load (30+ mins on modern 4.2Ghz CPU!),
because tempo is parsed incrementally:

```
For each new track:
  for each new tempo-event:
    rewind()
    for each loaded track so far:
      for each event on this track so far
```

This reduces the complexity from O(tracks^2 * tempos^2)
to O(tracks * tempos).

"Come Thou Fount Tempo Map.mid" has 238 Tracks and 56168 total
Tempo Changes (236 per track). This now requires only 56168 iterations
in smf_create_tempo_map_and_compute_seconds, rather than 1.64e+9
iterations
2022-02-05 17:33:21 +01:00
207ad2d369
Add API to query SMF note-count and pgm-changes
This information is useful for trigger-clips, in particular
if the file can change synth-settings via patch-changes.
2022-02-05 17:33:21 +01:00
220b1386ab Triggerbox: revert test-code 2022-02-04 21:48:45 -06:00
e2c550bcdd Auditioner: expose synth_info 2022-02-04 21:41:34 -06:00
3694009176
Fix silence w/MonitoringSilence and triggerbox 2022-02-05 01:10:27 +01:00
12e8235193
Add API to query set of used MIDI channels in a SMF 2022-02-05 00:13:27 +01:00
617697a823
Fix playback of initial notes during MIDI audition 2022-02-04 19:32:34 +01:00
4fe9d99674
Auditioner: add API for UI to run the synth (idle)
This allows the synth to process injected out-of-band MIDI
data, such as Program/Patch Changes while audition is inactive.
2022-02-04 13:46:13 +01:00
5e2912b7eb
Auto Monitoring takes TriggerBox into account
MonitoringDisk is now only set implicitly if the triggerbox
contains no cues.
2022-02-04 01:47:20 +01:00
18207c6896
Fix Triggerbox empty(), active-slots count on session load 2022-02-04 01:40:54 +01:00
d9ec733c47
Dump XML node if loading a source fails
This helps to debug issues, in case this comes up in a session
with many sources.
2022-02-03 21:57:13 +01:00
3c2fdab1ce triggerbox: add Properties::channel_map (and sent it); save/restore channel map state (untested) 2022-02-03 13:07:04 -07:00
bce4eb36ad triggerbox: add MIDITrigger channel mapping 2022-02-03 12:37:49 -07:00
ead02f50b1 triggerbox: save/restore state for assigned patch changes in MIDITrigger 2022-02-03 09:24:30 -07:00
fd3d17562c triggerbox: do not send embedded patch change events if Trigger has its own 2022-02-02 16:05:17 -07:00
a9b484e97e
Auditioner: retain instrument plugin
This allows the Trigger Clip Picker to keep the
Plugin GUI available, and retain any custom settings.
2022-02-02 23:08:48 +01:00
35b6ddfb77 triggerbox: deliver required patch changes into buffers whenever MIDITrigger::startup() happens 2022-02-02 15:06:11 -07:00
c7b8faad5a MidiStateTrack: use correct hex values to manage set/unset state 2022-02-02 15:06:11 -07:00
374faa0d5c PatchChange: use correct hwx constants to detect/set "unset" byte values 2022-02-02 15:06:11 -07:00
31f4d8a2ca PatchChange: fix operator=() implementation which failed to manage event buffer ownership correctly 2022-02-02 15:06:11 -07:00
6175af002c triggerbox: MIDITriggers get 16 patch changes, 1 per channel
These can be set, fetched and queried but at this point they do nothing
2022-02-02 15:06:11 -07:00
603d1f1f57 evoral: some changes/extensions to Evoral::PatchChange to make it more useful
The concept of an "unset" PatchChange now exists, and thus a default constructor that constructs
such a thing
2022-02-02 15:06:11 -07:00
0b395c161d triggerbox: apply gain to MIDI note events 2022-02-02 09:58:57 -07:00
2eadb75bd1 move static scale_midi_velocity() function from Amp to Evoral::Event 2022-02-02 09:58:57 -07:00
15f248975f remove unused member of MidiStateTracker
We store "have program" as the 8 (MSb) bit of the program
array, and similary for other state holding elements
2022-02-02 09:58:57 -07:00
6900facef2
Fix potential deadlock
block_processing() may hold the process-lock, waiting
for the latency-lock. at the same time audio-engine
may hold the latter, trying to acquire the former.
2022-02-02 14:16:50 +01:00
fec679c602 triggerbox: refactor ::maybe_compute_next_transition() so that we can use the same code when fast-forwarding 2022-02-01 19:55:37 -07:00
f5d5ecffbb triggerbox: change note tracker to a full state tracker, and move it up to the TriggerBox
We don't need one state tracker per trigger, one per box is more appropriate
2022-02-01 18:06:40 -07:00
8449d344ae add MidiNoteTracker::flush_notes() that writes note-on events corresponding to currently-on notes
This does not maintain note timing, but once the buffer contents arrive at a receiver, it should
be playing all the notes that were marked on in the tracker
2022-02-01 18:06:40 -07:00
885d2feb6a add basics of a method to flush MidiStateTracker state to a MidiBuffer
When the buffer is delivered to a receiver, the receiver should (theoretically) end up
the same state as the MidiStateTracker
2022-02-01 18:06:40 -07:00
04004d2178 add skeleton for full MidiStateTracker 2022-02-01 18:06:40 -07:00
1ab49bcc32 change MidiStateTracker to MidiNoteTracker
The old name will become a bigger class/object that tracks all MIDI state,
not just notes
2022-02-01 18:06:40 -07:00
77a60d9e2d
Remove unused API 2022-02-02 00:27:35 +01:00
f103b984ab
Fix bounce + callback concurrency
Prevent Session::write_one_track to commence while latency
callback is already in progress. See also
* 19067f8c87
* 2eaa0183ef
2022-02-02 00:27:35 +01:00
19067f8c87
Another refinement to address bounce + callback concurrency
see also 2eaa0183ef
2022-02-01 23:49:38 +01:00
200469dce8
Remove 18 month old debug messages 2022-02-01 22:01:41 +01:00
031a05b07a
Return early if processing is blocked
There is no need to setup thread-local variable
if they are never used.
2022-02-01 21:40:11 +01:00
2eaa0183ef
Fix bounce + latency update concurrency
When bouncing Region or Range, Session::write_one_track()
blocks processing, but takes no process-lock.

It is possible that a latency-callback arrives at the same
time while Route::bounce_process is active and calls ::run.

This can trigger a delayline.cc  Assertion `lm.locked ()' failed
in either thread.

Now latency-callbacks are postponed until the session can
process normally again
2022-02-01 21:40:11 +01:00
c17fbd5abc
Fix poor_mans_glob, ~' for $HOME' is only valid at the start of a path 2022-02-01 15:47:54 +01:00
6f04296635
Expand default clip-library-dir preference at application start
This is in preparation for allowing to use it in Preferences.
Previously it was lazily set when first used.
2022-02-01 15:47:54 +01:00
8e4fdb071b triggerbox: keep track of, and make available, "empty" status for a triggerbox.
Includes PBD::Signal that notifies when a TriggerBox's empty status changes
2022-01-31 22:40:05 -07:00
b55ef8543d
Fix compilation of triggerbox.cc (amend ca6c99586f) 2022-02-01 03:50:23 +01:00
2fdf54874a triggerbox: remove unused enable_triggers config var (reverts 21ed6a) 2022-01-31 20:25:05 -06:00
ca6c99586f triggerbox: minor arithmetic fix to help with clicks at clip end
process_index should not be compared/combined with expected_end_sample, since
the former is a process-cycle count and the latter is a timeline position.
2022-01-31 15:57:13 -07:00
866ba8b174 playlist: find_prev_region_start() should return zero if no earlier region is found (used during rippling 2022-01-30 22:49:52 -07:00
cc426b6d14
Dim text rendered with ShadedPlusSign 2022-01-31 01:58:42 +01:00
f4dd5d9a6f
Add folder icon 2022-01-30 22:44:39 +01:00
d43e2c25bc triggerbox: remove passthru property and everything related.
TriggerBox is always a passthru processor now. Monitoring (or not) is intended
to be controlled via other means
2022-01-30 13:37:52 -07:00
4450b5be2c triggerbox: potentially useful comment about the process of slot property-setting
* first the region is scanned for bpm and one-shot status
* then we handle properties that should be applied from a drag&drop
* then we handle the existing arrangement-style slot properties that should persist
2022-01-30 13:44:41 -06:00
3689068561
Clip Library support
This allows to export Regions to a shared folder.
2022-01-29 16:22:47 +01:00
01d964b176
Do not announce exported MIDI files
This would otherwise trigger ARDOUR::Session::add_source
which will add the external path to as session search location.
2022-01-29 16:22:33 +01:00
6dc66ea78f
Prioritize self-deletion
This addresses the issue described in 83719fba1a.
First process all queued self_delete() requests before scheduling
Editor::redisplay_track_views() which uses PRIORITY_DEFAULT.
2022-01-29 05:17:00 +01:00
c6a31250ba alter Source::_length from timecnt_t to timepos_t
THe length of a Source(File) is always measured from its start. In this sense,
the length is like a position on the timeline, which is a duration with an
implicit origin, or a Region start, also a duration with an implicit origin (in
that case the start of the Source). There is no good reason for using
a timecnt_t for this value, because the position component of a timecnt_t
(the origin for the duration) is implicit and always zero. So we make
this property into a timepos_t, and include a number of asserts() to check
for common possible coding errors related to the time domain
2022-01-28 15:52:27 -07:00