summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/midi_region.h
AgeCommit message (Collapse)Author
2016-11-10Correct the #includes for 'ardour/midi_cursor.h' (see commit #ec12fccf08)John Emmas
There are a couple of header files where we use a reference to class ARDOUR::MidiCursor (rather than a pointer). To keep MSVC happy we need to #include its header file, rather than simply using a forward reference.
2016-11-11remove unused variable and debugging.nick_m
2016-11-08Support multiple readers for MIDI source/modelDavid Robillard
Fixes the multiple reader issue #6541 properly without resorting to a linear search kludge. All the read state has been pulled out into a MidiCursor which the caller is required to pass. The playlist keeps cursors for all the regions it is reading, any number of cursors are allowed at a time. MidiCursor should probably be made a smarter and more fool-proof object (and/or possibly merged with some of the other tracker/fixer stuff) but for now I wanted to keep it simple.
2016-10-25make MidiRegion::start/length_beats() const.nick_m
2016-10-10Interpret start & length_beats properties as double rather than Evoral::Beats.nick_m
- Evoral::Beats operator!= would prevent an increment of start_beats by intervals of less than a tick, so its possible that other subtle problems existed due to this kind of thing.
2016-09-29Remove bogus methods from MidiRegion.nick_m
2016-09-29Add headless-chicken session utility.nick_m
- provides an upgrade path for sessions affected by a nasty bug present in some 5.0 - 5.3 MIDI sessions. If testing from source, it can be run from the session_utils directory using ./run ardour5-headless-chicken -h
2016-09-23Remove _midi_regions_use_bbt_beats from Session, _start_pulse and ↵nick_m
_length_pulse from MidiRegion. - _start/length_beats are now quarter notes regardless of loaded session version. - also restores note colour update
2016-09-13change all MIDI read-from-source to map all events into the loop-range for ↵Paul Davis
seamless looping (if using)
2016-09-06Set start_pulse and length_pulse from state, neither need to be a PBD::Property.nick_m
2016-08-31Add start_pulse and length_pulse to midi region for beat/note separation.nick_m
2016-07-20Add a dedicated export method to MidiRegionJulien "_FrnchFrgg_" RIVAUD
To export a MIDI region to a file, the code used MidiRegion::clone() since it takes care of creating a new file-backed source with the wanted contents. Nevertheless, it had several side-effects: - it created and registered a new region which is confusing to users - it only exported notes that were in the region range, but didn't remove the region start offset from MIDI events, essentially producing a spurious silence at the beginning of the exported file (this is not a problem for region cloning because the newly created region is made aware of the offset and caters for it). Add a dedicated code path for export, that uses the new offsetting capabilities of MidiModel::write_section_to().
2016-07-10remove reference "const int32_t&" -> const int32_t"Robin Gareus
this simplifies lua-bindings and also let's the compiler worry about constant primitive types.
2016-07-10Remove frame conversion for MidiRegionView::note_in_region_range(), speed up ↵nick_m
tempo dilation
2016-07-10Exact beat - provide audio->music mapping for region split.nick_m
- for those not in the know, this series provides a way to remove the temporal distortion introduced when using an audio frame-based gui for music-locked objects. In short, the gui uses an audio frame representation to move objects. It displays the object using frame_at_beat(), quantizing the time value to audio frames. This is fine until the user selects that frame but expects it to be interpreted as a beat. Thus beat_at_frame() would not produce the user-expected beat (temporal quantization error of up to 0.5 audio samples). This is one method of mapping audio time to music time accurately.
2016-07-10Make some musical operations on music-locked regions operate in beats.nick_m
- use exact beats to determine frame position. - see comments in tempo.cc for more. - this hasn't been done for split yet, but dragging and trimming are supported.
2016-06-11Fix many offset errors when drawing notes in midi regions that have been edited.nick_m
- hopefully this can close bugs such as 6270 & 6793
2016-05-27Rwbi ramps - midi regions resize when tempo map changed.nick_m
2016-03-21Trim dependence on evoral types.hpp and Beats.hppDavid Robillard
2015-10-17Remove all the now unused functions in the MidiModel class.André Nusser
2015-03-29Fix mute of MIDI tracks with channel forcing.David Robillard
This moves MIDI channel filtering into a reusable class and moves filtering to the source, rather than modifying the buffer afterwards. This is necessary so that the playlist trackers reflect the emitted notes (and thus are able to stop them in situations like mute). As a perk, this is also faster because events are just dropped on read, rather than pushed into a buffer then later removed (which is very slow). Really hammering on mute or solo still seems to produce stuck notes occasionally (perhaps related to multiple-on warnings). I am not yet sure why, but occasional beats always.
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-01-07MusicalTime => Beats.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-04-14dramatic change in logic and naming for operations related to adding a MIDI ↵Paul Davis
region on demand and cloning/unlinking Existing code would cause data loss due to creation of two Source objects referring the same path, one with removable flags and one without. Careful code review suggested a variety of thinkos, function naming problems and other confusion that caused this. I have tried ot extensively comment what is going on with these operations, because it is one key area in which MIDI differs from audio: with audio, capture is the only way to add a new audio region, but for MIDI there are GUI input events that can add a new region.
2013-10-17get everything compiling with libardour built using -fvisibility=hiddenPaul Davis
2013-10-17add export visibility macros across libardourPaul Davis
2012-05-23alter API for MIDI cloning to facilitate exportPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@12401 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-04-15Update MidiRegion::_start_beats on trimming the front of a MIDI region; ↵Carl Hetherington
reset _start_beats with _start on MidiRegion::fix_negative_start(). May help with #4736. git-svn-id: svn://localhost/ardour2/branches/3.0@11984 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-04-14Fix a few framecnt / framepos type confusions.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@11975 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-12-17Remove unused code.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@11015 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-12-11Keep track of MIDI region's start positions in beats, toCarl Hetherington
match the source, so that starts are not corrupted when tempos change (#4494). git-svn-id: svn://localhost/ardour2/branches/3.0@10976 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-10-19Trim include tree.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@10244 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-10-13add new per-session MIDI-region-copy-is-fork: if set, all MIDI region copies ↵Paul Davis
will be independent from each other (via MIDIRegion::clone()); visible in Session properties editor under the Misc tab git-svn-id: svn://localhost/ardour2/branches/3.0@10207 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-06-01Fix broken whitespace. I'd apologize for the compile times if it was my ↵David Robillard
fault :D git-svn-id: svn://localhost/ardour2/branches/3.0@9654 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-04-06Differentiate between pitch-shift (for audio) and transpose (for MIDI). ↵Carl Hetherington
Fixes #3940. git-svn-id: svn://localhost/ardour2/branches/3.0@9299 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-12-21Remove confuzzling offset_relative stuff from region construction ↵David Robillard
(pre-properties "hangover"). This commit (in theory) only reorganizes code, not change actual functionality. RegionFactory now uses a distinct Region constructor for each case, which is a bit easier to wrap around. Note comment at region.cc:276, this case seems pretty weird to me (more hangover?). git-svn-id: svn://localhost/ardour2/branches/3.0@8320 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-12-21Only calculate length_beats from length (in frames) if length property (in ↵David Robillard
frames) is given, but length_beats property is not. git-svn-id: svn://localhost/ardour2/branches/3.0@8319 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-12-20Fix more broken whitespace.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@8314 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-12-20use notification of what was changed in MidiRegion::post_set() callPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@8307 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-12-14implement methods in TempoMap for walking a given distance along a tempo map ↵Paul Davis
and returning the resulting time; add a new property, _length_beats, to MidiRegion; use previously mentioned methods to keep _length_beats up to date as regions are moved AND as tempo map changes occur git-svn-id: svn://localhost/ardour2/branches/3.0@8274 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-12-09Allow trim of midi regions to before the start of the source (better, this ↵Carl Hetherington
time). Fixes #3156. git-svn-id: svn://localhost/ardour2/branches/3.0@8229 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-12-03Remove all use of nframes_t.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@8166 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-10-05Remove some unused code.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@7876 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-09-17megaopus commit: (1) add __STD_(LIMIT|FORMAT)_MACROS to command line flags ↵Paul Davis
for cc and c++ builds, remove them from source (2) add new Property::midi_data used by MidiRegion to signal that its (MIDI) contents have changed (3) massive switch from nframes_t to framepos_t/framecnt_t including removal of ARDOUR::max_frames (replaced by ARDOUR::max_frame{pos,cnt} (lots more to do but this set was driven by changes to the Diskstream API to use framepos_t git-svn-id: svn://localhost/ardour2/branches/3.0@7791 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-07-16Remove unused full parameter to Region::stateCarl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@7428 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-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