Commit Graph

121 Commits

Author SHA1 Message Date
Robin Gareus 576840c09e
NO-OP: return early, remove scope 2023-10-17 05:40:31 +02:00
Robin Gareus c5b2c4432e
Fix tracing internally connected MIDI ports
MIDI track A -> MIDI track B
The data on Track B's input is not available at cycle-start.
2023-10-07 22:43:27 +02:00
Robin Gareus 7e567468b2
Fix crash when resetting MIDI tracer
The GUI was able to free memory (MidiTracer::disconnect),
while the tracer is concurrently still in use in rt-context.
This lead to memory corruption in MIDI::Parser::scanner.
2023-06-04 01:15:11 +02:00
Paul Davis b35518e212 switch from boost::{shared,weak}_ptr to std::{shared,weak}_ptr
This is mostly a simple lexical search+replace but the absence of operator< for
std::weak_ptr<T> leads to some complications, particularly with Evoral::Sequence
and ExportPortChannel.
2023-03-24 14:19:15 -06:00
Robin Gareus 77bb262c26
Add API to check for internal port connections 2023-03-07 20:49:37 +01:00
Paul Davis 730064277d a start at custom MIDI learn for trigger slots 2022-11-16 08:37:57 -07:00
Robin Gareus 3ca0f4e43d
Prepare API to resample session to engine when SR mismatches 2022-09-21 00:34:03 +02:00
Robin Gareus 719dda7701
Implement MIDI ExportChannel
Since MIDI Export is limited to Stem-Export, only a port-reader
and ExportProcessor have to be implemented.
2022-05-16 04:54:17 +02:00
luz paz 1e640563d6
Fix source comment typos in `libs/ardour`
Found via `codespell`
2022-05-11 00:14:28 +02:00
Todd Naugle 89eab2714f Fix double call error in midi tracer handling
Only basic midi ports use the _trace_parser and they enter
here via cycle_start which will pass the _trace_parser to
this function. No need to double up calls.
2021-06-23 17:54:58 -05:00
Robin Gareus 56b94b3fc4
Mark user-created events as live MIDI 2020-09-20 19:19:16 +02:00
Robin Gareus f9cdf533ba
Event API consistency; reorder arguments (time, type, payload) 2020-09-20 19:18:09 +02:00
Robin Gareus f0d5d1323a
Fix MIDI tracer time display for async and transport-master ports 2020-06-10 00:16:54 +02:00
Robin Gareus 29a6bfd3e7
Add support for fixed speed MIDI output ports
This is the output port equivalent for
::read_and_parse_entire_midi_buffer_with_no_speed_adjustment()
2020-05-31 23:45:18 +02:00
Paul Davis dfe383d23a make MIDI tracing work again for ports that are handled using ::read_and_parse_entire_midi_buffer_with_no_speed_adjustment() 2020-03-27 11:22:37 -06:00
Robin Gareus 37c9a7beb1
Fix MIDI port i/o when vari-speeding 2019-12-17 05:56:49 +01:00
Paul Davis febaa1ff2d fix unconditional note resolution during DiskReader::realtime_locate()
When looping, we do not want to resolve notes at the end of the loop via ::realtime_locate() -
::get_midi_playback() has already taken care of this. But when not looping, we need this. So,
add an argument to tell all interested parties whether the locate is for a loop end or not
2019-11-06 16:00:31 -07:00
Paul Davis 0bb34edec0 improve comment about warning message 2019-11-06 08:56:50 -07:00
Paul Davis 62c4e88a9d avoid use of Port::port_offset() everywhere except Port::flush_buffers() and Port::get_buffer()
Split cycles are run as if they are an entire self-contained cycle, starting at zero and running for "nframes".

