summaryrefslogtreecommitdiff
path: root/libs/evoral/evoral/Sequence.hpp
AgeCommit message (Collapse)Author
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-03-21Trim dependence on evoral types.hpp and Beats.hppDavid Robillard
2015-09-14note-off ordering - fixes #6340Robin Gareus
Evoral::Beats::operator>() rounds to (1.0 / PPQN), hardcoded 1/1920.0. If the time difference between two events is smaller than 1/PPQN, Beats::operator>() and Beats::operator<() produce ambiguous results. The same pair of values is both "less than" and "greater than" depending which operator is used. While it's fine for some cases to ignore the order of nearly concurent events, the std::priority_queue must be strictly ordered.
2015-03-07Add a missing 'typename' specifier to the declaration for ↵John Emmas
'Evoral::Sequence::set_notes()'
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.
2014-12-30Fix MIDI CC record/playback crash.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-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-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).
2014-01-12'libs/evoral' - DLL visibility stuff and associated changes needed for ↵John Emmas
building with MSVC. Currently includes debugging information and things that are just commented out until we have known compatibility with the other platforms (i.e. contains stuff to be removed at a later date)
2013-10-18Merge remote-tracking branch 'remotes/origin/exportvis' into windows+ccJohn Emmas
Conflicts (hopefully resolved): gtk2_ardour/wscript libs/ardour/ardour/audioregion.h libs/ardour/ardour/debug.h libs/ardour/ardour/directory_names.h libs/ardour/ardour/filesystem_paths.h libs/ardour/ardour/session_event.h libs/gtkmm2ext/gtkmm2ext/utils.h libs/panners/1in2out/wscript libs/panners/2in2out/wscript libs/panners/vbap/wscript libs/pbd/pbd/debug.h libs/pbd/pbd/file_utils.h libs/pbd/pbd/pathexpand.h libs/pbd/pbd/ringbuffer.h libs/pbd/pbd/ringbufferNPT.h libs/pbd/pbd/search_path.h libs/pbd/pbd/stacktrace.h libs/pbd/pbd/uuid.h libs/pbd/pbd/uuid_boost.h libs/surfaces/control_protocol/control_protocol/basic_ui.h libs/surfaces/control_protocol/control_protocol/control_protocol.h
2013-10-17add export control to libevoralPaul Davis
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-04-03fix reversed semantics from 86f1b for LaterNoteEndComparator()Paul 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-11implement deleting of sysex eventsHans Baier
git-svn-id: svn://localhost/ardour2/branches/3.0@13238 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-07-25convert from Glib:: to Glib::Threads for all thread-related APIPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@13084 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-09-27Add missed parent class call to Sequence::control_list_marked_dirty. Fixes ↵Carl Hetherington
#4335. git-svn-id: svn://localhost/ardour2/branches/3.0@10140 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-09-19Emit ContentsChanged on the model when one of its control lists changes. ↵Carl Hetherington
Should fix #3880. git-svn-id: svn://localhost/ardour2/branches/3.0@10095 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-14initial pass at session-renaming functionalityPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@9876 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-04-06Fix my name :)David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@9302 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-12-28Unify program change and bank handling so that they are manipulated together.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@8346 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-12-24Fix broken whitespace.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@8341 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-12-07Revert previous ill-thought-out patch.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@8213 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-12-07Allow trim of midi regions to before the start of the source. Fixes #3156.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@8212 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-09-02fix a variety of unused argument errors noted by gcc 4.3.2 on x86Paul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@7733 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-07-20add note IDs and use them for looking up notes during a history rebuild. ↵Paul Davis
NOTE: INVALIDATES OLDER HISTORY FILES git-svn-id: svn://localhost/ardour2/branches/3.0@7449 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-07-14A few fixes to interpolation of MIDI controller data. Don't interpolateCarl Hetherington
when writing these data back to a source, otherwise surprising new interpolated points appear in MIDI automation. Similarly don't interpolate when reading the model during MIDI stretch. Fix handling of interpolation state; controllers that have been set by the user to use a different interpolation style are noted in the <Source> tag of the session file and this state is sprayed around to MidiModel and the GUI as necessary. git-svn-id: svn://localhost/ardour2/branches/3.0@7409 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-07-12Mark Sequence as edited when one of its parent ControlSet's ControlLists is ↵Carl Hetherington
changed. git-svn-id: svn://localhost/ardour2/branches/3.0@7404 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-06-25Make MIDI region `automation' respect the automation mode so that it isCarl Hetherington
only played back if the automation mode is set to "Play". Munge AutoState for AutomationRegionViews so that they reflect their AutomationTimeAxisView's setting. Fixes #3135. git-svn-id: svn://localhost/ardour2/branches/3.0@7304 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-06-14make note overlap resolution store side effects in a DiffCommand, and add ↵Paul Davis
its changes to the DiffCommand being executed, so as to retain "internal" note property changes across undo git-svn-id: svn://localhost/ardour2/branches/3.0@7256 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-06-12introduce the notion that note additions and property changes can cause the ↵Paul Davis
removal of other notes because of overlaps; merge Diff and Delta commands in MidiModel; fix marshalling of notes to avoid float->int conversion of length+time properties; initial implementation (not tested much so far) of different policies for how to handle note overlaps git-svn-id: svn://localhost/ardour2/branches/3.0@7254 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-06-03start tracking note overlaps while moving notesPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@7228 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-06-03Sequence::contains() and Sequence::overlaps() now use pitch-based indexing ↵Paul Davis
to speed things up in pathological cases git-svn-id: svn://localhost/ardour2/branches/3.0@7221 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-06-02add channel+pitch indexing for notes in a SequencePaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@7217 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-06-01rationale pathways that add notes to Sequence<T> so that there is only final ↵Paul Davis
insertion step; when changing note properties that affect "indexing" within a Sequence<T> (i.e. via set<T,comparator> indexing/ordering/hashing), remove the note and add it back so that indexing stays consistent; fix marshalling of MidiModel::DiffCommand (boost::bind(&Object::method, reference_to_object) will COPY the reference, so use a pointer); fix MidiModel::find_note() to compare note properties not pointer addresses git-svn-id: svn://localhost/ardour2/branches/3.0@7203 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-05-31switch Evoral::Sequence debugging to use DEBUG_TRACE(); Sequence uses ↵Paul Davis
multiset<...,EarlierNoteComparator> for _write_notes, does FIFO note resolution for overlapping notes in SMF file; implement Sequence::overlaps() ... current use is uncertain; ARDOUR::coverage() uses 64bit framepos_t git-svn-id: svn://localhost/ardour2/branches/3.0@7199 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-05-28provide a generalized Sequence::get_notes()-by-predicate method, and ↵Paul Davis
prototypes for 2 future methods git-svn-id: svn://localhost/ardour2/branches/3.0@7191 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-05-20various minor MIDI fixes: prevent duplicate note entry with mouse, show note ↵Paul Davis
info more often with verbose cursor, fix some crashes from click+move on notes ... lots more where this comes from git-svn-id: svn://localhost/ardour2/branches/3.0@7128 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-05-19MIDI region forking, plus Playlist::regions_to_read() fix forward ported ↵Paul Davis
from 2.X. region forking requires a few cleanups git-svn-id: svn://localhost/ardour2/branches/3.0@7118 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-22Fix adding multiple notes with the same time stamp (geeze).David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@5872 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-22Replace horribly error-prone Sequence/MidiModel/MidiSource locking API with ↵David Robillard
scoped locks that automatically Do The Right Thing. Make Sequence::read_lock const correct in the process (a read lock can be taken out on a const Sequence, but not a write lock). git-svn-id: svn://localhost/ardour2/branches/3.0@5857 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-21Fix O(n) search on MIDI rec region update (now O(log(n)) per update, but ↵David Robillard
could be O(1) with caching...) git-svn-id: svn://localhost/ardour2/branches/3.0@5843 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-19Use set over vector for Sequence::Notes, for logarithmic search by time.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@5798 d708f5d6-7413-0410-9779-e7cbd77b26cf