summaryrefslogtreecommitdiff
path: root/libs/evoral/src/Sequence.cpp
AgeCommit message (Collapse)Author
2016-12-03Fix event type and parameter type confusionDavid Robillard
I'm not sure if this is really the best way to do event types (should it just be a completely static enum in evoral, or completely dynamic and provided by the type map, or a mix like currently?), but previously the event type was frequently set to either total garbage, or parameter types, which are a different thing. This fixes all those cases, and makes Evoral::EventType an enum so the compiler will warn about implicit conversions from int.
2016-12-03Remove Evoral::MIDIEventDavid Robillard
It is slightly questionable whether type specific methods like velocity() belong on Event at all, these may be better off as free functions. However the code currently uses them as methods in many places, and it seems like a step in the right direction, since, for example, we might some day have events that have a velocity but aren't stored as MIDI messages (e.g. if Ardour uses an internal musical model that is more expressive). In any case, the former inheritance and plethora of sloppy casts is definitely not the right thing.
2016-12-03Fix Sequence/Event const-correctness issuesDavid Robillard
2016-11-27Fix loading, recording & saving MIDI with PolyKeyPressure events.Robin Gareus
GUI still does not handle this (neither automation lane, nor List Editor), but the file loads, plays and exports correctly.
2016-10-23Don't add initial points for MIDI-CCRobin Gareus
eg. import a .mid that has a CC later in the file. Arodur wrongly added an initial point, effectively moving the event backwards to "0" (no virgin territory)
2016-08-19attempt to handle poly-pressure (polyphonic aftertouch) similarly to other ↵Paul Davis
MIDI messages
2016-07-14enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.hPaul Davis
2016-03-21Trim dependence on evoral types.hpp and Beats.hppDavid Robillard
2015-10-05NOOP, remove trailing tabs/whitespace.Robin Gareus
2015-09-18Midi CC events have no event-IDRobin Gareus
Prior to this change the last iterator's ID was used. (event's ID was not updated for CCs)
2015-09-18fix ever increasing MIDI event IDsRobin Gareus
Iterating over a const Midi-Sequence calls Evoral::Sequence::set_event(), which in turn used Evoral::Event::operator=() which always created a new event-ID (create copy of the event). Issues fixed: - Saving *unmodified* MIDI produced new event-IDs on every save; files changed with every save. - greetings to Deva. - all [GUI] operations that use IDs to refer to notes e.g. undo. invalid undo-history. Also clarify assignment operator name. Prefer explicit assign() over =.
2015-09-15another note-off fix.Robin Gareus
For nearly coincident note-on the sequence does not matter, but note-off must be sent before a new note-on in strict order (could be the same note).
2015-03-05Handle edits while playing precisely.David Robillard
This avoids stuck notes if active notes are edited, but without stopping all active notes in the region on any edit as before. This implementation injects note ons in places that aren't actually note starts. Depending on how percussive the instrument is, this may not be desired. In the future, an option for this would be an improvement, but there are other places where "start notes in the middle" is a reasonable option. I think that should be handled universally if we're to do it at all, so not considering it a part of this fix for now.
2015-02-19Don't allocate then discard notes on note off.David Robillard
Silly to make a junk Note just to pass to append_note_off_unlocked, which just uses the fields that are on the MIDIEvent anyway then throws it away. Also explicitly dispatch to append_note_off_unlocked in the caller for note ons with velocity 0 rather than make append_note_on_unlocked deal with it.
2015-02-19Remove unused ifdef gunk.David Robillard
2015-01-07MusicalTime => Beats.David Robillard
2014-12-30Fix MIDI CC record/playback crash.David Robillard
2014-12-29Blind fix for MIDI iteration bug.David Robillard
2014-12-05Revert "Create discrete lists for recorded MIDI controls."David Robillard
This broke saving/restoring interpolation style. This reverts commit 07a381a8f5572ae7550c60e5b1bd18c3dcdc7369.
2014-12-02Create discrete lists for recorded MIDI controls.David Robillard
2014-12-01Replace half-baked param metadata with descriptor.David Robillard
Among other things, this means that automation controls/lists have the actual min/max/normal/toggled of parameters, and not those inferred from the Parameter ID, which is not correct for things like plugin parameters. Pushing things down to the Evoral::ParmeterDescriptor may be useful in the future to have lists do smarter things based on parameter range, but currently I have just pushed down the above-mentioned currently used attributes.
2014-11-30Remove braindead Parameter inheritance abuse.David Robillard
2014-11-22Wrap MusicalTime in a class.David Robillard
This lets us get a more explicit handle on time conversions, and is the main step towards using actual beat:tick time and getting away from floating point precision problems.
2014-11-20Fix lost MIDI note offs and controllers.David Robillard
Fix initial read of discrete MIDI controllers. Fix spurious note offs when starting to play in the middle of a note. Faster search for initial event when cached iterator is invalid. So much for dropping the cached iterator. The iterator is responsible for handling note offs, so that doesn't work. This design means we have some stuck note issues at the source read level, but they should be taken care of by the state tracker anyway.
2014-11-14add abort() to non-reached codeRobin Gareus
This cleans up a lot of false-positives in static analysis and also helps compilers to optimize code paths in general. (tagging the fatal stingstream operator as ‘noreturn’ is far less trivial)
2014-11-13Fix crashes on various MIDI editing operations.David Robillard
Assertions assumed old strict ordering, no longer reflecting reality of fuzzy time comparison (introduced in 86f1b8).
2013-07-23'libs/evoral' - For each of the NNNN_lower_bound() functions (3 in total) ↵John Emmas
add a non-const iterator to supplement the existing const_iterator
2013-07-15Include evoral/Note.hpp before pbd/compose.hMichael R. Fisher
- This workaround prevents a clang compiler error about template visibility
2013-05-02reduce verbosity of DEBUG::Sequence tracesPaul Davis
2013-03-29major fixes for MIDI patch change and note undo/redo. Patch change handling ↵Paul Davis
was completely broken because of the use of absolute floating point comparisons for time comparison, and serialization/deserialization of patch change property changes was borked because of int/char conversions by stringstream. Note undo/redo would fail for note removal if a note had been moved and/or had its note number changed as the next operation after it was added, because time-based lookup would fail. Similar small changes made for sysex messages, which just needed the musical_time comparisons and nothing else
2012-10-12issue 0005121: added comment to source. Sorry, last commit was for issue ↵Hans Baier
0005121, not 0005120, copied from the wrong line :[ git-svn-id: svn://localhost/ardour2/branches/3.0@13252 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-10-12fix issue 0005120: dont treat percussive mode differently than sustained ↵Hans Baier
mode except in GUI. Leaving out all note offs crashes LinuxSampler and totally drowns my Yamaha PSR-S900 by stealing all its available voices. Code is #ifdef-ed out until a more thorough discussion would conclude the removal of percussive mode from the MIDI model, which IMHO makes sense. I don't see any virtue in leaving out note offs since it only creates problems. git-svn-id: svn://localhost/ardour2/branches/3.0@13251 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-10-11implement deleting of sysex eventsHans Baier
git-svn-id: svn://localhost/ardour2/branches/3.0@13238 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-07-16code motion to put Sequence::{add,append}_patch_changed_unlocked() next to ↵Paul Davis
each other as candidates for removal git-svn-id: svn://localhost/ardour2/branches/3.0@13045 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-12-22fix a build issue in Evoral that was preventing Sequencer<T>::dump() from ↵Paul Davis
being available, and expose operator<< for Sequence<T> git-svn-id: svn://localhost/ardour2/branches/3.0@11054 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-11-23Fix broken whitespace via merciless application of the emacs hammer.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@10782 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-11-22tweak debug outputPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@10780 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-10-19Remove dubious Evoral::Event methods that exposed non-const references to ↵David Robillard
members. git-svn-id: svn://localhost/ardour2/branches/3.0@10239 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-09-30fixes for 98% of all the warnings/errors reported by OS X gcc on tigerPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@10179 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-08-11finish the intention of the previous commit, correctly this timePaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@9979 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-08-11do not assert/abort out of data errors that may originate with external ↵Paul Davis
user-supplied data, and use PBD::error instead git-svn-id: svn://localhost/ardour2/branches/3.0@9978 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-07-26remove remnant of MIDI I/O debuggingPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@9937 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-07-20try to fix data loss at end of a capture pass for MIDI - add a new virtual ↵Paul Davis
method to MidiSource that specifies what should be done with stuck notes, remove duplicate(i hope) _last_flush_frame from SMFSource that mirrored, more or less, MidiSource::_last_write_end; use new virtual method when stopping after capture. git-svn-id: svn://localhost/ardour2/branches/3.0@9910 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-07-16Remove an assert() that I can't see the value of, and whichCarl Hetherington
trips when loading empty MIDI files (#4190). git-svn-id: svn://localhost/ardour2/branches/3.0@9883 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-07-14initial pass at session-renaming functionalityPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@9876 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-07-13more midi io debuggingPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@9868 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-06-21change default overlapping note strategy to "relax" (i.e. do nothing); fix ↵Paul Davis
crash when looping with MIDI data; add back note-off resolution at loop point (if it was actually there) so that notes are turned off (but don't forget Ye Olde Sustain Pedal/Controller) when looping; minor other non-functional tweaks git-svn-id: svn://localhost/ardour2/branches/3.0@9753 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-05-17Remove unnecessary duplicate take of Sequence's read_lock.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@9537 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-05-17Minor tidy-ups.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@9536 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-04-16Fix erroneous masking when loading bank changes (part of #3916).Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@9359 d708f5d6-7413-0410-9779-e7cbd77b26cf