Commit Graph

20615 Commits

Author SHA1 Message Date
Robin Gareus fbcf281425
Add Lua TempoMap Changed signal 2023-09-11 00:48:47 +02:00
Robin Gareus e45fcad607
Pass old and new TempoMap via MapChanged signal 2023-09-11 00:48:04 +02:00
Robin Gareus 0e3594bb1c
Add Temporal::Beats Lua bindings 2023-09-10 22:23:57 +02:00
Asahi Lina d1cc71150f Adjust interpretation of swing amount
Previously,

0 -> no swing (1:1, 50%)
50 -> triplet swing (2:1, 66%)
75 -> hard swing (3:1, 75%)
100 -> sextuplet swing (5:1, 83%) (default!)
150 -> absolute maximum (inf:1, 100%)

This is rather confusing...

One common interpretation uses percentages of the beat, where triplet
swing is 66%. However, that causes precision issues since it's really
66.666...

Since we already default to 100 and take "no swing" as zero, let's make
that reference point triplet swing. Then the scale becomes:

0 -> no swing (1:1)
100 -> triplet swing (2:1)
150 -> hard swing (3:1)
200 -> sextuplet swing (5:1)
300 -> absolute maximum (inf:1)

300 doesn't make any sense, so let's change the range to -250 .. 250
which covers all useful values.

Also remove the division through 100 and back, to avoid rounding issues.

Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-09-09 20:06:37 +09:00
Asahi Lina f1004a445e Fix quantization swing
- Fix selection of what beats to swing (was always done)
- Fix swing strength (lack of precision rounded to 50% or 100%)
- Fix model offset not being applied properly

