summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/midi_source.h
AgeCommit message (Collapse)Author
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-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-24add and use Source::empty() since it can be done more efficiently than ↵Paul Davis
length(pos) == 0 git-svn-id: svn://localhost/ardour2/branches/3.0@7300 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-12-19use new syntax for connecting to backend signals that enforces explicit ↵Paul Davis
connection scope, plus a few other related matters git-svn-id: svn://localhost/ardour2/branches/3.0@6376 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-12-17switch to using boost::signals2 instead of sigc++, at least for libardour. ↵Paul Davis
not finished yet, but compiles, loads sessions, records and can close a session without a crash git-svn-id: svn://localhost/ardour2/branches/3.0@6372 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-25Remove unused source file_changed methods.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@5917 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-24Fix tab width assumption used for alignment.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@5908 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-24(FULL commit) start of a nominal debug tracing system, with 64 bits ↵Paul Davis
available for flags; track notes by region in MidiPlaylist, and resolve them if they are left hanging at region boundaries. note: MIDI playback is still not working 100% though its better now. git-svn-id: svn://localhost/ardour2/branches/3.0@5903 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-22Fix MidiBuffer::merge_in_place and add aggressive correctness checking.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@5854 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-19track notes at the region level in MidiPlaylist; resolve them (deliver note ↵Paul Davis
offs) if a note spans the end of the region git-svn-id: svn://localhost/ardour2/branches/3.0@5804 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-15rework Stateful::set_state() patch to avoid default version argumentPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@5787 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-15Part 1 of loading 2.X sessions; some things work, some things don't, hacks ↵Carl Hetherington
a-plenty. LOADING 2.X SESSIONS WITH THIS COMMIT IN PLACE WILL (PROBABLY) CORRUPT THE .ardour FILE, MAKING THE SESSION UNLOADABLE ON 2.X AND LOSING INFORMATION. So don't do that unless you make a backup of the session file first. git-svn-id: svn://localhost/ardour2/branches/3.0@5786 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-14Strip trailing whitespace and fix other whitespace errors (e.g. space/tab ↵David Robillard
mixing). Whitespace changes only. Vimmers, try let c_space_errors = 1 in your .vimrc to highlight this kind of stuff in red. I don't know the emacs equivalent... git-svn-id: svn://localhost/ardour2/branches/3.0@5773 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-08-27lots of MIDI editing stuff. to be explained on the website when its donePaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@5596 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-04-30Rename 'position' parameter of MidiSource::midi_read to clearer 'source_start'.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@5021 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-25*** NEW CODING POLICY ***David Robillard
All #include statements that include a header that is a part of a library bundled with ardour MUST use quotes, not angle brackets. Do this: #include "ardour/types.h" NOT this: #include <ardour/types.h> Rationale: This is best practice in general, to ensure we include the local version and not the system version. That quotes mean "local" (in some sense) and angle brackets mean "system" (in some sense) is a ubiquitous convention and IIRC right in the C spec somewhere. More pragmatically, this is required by (my) waf (stuff) for dependencies to work correctly. That is: !!! FAILURE TO DO THIS CAN RESULT IN BROKEN BUILDS !!! Failure to comply is punishable by death by torture. :) P.S. It's not that dramatic in all cases, but this (in combination with some GCC flags specific to the include type) is the best way I have found to be absolutely 100% positive the local ones are being used (and we definitely want to be absolutely 100% positive on that one). git-svn-id: svn://localhost/ardour2/branches/3.0@4655 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-20Make source length a dynamic thing.David Robillard
Update MIDI region length (actually and visually) when position changes. git-svn-id: svn://localhost/ardour2/branches/3.0@4644 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-19Introduce new time for session-relative frame time, and make source ↵David Robillard
interface capable of handling 64-bit long sessions. sframes_t is "session frames". The rules for time stamps are: - Anything relative to transport time, session position, etc, should be sframes_t - Anything relative to jack cycles, including the length thereof, should be nframes_t To support sessions which exceed UINT32_MAX frames, we need to replace all the uses of nframes_t for session time with sframes_t, and make sure the conversions are sound. This does not depend on jack's nframes_t; that we are using the same type at all right now was an oops. This is also be kinda nice for readability since the two different time bases have different types... git-svn-id: svn://localhost/ardour2/branches/3.0@4636 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-19Interpret tempo time based on read position (not source timeline position ↵David Robillard
which is more or less meaningless). Move time conversion into the region view rather than the source. Adapt MIDI (including controllers) regions to the destination tempo when moved (e.g. dragging a region to a location with half the tempo will make the notes twice as long). git-svn-id: svn://localhost/ardour2/branches/3.0@4635 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-19Readable is not as generic as its name implies ;)David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@4634 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-17Fix deadlock and potential race condition when editing MIDI.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@4614 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-17Fix the horrible mess that was anything related to sources and paths.David Robillard
Most significant changes: - Factor out FileSource from AudioFileSource, use for SMFSource too - Explicitly pass embedded rather than mysterious name mangling or whatever - Destroy a ton of duplicated or very-nearly-duplicated code - Clean up and document all that weird source stuff in session.cc git-svn-id: svn://localhost/ardour2/branches/3.0@4609 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-16Move duplicated AudioFileSource::Flags and SMFSource::Flags into Source.David Robillard
Clean up source stuff. git-svn-id: svn://localhost/ardour2/branches/3.0@4605 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-16Time unit translation for AutomationLine (correctly display MIDI controller ↵David Robillard
data). git-svn-id: svn://localhost/ardour2/branches/3.0@4597 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-16Move all beats <-> frames time conversion into a single object that can be ↵David Robillard
passed around. This has 3 main benefits: - All conversion code is in one place (less duplication, potential bugs) - The conversion method can be passed to things that are ignorant of the actual time units involved, information required, etc. (In the future it would be nice to have user selectable tempo/frame time) - It should be relatively simple now to support tempo changes part-way through a MIDI region (at least architecturally speaking) git-svn-id: svn://localhost/ardour2/branches/3.0@4594 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-16Gracefully ignore illegal MIDI events at the buffer level (i.e. from Jack).David Robillard
Ardour should now be able to more or less tolerate crazy incoming MIDI (except for SYSEX). git-svn-id: svn://localhost/ardour2/branches/3.0@4592 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-15Fix genererally retarded and broken note range / diskstream display / etc. ↵David Robillard
related things (correctly display region contents on initial session load). git-svn-id: svn://localhost/ardour2/branches/3.0@4583 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-15The Big Change: Store time in MidiModel as tempo time, not frame time.David Robillard
The time stamp of an event is now always tempo, from file to model and back again. Frame time is only relevant at playback or recording time, in the audio thread (MidiModel and MidiBuffer). I think perhaps we don't need to change the actual time from double (which is convenient for math), it is the time base conversion that caused problems. Using a correct equality comparison (i.e. not == which is not correct for floating point) should probably make the undo issues go away, in 99.99% of cases anyway. There's almost certainly some regressions in here somewhere, but they do not seem to be time related. The bugs I'm hitting in testing are old ones that seem unrelated now, so it's checkpoint time. This sets us up for fancy things like tempo map import and tempo/meter changes halfway through MIDI regions, but for now it's still assumed that the tempo at the start of the region is valid for the duration of the entire region. git-svn-id: svn://localhost/ardour2/branches/3.0@4582 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-15Use nframes_t for timestamps of real (jack) time MIDI events (i.e. in ↵David Robillard
MidiBuffer and MidiRingBuffer). Use iterator interface of Sequence to read events in a MIDISource rather than Sequence::read, avoiding timestamp confusion. Disable no longer useful Sequence::read. git-svn-id: svn://localhost/ardour2/branches/3.0@4570 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-02Make (MIDI) event time stamp type a template parameter.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@4473 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-09-30Separate low level details of SMF reading/writing from concept of 'midi ↵David Robillard
source in ardour'. git-svn-id: svn://localhost/ardour2/branches/3.0@3839 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-09-19Factor out sequencing related things into an independant new library: "evoral".David Robillard
Anything related to the storage of events/values over a range of time lives in evoral. This includes MidiModel (Evoral::Sequence) and automation data (AutomationList (Evoral::ControlList), Automatable (Evoral::ControlSet), etc). libs/evoral synced with http://svn.drobilla.net/lad/trunk/evoral r1511. git-svn-id: svn://localhost/ardour2/branches/3.0@3754 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-06-02rollback to 3428, before the mysterious removal of libs/* at 3431/3432Paul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@3435 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-06-02remove empty sigc++2 directoryDoug McLain
git-svn-id: svn://localhost/ardour2/branches/3.0@3432 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-04-08* fixed bug: MIDI region did not sound if its position was less than its ↵Hans Baier
start offset git-svn-id: svn://localhost/ardour2/branches/3.0@3239 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-03-18refactor JACK MIDI port to allow writing from a non-process() thread, and ↵Paul Davis
move ARDOUR::MidiEvent into MIDI namespace along with midi_events.h header git-svn-id: svn://localhost/ardour2/branches/3.0@3155 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-02-21Fix timing on MIDI import.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@3093 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-02-02Merge with trunk R2978.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@2988 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-01-14Partially fix MIDI region trim and extend.David Robillard
git-svn-id: svn://localhost/ardour2/trunk@2911 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-07Fix several MIDI timestamp related problems:David Robillard
Fix recording MIDI regions that start at t != 0. Fix display of MIDI events in regions that start at t != 0. Fix recording after relocating an already rec-armed MIDI track. git-svn-id: svn://localhost/ardour2/trunk@2528 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-08-16Make SMFSource suck significantly less.David Robillard
Read from MidiRingbuffer directly into model, don't read MidiRingBuffer into a new midi buffer, then into the model. Pass rec data to UI via model instead of a separate buffer. Read MIDI CC data into MidiModel (though not actually used yet). Made quantization toggle edited flag so model is saved. git-svn-id: svn://localhost/ardour2/trunk@2308 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-08-11Saving of edited MIDI data to disk (on session save).David Robillard
Seems to be a pretty random problem with note duration restoring though... git-svn-id: svn://localhost/ardour2/trunk@2290 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-08-11Fix MIDI file names on recording (don't write out a ton of useless empty ↵David Robillard
.mid files). Preliminary hooks for writing model to file (still does nothing). git-svn-id: svn://localhost/ardour2/trunk@2289 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-08-01Fix note delete crash bug.David Robillard
Fix midi recording crash bug. git-svn-id: svn://localhost/ardour2/trunk@2216 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-07-31Get MidiRegionView's hands on MidiModel for editing operations to come.David Robillard
MIDI select rectangle. Add notes on a proper click only (not mouse down). Fix crash when dragging from region to outside region. git-svn-id: svn://localhost/ardour2/trunk@2196 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-07-28Use 'show contents' note range by default (fix uninitialized value).David Robillard
Obey note mode on playback (note offs are not sent in Percussive mode). Vary note colour/opacity with velocity (needs theization/tweaking, but hey, it's something). git-svn-id: svn://localhost/ardour2/trunk@2184 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-07-28Playback from MIDI model, playback of clicked-in events.David Robillard
Note the diskstream chunk size affects reading of clicked-in, so you may need to seek away and back again to have new events read (this will be fixed). git-svn-id: svn://localhost/ardour2/trunk@2183 d708f5d6-7413-0410-9779-e7cbd77b26cf