Commit Graph

353 Commits

Author SHA1 Message Date
Paul Davis
05210fc7e2 Evoral: add ControlList::has_event_at (timepos_t) 2025-08-21 18:56:00 -06:00
Paul Davis
73065f814a modify API of Evoral::SMF::append_event_beats() to add meta-event legality
If the (new) final argument is true, we allow writing SMF meta events to the
underlying libsmf object (which doesn't care one way or another).
2025-08-18 16:35:41 -06:00
Paul Davis
b60702e014 add Evoral::SMF::end_track()
This changes the assumption that an SMF object only refers to
a single track when being written.

::end_track() is used within begin::write()/end_write() pairs to mark the start
of a new SMF track.
2025-08-18 16:35:41 -06:00
Paul Davis
785047bf47 add Evoral::SMF::is_meta() to test for SMF meta events
These are not legal in "live" MIDI but are allowed in SMF files.
2025-08-18 16:35:41 -06:00
Paul Davis
4ee709af7b libardour APIs for Sequence::shift (timepos_t const &)
A way to move all MIDI data in a Sequence later in time.

This is likely not finished, and may need a new signal for
notifications
2025-04-05 17:25:03 -06:00
Paul Davis
fd890b4891 evoral: add Sequence::channels_present() 2025-03-08 17:56:44 -07:00
Paul Davis
3ce789dc4c add ::duration_is_explicit() to SMF 2025-02-28 16:49:48 -07:00
Paul Davis
c0c9d79325 remove Evoral::Sequence::overlaps{_unlocked} (). Not used anywhere 2024-10-31 12:22:35 -06:00
Paul Davis
39661732c3 modify how Evoral::SMF (maybe) writes an EOT event into an SMF
every write pass deletes existing tracks, which means it also deletes any existing
EOT event. Rather than try to replicate the _length value() that is kept in a
Source object in the SMF object, add a virtual method to SMF that returns
the _length value (or std::numeric_limits<Beats>::max() if not set).

If the _length value is not the max, we will add EOT events to each track
(usually just one) right before writing to disk.
2024-10-31 12:22:35 -06:00
Paul Davis
ebcc6b8250 add the concept of a length that is data-independent to MIDI files (libs) 2024-10-31 12:22:35 -06:00
Paul Davis
9ed9567b43 Evoral: add new is_xxxx() methods for various MIDI events, including is_realtime() 2024-10-31 12:22:35 -06:00
Paul Davis
aa2fb8c1d4 SMF: add a set_length() method which will place TrkEnd meta-events 2024-10-22 14:49:50 -06:00
Mads Kiilerich
955e634371 Make header files more self-contained - add missing std includes 2024-10-20 03:11:53 +02:00
Mads Kiilerich
8a5f21d8e3 Drop some unused files - avoid trying to maintain stuff that can't be tested 2024-10-20 03:11:53 +02:00
Robin Gareus
74c4ca3e52 Reduce reliance on boost - the hard part
the rest from `tools/convert_boost.sh`.

* replace boost::function, boost::bind with std::function and std::bind.

This required some manual fixes, notably std::placeholders,
some static_casts<>, and boost::function::clear -> = {}.
2024-10-19 03:47:21 +02:00
Alejandro Domínguez
2436b4df06 Replace boost::noncopyable with C++11 deleted copy constructors 2024-10-19 01:04:15 +02:00
Robin Gareus
2d7cce44f1 Replace PBD::Signals (1/2) 2024-10-18 20:41:08 +02:00
Paul Davis
75f56cd3e1 the great onceification (libs)
Replace use of #ifndef header guards with #pragma once

Modern C++, baby!
2024-10-17 07:44:31 -06:00
Paul Davis
b35b30c230 factor out code to extract a TempoMap from an SMF 2024-10-17 07:44:29 -06:00
Alejandro Domínguez
1752f30a66 Remove #include <boost/utility.hpp> 2024-08-29 23:08:42 +02:00
Robin Gareus
ab62177bdf Fix incomplete doxygen doc (libardour) 2024-05-27 22:21:57 +02:00
Paul Davis
06e9bf6ca4 domain swaps for MIDI CC and other controls 2023-08-16 09:06:10 -06:00
Paul Davis
f92dcfa068 domain bouncing for Automatable/ControlLists 2023-08-15 08:34:42 -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
45b02538e6 Evoral: extend ControlList API with ::editor_ordered_points()
Much more efficient than adding points 1 by 1
2023-07-10 11:20:47 -06: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
39ed528e25 std-ize: convert all boost shared/weak ptr includes to <memory>
Also fix stdint.h -> cstdint and alphabetically order std includes
2023-03-24 14:19:15 -06:00
Robin Gareus
a5f36bbbbf Fix thinning (normalize parameter value)
This fixes thinning of MIDI data (range 0..127) and
other parameters with range other than 0..1.
2022-12-18 00:55:12 +01:00
Robin Gareus
fa858a0386 Fix pan automation
The time-domains need to match in order to use the
raw underlying .val() as double for interpolation.
2022-10-27 04:28:07 +02:00
Robin Gareus
0457646387 Allow to scan midi file during file read
This partially reverts eced764480. In many places Ardour uses
SMF directly, without loading the MIDI model in a libardour SMFSource.

In this case no information (track, channel-count) was available,
after eced764480, and worse various members were not initialized
and showed random numbers.

This fixes various import options.
2022-09-25 02:46:09 +02:00
Robin Gareus
5f5f4599f2 Fix MIDISource event-interpolation state save
The actual goal here is to use direct InterpolationStyle serialization
in MidiSource (identical to AutomationList). enum_2_string()
does not work for Evoral types.

As side-effect virtual base-classes have been changed to pass
Parameters as const references
2022-07-22 03:38:41 +02:00
Paul Davis
0d70be3a05 miscellaneous fixes for warnings from -Wconversion 2022-07-04 22:01:48 -06:00
Robin Gareus
ca49bc00f0 Remove old "user" API, use consistent get/set_double() 2022-06-29 01:39:02 +02:00
Robin Gareus
3623b39168 Replace ::user_double() with ::get_double() 1/2 2022-06-29 01:39:02 +02:00
Robin Gareus
a4a241c738 Prepare replacing ::user_double() with ::get_double()
Automation Controls (and controls in general) are now
only updated in realtime context. Either via automation-playback,
or via SessioEvent. This directly sets the Control:_user_value
(before emitting the Changed signal).

The GUI does not need to evaluate the control at a given point
in time, so the API call can be removed and unified.

This commit first removes all calls to "get_double" to ensure
that no special cases exist.
2022-06-29 01:39:02 +02:00
Paul Davis
2b8b9a3a2f const for const-sake 2022-05-01 18:01:35 -06:00
Paul Davis
d218dcb21b evoral: when adding points to a ControlList, coerce the time domain of the new point to the list time domain
This may not be the ideal solution, but for now it appears to be the best approach to preventing
points with different time domains with the same list
2022-05-01 17:50:51 -06:00
Paul Davis
3454353aa3 remove concept of "note-mode" from Evoral::Sequence (and thus ARDOUR::MidiModel)
This note-mode had no effect on anything at all, at least as far back
as 5.12. There is a note-mode in the GUI which affects the duration of notes
added using the GUI, and that remains in place. It is not clear
if the _percussive member of Evoral::Sequence ever had any effect on
the actual MIDI event stream the Sequence could generate.
2022-04-05 20:52:09 -06:00
Paul Davis
256e6f97a2 evoral: change how we specify a zero min_x_delta to rt_safe_earliest_event_linear_unlocked
See comment in the code for more details.
2022-04-05 20:52:09 -06:00
Ben Loftis
eced764480 smf_source: implement SMF::UsedChannels as a bitset; move midi screening into load_model()
we screen midi files for some aggregate info:
 used channels, used patches, and note-count

you can't do this from open() because there are cases (after importing)
 when the source exists but it is not yet written to disk
2022-03-01 10:11:14 -06:00
Ben Loftis
b96b97c439 PatchChange: fix set_channel() 2022-03-01 10:11:14 -06:00
Ben Loftis
fc3abecca0 PatchChange: yet more checks to keep patch state in sync (is_set())
* fix the case for creating an empty, unset patch
* fix is_set() for bank changes: 2nd byte is the one that gets 'set'
2022-03-01 10:11:14 -06:00
Robin Gareus
f9dbe34900 Add missing include 2022-02-08 21:24:54 +01:00
Robin Gareus
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
Robin Gareus
12e8235193 Add API to query set of used MIDI channels in a SMF 2022-02-05 00:13:27 +01:00
Paul Davis
374faa0d5c PatchChange: use correct hwx constants to detect/set "unset" byte values 2022-02-02 15:06:11 -07:00
Paul Davis
31f4d8a2ca PatchChange: fix operator=() implementation which failed to manage event buffer ownership correctly 2022-02-02 15:06:11 -07:00
Paul Davis
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
Paul Davis
2eadb75bd1 move static scale_midi_velocity() function from Amp to Evoral::Event 2022-02-02 09:58:57 -07:00
Robin Gareus
16511974e2 Fix class/struct mismatch C++ ABI [-Wmismatched-tags] 2022-01-10 00:06:24 +01:00