Signed-off-by: Asahi Lina <lina@asahilina.net>
2023-09-09 20:06:37 +09:00
Paul Davis 4ff8cff024 add velocity sense for MIDI Learn-ed clip triggering 2023-09-08 15:27:11 -06:00
Paul Davis 2f25592702 push2: add velocity sensitivity 2023-09-08 14:57:28 -06:00
Paul Davis 1249195516 push2: remove debug output 2023-09-08 14:57:07 -06:00
Paul Davis b440488295 launchpad pro: provide velocity info when launching clips/triggers 2023-09-08 14:41:21 -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
Robin Gareus e88a121ff8
Fix canvas rectangle bounding box
When drawing the outline of a rectangle, the bounding
box must cover the whole pixel of the line. Otherwise
the line would be left behind when the rectangle shrinks.
2023-09-07 02:45:26 +02: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 58b667c6c0 temporal: fix crash caused by unsafe use of tempo map iterators 2023-09-06 14:46:24 -06:00
Paul Davis 3675f8f444 launchpad pro: remove debug output 2023-09-06 14:46:24 -06:00
Paul Davis 6d9c47c920 launchpad pro: only light Sends button if the selected stripable has 1+ sends 2023-09-06 14:46:24 -06:00
Paul Davis 1ec966d964 launchpad pro: allow clear+cue buttons to ... clear a cue 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
Robin Gareus f339236c5b
Add icon for the Grid tool 2023-09-06 19:13:59 +02:00
Robin Gareus c2ce0bcb4a
Amend 101744b8, allow `when` and `start` to point to the same variable 2023-09-06 01:01:30 +02:00
Ben Loftis 101744b812
Add method to find a section location by position 2023-09-05 23:08:29 +02:00
Robin Gareus 5c888f2b90
Fix deadlock when cut/pasting section to itself 2023-09-05 23:08:29 +02:00
Paul Davis 5223d05854 launchpad pro: various improvements and fixes 2023-09-04 19:41:25 -06:00
Paul Davis 269699c340 temporal: fix get_grid() to work in the presence of "weird" BBT markers 2023-09-04 19:41:25 -06:00
Paul Davis 13bdfda81a temporal: add Meter::round_up_to_beat_div()
reimplement round_up_to_beat() in terms of round_up_to_beat_div()
2023-09-04 19:41:25 -06:00
Paul Davis f1f5df7c9a temporal: add BBT_Time::round_up_to_beat_div() 2023-09-04 19:41:25 -06:00
Paul Davis 7c5e7ddf59 temporal: improve operator<<() for MusicTimePoint (BBT markers) 2023-09-04 19:41:25 -06:00
Paul Davis 0266d98a3b temporal: add TempoMap::{max,min}_notes_per_minute() API 2023-08-31 18:23:40 -06:00
Paul Davis cda0d6ce9f temporal: fix totally broken implementation of TempoMap::shift (timepos...) 2023-08-31 18:22:59 -06:00
Paul Davis c778a6df67 ripple backwards when cutting a section 2023-08-31 18:22:25 -06:00
Paul Davis 69cfe9d3f9 add missing ripple during cut/copy/paste of sections 2023-08-31 18:21:56 -06:00
Paul Davis 4969fb9e0b libpbd: tweak for printing pthread ID (windows is int/*nix is ptr) 2023-08-31 10:34:48 -06:00
Paul Davis c4cb8dbda9 arithmetic simplification 2023-08-30 16:07:48 -06:00
Paul Davis 864b660abe lppro: working send faders, some work on color & pulse for select buttons 2023-08-30 16:06:14 -06:00
Paul Davis e664acc16e lppro: working pan fader controls 2023-08-30 16:06:14 -06:00
Paul Davis 75802cc47b lppro: momentary mode for all fader layouts 2023-08-30 16:06:14 -06:00
Paul Davis ee0d5cfc40 lppro: working gain faders 2023-08-30 16:06:14 -06:00
Paul Davis bc7f25e52c libpbd: AbstractUI must call & destroy sigc::trackable callbacks in its destructor
AbstractUI IS-A BaseUI IS-A EventLoop
                       IS-A sigc::trackable

If we have sent a call_slot() request to an EventLoop that has not executed
when the object involved in the call_slot() functor is destroyed, we need to
ensure that the request is invalidated.

To do this, We register "notify" callbacks with the sigc::trackable that is a
base class of the object involved in the functor given to
call_slot(). sigc::trackable will call these "notify" callbacks from its
destructor.

So when the call_slot() functor's relevant object dies, and its sigc::trackable
base class is destroyed, it will invoke all of its the "notify" callbacks, which will
in turn call EventLoop::invalidate_request() and this hopefully marks all the
queued call_slot() functors as "do not call".

However, invalidate_request() requires a lock, and access to the lock is
granted via a pure virtual, EventLoop::slot_invalidation_lock(). In the
heirarchy cited above, this is implemented by AbstractUI.

When we destroy an AbstractUI, ~AbstractUI() is called first, and this destroys
the lock and changes the VTT so that ::slot_invalidation_lock() becomes a pure
virtual again.

Eventually we will call ~trackable() which in turns runs all the "notify"
callbacks, and then removes them. But when these callbacks end up in
EventLoop::invalidate_request(), we try to call ::slot_invalidation_lock() and
C++ will abort because of its (now) pure virtual status.

Therefore, we must invoke the "notify" callbacks before the
::slot_invalidation_lock() becomes pure, and that means inside ~AbstractUI, as
an explicit call to trackable::notify_callbacks().

This has not appeared before (remarkably), but became an issue when the
Launchpad Pro support code's main object (derived from MIDISurface and hence
from AbstractUI) "failed" to use sub-objects for its various methods. So when
it connects to, for example, the Session::RouteAddedOrRemoved signal, it is
connecting itself (derived from a sigc::trackable). When the Launchpad Pro
object is destroyed, it tries to invalidate all the call_slot() requests, but
this requires access to an event loop lock - owned by the Launchpad Pro event
loop, which is already destroyed!

Other surfaces have generally avoided this by using other objects to provide
methods of dealing with signals from libardour objects.
2023-08-30 16:06:14 -06:00
Paul Davis 187557df57 midi surfaces: use an event loop invalidator for call_slot() 2023-08-30 16:06:14 -06:00
Paul Davis d5ad9ff033 libpbd/guis: move __invalidator() into PBD::EventLoop
we allow use of/dependency on sigc::trackable there, so this is
both legal but also sensible.

Leave the macro definition of invalidator(x) in gtkmm2ext/gui_thread.h
because it doesn't hurt and makes some sense for it to be there. No
reason for a source module that needs invalidator(x) to load EventLoop
decl.
2023-08-30 16:06:14 -06:00
Paul Davis f5f48b421e lppro: get long press working, add undo/redo/metronome 2023-08-30 16:06:14 -06:00
Paul Davis 9ee7c33737 lppro: solo, mute, rec-enable basics 2023-08-30 16:06:14 -06:00
Paul Davis a6e9d6ecd1 lppro: fix selection button color when "off" 2023-08-30 16:06:14 -06:00
Paul Davis 784fa82081 lppro: selection enabled and displayed 2023-08-30 16:06:13 -06:00
Paul Davis a49c961189 lppro: handle new slots and new routes and improve color display 2023-08-30 16:06:13 -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 f3861a79b6 lppro: more work on displaying triggers, including return of the color map 2023-08-30 16:06:13 -06:00
Paul Davis f65e0b85a8 libpbd: add operator<< for PropertyChange 2023-08-30 16:06:13 -06:00
Paul Davis 1ea104eac1 lppro: fix invalidators 2023-08-30 16:06:13 -06:00
Paul Davis 5cfa881fa9 lppro: more state tracking, stop clip handling etc. 2023-08-30 16:06:13 -06:00
Paul Davis 9fa2fccb5c lppro: track trigger state changes 2023-08-30 16:06:13 -06:00