Commit graph

414 commits

Author SHA1 Message Date
Robin Gareus
0301c47f6b
Update core library GPL boilerplate and (C) from git log 2019-08-03 15:53:17 +02:00
Robin Gareus
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
Robin Gareus
2f91bdfa53
NO-OP: <tab> after <space> fixes in libs 2019-04-13 19:19:29 +02:00
Robin Gareus
57ebb5c1ba
Remove cruft: unused typedef 2019-04-09 02:23:17 +02:00
Robin Gareus
6f95dfdc31
Fix MIDI Aftertouch (import, record and play) in the backend 2019-04-02 15:35:57 +02:00
Robin Gareus
6fa1c58cec
Add guard-points when shifting automation 2018-12-22 02:04:17 +01:00
Robin Gareus
616f7f40b6
Properly remove-time automation
Previously "remove time" was able to produce overlapping, not
ordered automation.
2018-12-22 01:09:24 +01:00
Robin Gareus
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
Robin Gareus
43c76ff23b Fix crash when testing invalid MIDI file.
smf_delete() does not handle NULL pointers. This fixes a crash when
checking if a MIDI source is valid.
2018-07-26 16:59:27 +02:00
Paul Davis
9da1253288 system common and system realtime messages are not valid in SMF files 2018-07-05 13:45:17 -04:00
Paul Davis
1a25672239 change all use of g_critical() in libsmf() to g_warning()
g_critical translates to a fatal error in ardour, which is not true for any of these
errors.
2018-07-05 13:45:17 -04:00
Paul Davis
870625973e remove debug output 2018-06-21 15:27:58 -04:00
Paul Davis
8a18929d57 remove Session::controllable_by_descriptor() and move code into GenericMIDI code (the only user).
This also removes enums introduced to describe well-known parameters for Mixbus. Lookup now involves string
parsing every time, but this is not likely to be a notable cost.
2018-06-21 13:05:58 -04:00
Robin Gareus
dd5f124c60 Fix crash when testing unsupported MIDI file
smf_delete() does not handle NULL, and segfaults instead.

