13
0
Commit Graph

703 Commits

Author SHA1 Message Date
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
8657eba4c5 evoral: NOOP reorder and edit comments 2022-04-05 20:52:09 -06:00
8c3fad0133 evoral: fix implementation of rt_safe_earliest_event_linear_unlocked
Code within the method was using @param start_time rather than start, which is a modified
value required to generate the correct results.

This comment also contains some logical reordering, optimization and commenting
on this rather complex method.
2022-04-05 20:52:09 -06:00
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
5fbc390821 evoral: NOOP whitespace adjustment 2022-04-05 20:52:09 -06:00
83dc2fe407 evoral: change interpolation distance to match 6.x
Note that the value is still defined in Beats (ticks) rather than seconds
which means that the interpolation density is tempo-dependent. This
should still likely change one day.
2022-04-05 20:52:09 -06:00
176c41a485
Fix region-gain when region-start is trimmed
Region-gain (unlike other automation) is specific to the
region and independent of the source. Region::start() offset
does not apply. When region-start is trimmed the region's
envelope is modified (not just offset). The event-list is truncated.

Any audio-region envelope does (and must) have a point exactly
at the start and end of the region.

truncate_start() can thus calculate the earliest position of
valid events with the new length relative to the last event.

The mathematical operator for that is subtraction, not distance.
2022-03-17 23:46:55 +01:00
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
b96b97c439 PatchChange: fix set_channel() 2022-03-01 10:11:14 -06:00
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
f9dbe34900
Add missing include 2022-02-08 21:24:54 +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
12e8235193
Add API to query set of used MIDI channels in a SMF 2022-02-05 00:13:27 +01: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
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
2eadb75bd1 move static scale_midi_velocity() function from Amp to Evoral::Event 2022-02-02 09:58:57 -07:00
Mads Kiilerich
8bb91099c5 wscript: drop configure statements already present in the top level wscript
Avoid repeated pointless configure messages like:
Checking for 'g++' (C++ compiler!)                   : /usr/lib64/ccache/g++
Checking for 'gcc' (C compiler)                      : /usr/lib64/ccache/gcc
2022-01-22 22:19:03 +01:00
16511974e2
Fix class/struct mismatch C++ ABI [-Wmismatched-tags] 2022-01-10 00:06:24 +01:00
e295e1c8d7
Disable evoral unit-tests -- nutempo update is needed 2022-01-03 01:11:54 +01:00
60be0c27a1
Use updated temporal API 1/2 2021-12-11 14:42:36 +01:00
0733b2d9e2 SMF: Often files don't have Track+Instr names. Make something up to avoid file collisions. 2021-11-13 15:54:11 -06:00
35312dc85c SMF: API change: report format (0,1 or2) and total channels used 2021-11-13 15:54:11 -06:00
c74f80caa4
NO-OP: clean up maths, remove extra brackets
This may also help due to huge xdelta numbers.
2021-09-02 20:45:30 +02:00
940f3022c1 prevent addition of events to a ControlList whose time-domain does not match the ControlList's own time-domain 2021-08-30 15:15:14 -06:00
4fb3e24bd6 evoral: tentative fix for problems with Curve::multipoint_eval()
Now that we use superclock_t for audio time, it is possible for the square of an audio time value to overflow int64_t quite easily.
This change fixes that (and cleans up other code a little), but probably a different solution would be a good idea
2021-08-30 14:29:11 -06:00
0699449f29 evoral: debugging curve errors 2021-08-30 09:04:27 -06:00
4cef8c681c evoral: fix for Curve coefficient computation 2021-08-30 09:04:27 -06:00
9a53ef4020 libevoral: fix some existing or potential issues with time domains 2021-08-13 12:51:34 -06:00
e11ecd56a9 libevoral: avoid use of std::numeric_limits<timepos_t> which does not (or should not) exist 2021-08-13 12:51:34 -06:00
87e56f28e9 libevoral: remove semi-shadow local variable 2021-08-13 12:51:34 -06:00
6d154c14b4 libevoral: add a new method to set the time domain that can be used from ::set_state(), when the event list is not (yet) empty 2021-08-13 12:51:34 -06:00
1a41e98c1c improve comment for future readers 2021-08-13 12:51:33 -06:00
068cc4135f remove another NUTEMPO #warning (see comment) 2021-08-13 12:51:33 -06:00
7c10cf1d54 Automatable now requires (and owns) a time domain to be used by automation data 2021-08-13 12:51:32 -06:00
1a5e2aacff remove another NUTEMPO warning 2021-08-13 12:51:32 -06:00
7c61fe405c Evoral: cleanup for explicit Beats::operator bool() 2021-08-13 12:51:31 -06:00
779a04b0ce Evoral: alter ControlList::paste() to internally change time domain of pasted events 2021-08-13 12:51:31 -06:00
bed76798f3 manual fixups after rebase against master (general libs edition) 2021-08-13 12:51:31 -06:00
18fea5c7a9 changes required by fixing ambiguities in timepos_t/timecnt_t API (evoral edition) 2021-08-13 12:51:31 -06:00
def35cf043 mark BBT_Offset (double) constructor explicit to avoid implicit conversion in timeline expressions.
Also clean up the mess this had caused.
2021-08-13 12:51:30 -06:00
ebd8704f9d libevoral: tweaks related to timeline types based on libardour conversion 2021-08-13 12:51:29 -06:00
6b09642406 changes to compile against libtemporal and use of timepos_t/timecnt_t 2021-08-13 12:51:28 -06:00
f4490f54c5 change Timecode::BBT_Time to use Temporal namespace, plus a couple of other minor changes to enable compilation
This still uses the tempo map object in libs/ardour, not the new one in libs/temporal, and isn't likely to be functional
(though it could be)
2021-08-13 12:51:28 -06:00
d58e7c7ee4 Revert "fix handling of SMF files with consecutive noteOn events"
This breaks MIDI files that have events ordered On,On,Off,Off, and only fixes
the "malformed" On,On,Off. Correct fix requires collecting all events occuring
yat one time, sorting into Off,On and then merging.

This reverts commit 5c3e5f9afb.
2021-06-29 17:29:29 -06:00
5c3e5f9afb fix handling of SMF files with consecutive noteOn events
We no longer store nascent notes when noteOn is received, but wait till noteOff arrives. We also
ignore all other noteOn events between the earliest received and the noteOff.

Potentially we may want to use the _overlap_pitch_resolution member at some point
to offer control of this behavior.
2021-06-28 08:30:38 -06:00
336319a1df SMF meta-events do not set running status while parsing the file 2021-06-22 14:18:03 -06:00
c45be2266e support SMF markers without labels 2021-05-09 17:52:29 -06:00
f689e9ecab Evoral: add methods to SMF to load and access markers/cues in SMF files 2021-05-07 14:58:16 -06:00