13
0
Commit Graph

682 Commits

Author SHA1 Message Date
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
cc7b8b1bc5
gcc-11 compat, volatile atomic variables (1/2)
"While 'atomic' has a volatile qualifier, this is a historical
artifact and the pointer passed to it should not be volatile."

Furthermore "It is very important that all accesses to a
particular integer or pointer be performed using only this API"
(from https://developer.gnome.org/glib/2.68/glib-Atomic-Operations.html)

Hence initialization of atomic variables is changed to also use
this API, instead of directly initializing the value.

This also fixes a few cases where atomic variables were
accessed directly.

see also libs/pbd/pbd/g_atomic_compat.h
2021-03-22 15:30:07 +01:00
7e1ce160e9
ARM 32bit enum alignment (used in MIDIBuffer)
Evoral::EventType is written directly into a uint8_t buffer
by dereferncing a pointer-type:
*(reinterpret_cast<Evoral::EventType*>((uintptr_t)...)
2020-09-28 01:21:43 +02:00
472fe2b556
Prepare for distinct live-midi event type
The motivation for this is to determine if a given event
originates from a user-controlled live input controller or
from playback from disk or a MIDI file.

This distinction is required for VST3 MIDI learn.
2020-09-20 17:16:53 +02:00
b9cfb31205
Fix control-list editing (#8384)
This fixes segfaults as well as corrupt listes when copy/pasting
due to invalid iterators.

::mark_dirty() must be called with WriterLock, and
::rt_safe_earliest_event_linear_unlocked() must not be called
while _events is being modified. The Sequence iterator
(only user of that function) does not ensure this. Only the
sequence read-lock is taken.
2020-08-31 07:39:45 +02:00
65ecc1b40e
Do not interpolate away explicit MIDI automation points #8362 2020-08-15 01:57:01 +02:00
e4c56a0371
Remove unused API
These are longer be used since Seuqnce has a "force_discrete"
boolen that needs to be taken into account in addition to
user-configurable ControlList _interpolation mode.
2020-08-15 01:56:42 +02:00
c6b87972b1
Remove unused libsmf seconds/time API
This significantly speeds up parsing MIDI files with complex
tempo-maps. e.g. "Black MIDI Trilogy_2.mid" has 24134 Tempo
changes. Prior to this commit parsing that file took over 5 minutes.
now it loads in under one seconds (libsmf only; libardour still
add overhead, and now needs about 30-40 seconds, previously
it took about 10 mins).

The problem was that every call to `smf_track_add_event_pulses()`
calls `seconds_from_pulses()` which calls `smf_get_tempo_by_seconds()`
which iterates over the tempo-map:

  for every midi-event { for ever tempo until that midi-event {..} }

This does not scale to 3.5M events and 24k tempo-changes.
2020-07-16 18:38:03 +02:00
ba7db8759b
SMF: remove unused variable (from 803dab7d87) 2020-07-16 18:35:43 +02:00
803dab7d87
SMF: various backports from libsmf PR7
see also https://github.com/stump/libsmf/pull/7

* Fix validity checks of escaped data
* Handle non-EOT-terminated tracks.
* Fix buffer overflow on tempo change event
* Fix memory leaks in case loading fails
* Fix a logic errors in extract_escaped_event()
* Fix the assertion problem `is_sysex_byte(status)`
* Make libsmf more tolerant to malformed MIDI files.
  (fixes import of files generated by NoteEdit)
2020-07-16 18:00:40 +02:00
23e6dd5f6b
NO-OP: backport some libsmf doc and warnings 2020-07-16 17:58:04 +02:00
43158047ed
SMF: use glib macros for endian conversion 2020-07-16 17:57:59 +02:00
650fd31332
Improve debug message 2020-06-12 05:08:40 +02:00
Daniel Appelt
522d6d769c
Add ControlList docs that are relevant for Lua 2020-05-28 18:52:02 +02:00
44bca6cc8f
Fix memory leak when reading MIDI files 2020-05-22 01:29:25 +02:00
447b473a1d slight better warning/debug message for a stuck note to-be-deleted 2020-05-04 18:48:17 -06:00
c264ab6c95
Remove debug output 2020-04-23 02:29:45 +02:00
9a93583ef7 fully initialize SMF tempo information to default (4/4, 120bpm)
Leaving CPC and 32nd-per-quarter at -1 causes arithmetic errors later if the SMF
file doesn't contain an explicit time signature meta-event
2020-04-21 21:17:14 -06:00
5c789547cb
Fix building unit-tests 2020-01-27 17:43:37 +01:00
3b65b430aa
Remove midi-event by iterator, not key -- #7885
With concurrent events removing by key, allowed for invalid
iterators.
2020-01-25 22:15:37 +01:00
06b2eb1c27
Explicitly use OSX
Previously this was inherited via PBD.

On MacOS/X,  this adds
  "-undefined dynamic_lookup -flat_namespace"
and various "-framework .." options to linkflags

Without this flag, .dylibs fail to link usually because
of missing `-lintl` (Undefined symbols: "_libintl_dgettext")

On other systems this is a NO-OP:
CFLAGS_OSX, CXXFLAGS_OSX and LINKFLAGS_OSX
are only set on the darwin platform.
2020-01-25 04:07:41 +01:00
Nikolaus Gullotta
4b355868cc Fix test breakage from a855119bdd 2020-01-16 14:01:18 -06:00