summaryrefslogtreecommitdiff
path: root/libs/ardour/midi_port.cc
AgeCommit message (Collapse)Author
2018-09-18new transport slave/master implementation, libs/ editionPaul Davis
2018-05-04avoid compiler warning (timestamp is unsigned and is thus always >= 0Paul Davis
2017-10-29Remove unused per-port buffer offsetRobin Gareus
2017-10-29Move vari-speed into backend (resample ports)Robin Gareus
Previously Ardour used a /local/ per track vari-speed mechanism. Now that the disk-reader is a latency-compensated processor, the speed of each disk-reader would need to be maintained locally, offset by each disk-reader's output latency. Furthermore each disk-reader may produce a different number of samples, depending on its global alignment. This commit introduces port-data resampling directly at the engine-level: Up/down-sample all input ports at the beginning, and down/up-sample output port-data using the inverse ratio at the end of the session's process cycle. The session itself is unaware of the speed-change, and only needs to handle transport speeds {-1, 0, +1}. This also allows for aligned cue-monitoring and vari-speed recording, and also pitch-shifts synthesized MIDI along.
2017-09-30MIDI debugging.Robin Gareus
2017-09-30Fix MIDI port offsets.Robin Gareus
AudioPort::get_audio_buffer() can offset the buffer simply by offsetting a pointer. This allows to get an offset buffer for a given port. For MIDI there's no such concept. A method writing to a MIDI buffer which is backed by a Port can at best offset it by the global port-buffer offset (static Port::port_offset), but not by the individual target port's offset.
2017-09-18globally change all use of "frame" to refer to audio into "sample".Paul Davis
Generated by tools/f2s. Some hand-editing will be required in a few places to fix up comments related to timecode and video in order to keep the legible
2017-08-05Update backend API: read-only MIDI input buffersRobin Gareus
2017-08-03Ignore cycle-start/end for unregistered portsRobin Gareus
Should fix a race during Session::destroy(), Port::PortDrop which unregisters ports with the backend, but the actual port instance will still exist. The engine does no longer have a session-pointer and only calls CycleStart(); CycleEnd() to clear port-buffers. Trying to clear and already unregistered Port will crash.
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-10-13new scheme for managing port deletionPaul Davis
shared_ptr<Port> now uses a deleter functor which pushes Port* to a lock-free FIFO so that the Port is always deleted (and thus unregistered with the PortEngine/backend) in a safe context w.r.t. various callbacks in the host. Currently the auto_connect_thread in Session has been tasked with doing these deletions.
2016-09-30insufficient attempt to drop references to a shadow MIDI portPaul Davis
2016-09-27move shadow port stuff from AsyncMIDIPort to MidiPort, where it belongsPaul Davis
2016-09-13slight DEBUG_TRACE enhancement for MidiPort::flush_buffers() outputPaul Davis
2015-11-28fix typo in panic message, honor event-time.Robin Gareus
2015-11-28midi-panic needs to honor split-cycle buffer offset,Robin Gareus
otherwise panic message will be delivered out-of-order when seamlessly looping.
2015-10-05NOOP, remove trailing tabs/whitespace.Robin Gareus
2015-10-04globally remove all trailing whitespace from ardour code base.Paul Davis
Paul Davis was responsible for introducing almost all of this.
2015-06-12We were 2 more debug "bits" away from overflow, so recast PBD::DEBUG ↵Paul Davis
mechanism away from a 64bit integer and toward std::bitset. Clean up a few minor related PBD::DEBUG issues along the way
2015-02-19Normalize notes on all channels.David Robillard
Probably.
2015-02-19Fix record/import of note ons with velocity 0.David Robillard
Best to just do this as early as possible to avoid having to deal with this situation all over the code. Also fixes violation of LV2 MIDI specification, which requires no such events are delivered to plugins.
2015-02-10infrastructure to allow tracing of all MIDI portsPaul Davis
2014-11-30Trim the include tree.David Robillard
2014-11-23make debug message more usefulRobin Gareus
2014-11-20debug trace lost midi-messagesRobin Gareus
2014-10-23another round of compiler warning fixesRobin Gareus
2014-10-22error/debug output when dropping MIDI event due to timing now shows MIDI bytesPaul Davis
2014-10-02Text tweaks and typo fixesColin Fletcher
2013-12-31debug message: print uint8 channel as integer not charRobin Gareus
2013-12-30improve debug messageRobin Gareus
2013-10-21fix endless messages about MIDI events being dropped.Paul Davis
track-owned MIDI port buffers (at the Ardour level) get ::flush_buffers() called twice, once by Delivery::flush_buffers() which is called at the end of MidiTrack::rol() to push data out in graph order, and then finally as a last-chance effort in PortManager::cycle_end(). This should not cause a repeated attempt to write the same data, but it was. Fixed by marking the buffer empty once its data has been flushed into a backend port buffer.
2013-09-10basic functionality for hardware latency measurementPaul Davis
2013-08-13fixes to get MTC (and probably MIDI clock) slaving working againPaul Davis
incoming MIDI data has to be parsed EVERY process cycle, not just when Slave::speed_and_position() is called. The private MIDI::Parser owned by the MTC and MClck slaves was irrelevant, since the port has its own. See comments in midi_port.h on the strangled inheritance heirarchy.
2013-08-12assorted extra debug output for MTCPaul Davis
2013-08-08rationalize (a bit) engine start/stop/restart so that it is possible to ↵Paul Davis
start up, disconnect from JACK and then reconnect
2013-07-24part-way through getting the audioengine changes to compilePaul Davis
2013-03-27Squashed commit of the following:Paul Davis
commit fdbae82077db53add90df7448a06869dac89acc6 Author: Paul Davis <paul@linuxaudiosystems.com> Date: Wed Mar 27 21:45:28 2013 -0400 mammoth changes in basic signal flow, total redesign of MIDI channel filtering and more. commit 59343a8283698e02bc0f622313b29e98f449e4c8 Author: Paul Davis <paul@linuxaudiosystems.com> Date: Wed Mar 27 01:58:53 2013 -0400 initial working version after changes to MIDI channel filtering. may affect metering input too. testing not yet finished this commit merges many deep changes in ardour's internal architecture, combined with a total redesign of how MIDI channel filtering works. data in a track used to flow from JACK port buffers to diskstream's ringbuffers and was then copied from the ringbuffers into a BufferSet for use during Route::process_output_buffers(). The butler thread would handle the movement of data between the ringbuffers and disk. with this commit, data now flows from JACK port buffers into the BufferSet used for Route processing, and is copied from the BufferSet into the diskstream's ringbuffers (the butler thread continues to handle interactions with disk as usual). this change allowed a dramatic consolidation of code and simplification of most aspects of Track/Route::roll() and Track/Route::no_roll(). in particular, see Route::fill_buffers_with_input() which now concisely describes how we move data from JACK port buffers into the BufferSet for all Route types (including Tracks). this work was initially motivated by changing MIDI channel filtering so that we can process capture and playback independently. there is now a very clean pathway for this - see MidiTrack::roll() (NOTE: This needs implementing in the no-roll case too - a TODO item). the channel selector for MIDI tracks has been moved out of the track header and is now accessible via the context menu. more work is likely here, to make it (more) obvious to the user when filtering is going on.
2013-01-19slightly more informational debug messagePaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@13896 d708f5d6-7413-0410-9779-e7cbd77b26cf
2013-01-19Replace a bunch of potential crashes with graceful handling of the situation.David Robillard
We really need some kind of more sophisticated assert macro that can be switched to non-fatal logging mode for release builds. A log message, which is often all that would happen, is a lot better than a trainwrecked performance... git-svn-id: svn://localhost/ardour2/branches/3.0@13892 d708f5d6-7413-0410-9779-e7cbd77b26cf
2013-01-08tentative redesign of MIDI looping, will probably fix #5050 but needs more ↵Paul Davis
extensive testing; remove several unused parameter names git-svn-id: svn://localhost/ardour2/branches/3.0@13810 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-06-18make switching between input+disk monitoring work "right" for MIDI tracks; ↵Paul Davis
also fix a bug that led to messages about notes already being on at program start because of a double seek with no read in between git-svn-id: svn://localhost/ardour2/branches/3.0@12762 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-04-15A few tweaks to make Ardour build in GCC -std=c++0x mode.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@11983 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-04-11Remove unused parameter to Port::flush_buffers().Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@11906 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-18fix two major assert failures arising from the optional monitor section ↵Paul Davis
commit; separate numbering of aux sends, sends and listens to fix #3671 (still testing, but the assert failures are critical) git-svn-id: svn://localhost/ardour2/branches/3.0@11263 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-12-14send sustain=off and all-notes-off when a MIDI track is muted (may fix #4295)Paul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@11005 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-06-28basic infrastructure for enabling/disabling MIDI input to a given trackPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@9772 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-05-30(1) push a locate all the way through the processing heirarchy so that MIDI ↵Paul Davis
output ports can resolve any notes currently playing (2) remove MidiStateTracker from MidiPort and use a fixed set of MIDI messages (sustain-off and all-notes-off, per channel) to do note resolution (3) move note resolution caused by a LoopEvent psuedo-event to within the main MidiPort::flush_output() loop, so that we resolve (turn off) Notes that come before the loop point, rather than send them out after the note resolution messages git-svn-id: svn://localhost/ardour2/branches/3.0@9635 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-05-29clarify some confusion about how "raw" port buffer sizes are definedPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@9628 d708f5d6-7413-0410-9779-e7cbd77b26cf