13
0
Commit Graph

658 Commits

Author SHA1 Message Date
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
d79e869da8 use "extends to numeric_limits<Beats>::max()" rather than "zero length" for nascent (incoming) notes 2020-01-11 10:57:21 -07:00
8547a23e9c removal incorrect/unnecessary forward decl 2020-01-11 10:57:21 -07:00
39bdde4250 Use labs() for long instead of abs() 2019-12-09 23:25:51 +01:00
7d90ad4023
Fix bool-automation anchor
Typo sneaked in from ff2f93497...cc7de475f2
2019-11-13 16:53:46 +01:00
John Emmas
c7bdc38c95 Accommodate some recently moved/renamed folders and source files (libevoral) 2019-11-03 13:46:29 +00:00
eaae38ba84 move evoral/src/* to evoral/ 2019-11-02 16:32:18 -06:00
a855119bdd rename all Evoral source from .(hpp|cpp)$ to .(h|cc) 2019-11-02 16:32:18 -06:00
88f9aaff7d
Add API to safely query timestamp of first/last control event
Direct calls to back()->when or front()->when are not safe
when the list is concurrently modified, or empty.
2019-10-18 01:37:56 +02:00
e0d5c1426c
NO-OP: fix some Wimplicit-fallthrough
gcc can recognize various regexps in comments. Since C++17 provides
[[fallthrough]], using /* fallthrough */ consistently seems
appropriate until we switch to C++17.

see also https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
2019-09-18 17:37:54 +02:00
cb3afb6981 Remove a (no longer needed) source file from our MSVC project (evoral) 2019-09-18 15:05:16 +01:00
60bce78c7e
Fix Wdeprecated, dynamic exception
Dynamic exception specifications are deprecated in C++11,
and were removed in C++17.
2019-09-18 04:43:09 +02:00
bf806cde66
Remove old unused source file 2019-09-18 04:37:12 +02:00
beccc53bb6
Unit-test: parameter ranges outside [0..1]
More updates after 3d15499cda

* set parameter-range for MIDI sequences
* set parameter-range for cubic spline
2019-09-05 22:42:08 +02:00
5dfb729155
Remove unused header (superseded by libtemporal) 2019-09-05 14:09:22 +02:00
efec546035
Fix libevoal unit-test compilation 2019-09-05 14:08:31 +02:00
0301c47f6b
Update core library GPL boilerplate and (C) from git log 2019-08-03 15:53:17 +02:00
8dbbc19567
Update MIDI Event precedence
A patch-change that is concurrent with a note-on event should be sent
before the given Note-on event.

As follow up: CCs also need to be prioritize to send bank-select first.

see also https://discourse.ardour.org/t/midi-strangeness-patch-setting-and-first-notes/101415
2019-07-30 21:17:15 +02:00
2f91bdfa53
NO-OP: <tab> after <space> fixes in libs 2019-04-13 19:19:29 +02:00
57ebb5c1ba
Remove cruft: unused typedef 2019-04-09 02:23:17 +02:00
6f95dfdc31
Fix MIDI Aftertouch (import, record and play) in the backend 2019-04-02 15:35:57 +02:00
6fa1c58cec
Add guard-points when shifting automation 2018-12-22 02:04:17 +01:00
616f7f40b6
Properly remove-time automation
Previously "remove time" was able to produce overlapping, not
ordered automation.
2018-12-22 01:09:24 +01:00
c98fc1099d Fix some Wimplicit-fallthrough
A "fall through" comment is most portable way to indicate
"no break, fallthru" cases.

 * __attribute__ ((fallthrough))  // is not portable
 * [[fallthrough]]; // is C++17
2018-10-26 14:53:44 +02:00
8ed33f1bc7 remove use of hardcoded -fPIC compiler flag, and use compiler flag dict instead 2018-10-14 22:06:11 -04:00