We adjust the timing and position of data only when retrieving and writing it to Port buffers.
2019-11-04 12:57:19 -07:00
Robin Gareus 2fde6a5777
Correctly flush MIDI buffers on cycle-split 2019-11-03 15:19:37 +01:00
Robin Gareus 98224a264e
Clarify MIDI-port event-timestamp debug-message 2019-11-03 15:19:37 +01:00
Robin Gareus a22f918d9d
Update libardour GPL boilerplate and (C) from git log 2019-08-03 15:53:16 +02:00
Robin Gareus 84272b4e27
NO-OP: whitespace
Fix space-alignment, mostly due to "frame" -> "sample" changes.
2019-04-08 05:16:33 +02:00
Paul Davis e6915e01de new transport slave/master implementation, libs/ edition 2018-09-18 19:06:04 -04:00
Paul Davis 1f9963cd56 avoid compiler warning (timestamp is unsigned and is thus always >= 0 2018-05-04 08:25:04 -04:00
Robin Gareus db674ac8b6 Remove unused per-port buffer offset 2017-10-29 20:04:11 +01:00
Robin Gareus 927788a0b0 Move vari-speed into backend (resample ports)
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-10-29 20:04:00 +01:00
Robin Gareus 97c637e399 MIDI debugging. 2017-09-30 22:44:44 +02:00
Robin Gareus 5ada17eba0 Fix MIDI port offsets.
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-30 05:25:27 +02:00
Paul Davis 30b087ab3d globally change all use of "frame" to refer to audio into "sample".
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-09-18 12:39:17 -04:00
Robin Gareus 2b7c585dba Update backend API: read-only MIDI input buffers 2017-08-05 15:36:36 +02:00
Robin Gareus 1937c74191 Ignore cycle-start/end for unregistered ports
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.
2017-08-03 19:25:14 +02:00
David Robillard 08fffeffec Remove Evoral::MIDIEvent
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-03 15:18:21 -05:00
Paul Davis 8f9a9523d2 new scheme for managing port deletion
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-10-13 17:18:54 -04:00
Paul Davis 9480dc1c6a insufficient attempt to drop references to a shadow MIDI port 2016-09-30 11:23:01 -04:00
Paul Davis d1c024f4f9 move shadow port stuff from AsyncMIDIPort to MidiPort, where it belongs 2016-09-27 14:59:30 -05:00
Paul Davis 6e59ff4229 slight DEBUG_TRACE enhancement for MidiPort::flush_buffers() output 2016-09-13 14:11:29 -05:00
Robin Gareus 1fd04baeb3 fix typo in panic message, honor event-time. 2015-11-28 22:34:54 +01:00
Robin Gareus aa8d512ee7 midi-panic needs to honor split-cycle buffer offset,
otherwise panic message will be delivered out-of-order when
seamlessly looping.
2015-11-28 22:33:43 +01:00
Robin Gareus 22b07e0233 NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
Paul Davis 4dc63966f0 globally remove all trailing whitespace from ardour code base.
Paul Davis was responsible for introducing almost all of this.
2015-10-04 14:51:05 -04:00
Paul Davis cc543280d9 We were 2 more debug "bits" away from overflow, so recast PBD::DEBUG mechanism away from a 64bit integer and toward std::bitset.
Clean up a few minor related PBD::DEBUG issues along the way
2015-06-12 18:14:09 -04:00
David Robillard b68a4e5cdc Normalize notes on all channels.
Probably.
2015-02-19 20:23:11 -05:00
David Robillard 450291adfc Fix record/import of note ons with velocity 0.
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-19 18:38:30 -05:00
Paul Davis eddcd7128f infrastructure to allow tracing of all MIDI ports 2015-02-10 19:48:47 -05:00
David Robillard 2588b1cac9 Trim the include tree. 2014-11-30 23:56:19 -05:00
Robin Gareus 8ddeb712f6 make debug message more useful 2014-11-23 23:57:55 +01:00
Robin Gareus 0c4869dc35 debug trace lost midi-messages 2014-11-20 02:46:30 +01:00
Robin Gareus 730e09ce65 another round of compiler warning fixes 2014-10-23 05:31:40 +02:00
Paul Davis bd97450ef8 error/debug output when dropping MIDI event due to timing now shows MIDI bytes 2014-10-22 17:07:11 -04:00