This only crashes with optimized builds.
libsmf will call g_critical() earlier and in that case debug-builds
call UI::handle_fatal() and ask the user to "click to exit".
2018-04-08 02:09:35 +02:00
Robin Gareus
48c1a24284 Fix some clang warnings (argument with 'nonnull' attribute passed null) 2018-01-26 18:07:23 +01:00
Paul Davis
7db12f6b12 convert codebase to use Temporal for various time types 2017-09-24 12:03:54 -04:00
Paul Davis
9283bee867 new header file for audio-based time types 2017-09-24 12:03:13 -04:00
Paul Davis
5ef0135283 remove Evoral types.cpp since it is no longer required 2017-09-18 11:40:53 -04:00
Robin Gareus
d67056562b Fix write-pass re-start while in an active write-pass 2017-07-27 17:50:52 +02:00
Robin Gareus
a41198305e Update WritePass logic + AutomationList Undo
Fixes various issues when changing AutomationState while rolling.
2017-07-24 21:00:12 +02:00
Robin Gareus
2006701f73 Fix ctrl-list guard-points and concurrency issues
* lock list when editing (prevent concurrent modification of insert
  iterator
* don't add a guard-point if an event is already present between the
  target and guard-point-position
* remove existing automation-events (old guard points) when
  touching automation w/o change
* don't unset "new write pass" when not rolling
  (fixes issues when not rolling but locating with write-enabled)
2017-07-24 01:59:08 +02:00
Robin Gareus
deba170d6c Consistent ControlList freezing -- fixes #7419
AudioRegion::set_fade_in() freezes the original ControlList, then
assigns a new one and thaws that.
Frozen state needs to be retained during assignment.

Related: The overloaded assignment operator in AutomationList
performed duplicate signal emission and didn't freeze the list.
2017-07-07 02:35:00 +02:00
Robin Gareus
c4578db595 Compatibility with old out-of-range automation-lane data
Ardour may have ignored log-scale for parameters 0..N and allowed
writing '0'. Force those values into the valid range on session load.
Also mark the list as "needs sorting" which removes potential duplicates.
2017-07-04 20:12:51 +02:00
Robin Gareus
8dcc28c9ad Remove duplicates from ControlList 2017-06-21 18:12:31 +02:00
Robin Gareus
3d15499cda Clamp values in ControlList 2017-06-21 18:12:29 +02:00
Robin Gareus
d6c47def09 Implement additional ControlList interpolation methods.
The Control and ControlList uses the raw value (eg. coefficient for gain,
Hz for frequencies) and those Lists are stored in existing sessions.

In the vast majority of cases interpolating automation values using exp/log
scale for dB, freq makes more sense -- it's also what the fader does.

Adding additional interpolation methods is future proof (we might at allow
to even add different methods per automation point (to the next) like other
DAWs do.

Currently it's mainly used in preparation for consistent GUI automation-
lanes. Between 2 points there's always a visual straight line.
2017-06-21 18:12:26 +02:00
Robin Gareus
36e32e5641 Remove separate ControlList min/max/default, use ParameterDescriptor. 2017-06-21 18:12:23 +02:00
Robin Gareus
8b917c4c16 Add infrastructure to merge ControlLists 2017-06-14 02:40:09 +02:00
Robin Gareus
8e6f71b8c1 Apply master-value to automation on disconnect. 2017-06-13 20:57:37 +02:00
nick_m
d455806a73 Do not duplicate note id in copy constructor
This fixes selection undo after copy-dragging notes, but there
are probably other cases where duplicate note ids may cause problems.
2017-06-08 23:11:56 +10:00
Robin Gareus
c2cb60ea03 add const-ness: Evaluating a curve does not change it.
Note that the ControlList's lock and cache are already mutable.
2017-06-03 13:55:02 +02:00
Robin Gareus
0b5db91ee9 AutomationLine time-unit conversion and paste API update
This fixes copy/paste of MIDI automation (time-unit: beat) from/to
Parameter automation (time-unit: samples).

It also fixes repeatedly pasting with tempo-ramps: pre-multiply length
before converting to samples.
2017-04-26 23:37:27 +02:00
Robin Gareus
ce2c3a9c70 c89 compat (gcc4, mingw..) 2017-02-28 21:33:13 +01:00
Robin Gareus
29fcca147b Fix loading SMF meta-data > 127 bytes (no more g_critical abort) 2017-02-28 16:29:10 +01:00
Paul Davis
129708ad85 add clamp for adding points to a ControlList from a (G)UI 2017-01-09 12:42:08 +00:00
Nil Geisweiller
c1127c245b Fix minor typo in comment 2016-12-21 23:09:40 +01:00
Paul Davis
6a0ea65885 "toll free bridging" between smf_tempo_t and Evoral::SMF::Tempo 2016-12-16 13:45:43 +00:00
Paul Davis
c0aa738395 expose SMF tempo information in Evoral::SMF 2016-12-16 10:43:52 +00:00
Paul Davis
2378e7b60c add function to get number of tempos found in SMF tempo map 2016-12-16 10:43:41 +00:00
Paul Davis
fe0761d404 unused but slightly tricky code to add track name/instrument to an SMF file when saved 2016-12-16 09:36:52 +00:00
Paul Davis
d2fd01c241 add API to Evoral::SMF to retrieve all track/instrument names for use when importing 2016-12-14 11:46:26 +00:00
Paul Davis
7e0dbd06db extract track and instrument names from SMF while loading 2016-12-14 11:46:26 +00:00
Paul Davis
24160a3b85 add braces and warning for unlikely error 2016-12-14 11:46:26 +00:00
Paul Davis
ff6f8ca6c4 fix incorrect test for textual meta events in libsmf 2016-12-14 11:46:26 +00:00
Paul Davis
54ef5fadc2 braces please 2016-12-14 11:46:26 +00:00
Paul Davis
d5074be4f1 braces, please 2016-12-14 11:46:26 +00:00
Paul Davis
8002a0c66e free track name/instrument string memory when necessary 2016-12-14 11:46:26 +00:00
Paul Davis
28caef7d81 add track and instrument name members to smf_track_t 2016-12-14 11:46:26 +00:00
David Robillard
7d2ed46b63 Remove dead/annoying/unsafe code
Note the old Note::operator= was unsafe, since it made shallow copies of the on
and off events, which results in a double delete of events when the notes are
destructed.
2016-12-04 15:10:05 -05:00
David Robillard
d17f58e531 Remove dead code 2016-12-03 15:28:23 -05:00