Commit Graph

177 Commits

Author SHA1 Message Date
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
Mads Kiilerich 004b32b91e
Update tracker/reference URLs to prefer HTTPs 2022-10-24 04:59:20 +02:00
Paul Davis edd7800009 remove unused variable 2022-09-09 16:32:42 -06:00
Paul Davis ed2a436f15 remove debug output from MidiSource:midi_read() 2022-09-09 16:32:42 -06:00
Robin Gareus 5f5f4599f2
Fix MIDISource event-interpolation state save
The actual goal here is to use direct InterpolationStyle serialization
in MidiSource (identical to AutomationList). enum_2_string()
does not work for Evoral types.

As side-effect virtual base-classes have been changed to pass
Parameters as const references
2022-07-22 03:38:41 +02:00
Robin Gareus 1b6e9fdaf8
Correctly save MidiSource Automation state 2022-07-22 03:38:37 +02:00
Paul Davis 7bf89ce109 Constification: make Stateful::get_state() const, with all other required const-ness added (libs) 2022-04-06 21:56:59 -06:00
Paul Davis bc38f8d424 MidiSource: change thread mutual exclusion object from Mutex to a RWLock
This allows two reader threads to proceed without blocking each other, as can
happen when the butler renders a MIDI track into an RT-safe buffer while the
GUI reads the same MidiModel/Source for visual display.
2022-04-05 20:52:09 -06:00
Paul Davis 3454353aa3 remove concept of "note-mode" from Evoral::Sequence (and thus ARDOUR::MidiModel)
This note-mode had no effect on anything at all, at least as far back
as 5.12. There is a note-mode in the GUI which affects the duration of notes
added using the GUI, and that remains in place. It is not clear
if the _percussive member of Evoral::Sequence ever had any effect on
the actual MIDI event stream the Sequence could generate.
2022-04-05 20:52:09 -06:00
Paul Davis 1ab49bcc32 change MidiStateTracker to MidiNoteTracker
The old name will become a bigger class/object that tracks all MIDI state,
not just notes
2022-02-01 18:06:40 -07:00
Paul Davis 17832e9f86 remove another instance of std::numeric_limits<timecnt_t>::max() 2021-12-05 09:24:13 -07:00
Paul Davis 56cde042cd Region::_start should be a timepos_t not a timecnt_t
It is an offset from an *implicit* origin (the source zero), not from an explicit origin,
and this fits with the concept underlying timepos_t. A timecnt_t requires an explicit origin,
which makes no sense in this context (just as it doesn't for the timeline as a whole).
2021-08-13 12:51:34 -06:00
Paul Davis 12855c1a83 fix types for MIDI source API, and remove unusued loop length member 2021-08-13 12:51:33 -06:00
Paul Davis 9ca376c232 libardour: fix another NUTEMPO warning by replacing a BeatSamplesConverter with timecnt_t 2021-08-13 12:51:31 -06:00
Paul Davis eae9d276fe libardour: conversion to use timeline types (mega-commit) 2021-08-13 12:51:29 -06:00
Paul Davis 4dc048b28a update Temporal::Beats to merge master/nutempo versions, notably with private from-double constructor
This is the libraries-only edition. It still features liberal use of Beats::from_double() but this is now
explicit and will be easier to locate the calls and remove them. Several classes that were using
Beats::to_double() have been (temporarily) made friends of Beats to allow them to keep using it,
pending the much more widespread redesigns of several structures. Once this is done, the friend
relationships can (mostly) be removed. It is expected the ARDOUR::Variant will need to continue
as a friend because it is used to pass beat counts to LV2 as doubles
2021-08-13 12:51:28 -06:00
Robin Gareus 4bb3a896b4
Potential fix for lost/empty MIDI files when using snapshots #8552
* Copy flags of referenced file
* Do not share model with copied source!
2021-03-19 20:05:42 +01:00
David Robillard 184bf7fd25 Remove unused variable 2019-12-09 22:56:14 +01:00
Paul Davis a855119bdd rename all Evoral source from .(hpp|cpp)$ to .(h|cc) 2019-11-02 16:32:18 -06:00
Paul Davis 22da779322 introduce new all-in-RAM MIDI datastructure and use it for MIDI playback 2019-11-02 16:32:18 -06:00
Robin Gareus a22f918d9d
Update libardour GPL boilerplate and (C) from git log 2019-08-03 15:53:16 +02:00
Ben Loftis edde5d64a2 (Source List) Clean up the natural_position implementation (libardour part). 2019-08-01 12:11:31 -05:00
Robin Gareus 889bd35f4f
NO-OP: whitespace 2019-04-08 03:45:12 +02:00
Paul Davis 2afc311f09 catch (incorrect) inclusion of non-MIDI related automation parameters in MidiSource XML nodes 2018-02-23 14:57:04 -05:00
Paul Davis b9c6ffac21 fix header order and space alignment 2017-09-24 12:57:27 -04:00
Paul Davis 7db12f6b12 convert codebase to use Temporal for various time types 2017-09-24 12:03:54 -04: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
Paul Davis 6f553ce988 changes required to operate with the Evoral::Beats ticktime commit 2017-09-18 11:40:53 -04:00
Tim Mayberry 46bd1e7758 Use XMLNode::get/set_property API in ARDOUR::MidiSource class 2017-04-19 09:36:52 +10:00
Paul Davis c7168b387b when destroying a MidiSource, invalidate any existing MidiCursors
(such as those held in a MidiPlaylist's RegionTrackers
2017-02-28 17:27:51 +01:00
David Robillard 0f5a73a7fd Fix Sequence/Event const-correctness issues 2016-12-03 15:18:20 -05:00
nick_m dca96d8b5d rename Region pulse to pos_beats. use new beat distance api where required.
- add more debugging output detecting regions whose
	  beat and frame position do not align on a playlist.
	  this is required as a check as we have never used
	  frame rounding on constant tempi before 8884a5723dc
2016-11-11 03:37:08 +11:00
David Robillard c61373212a Support multiple readers for MIDI source/model
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-11-08 20:34:45 -05:00
David Robillard 72297c0ca3 Remove dead code 2016-11-08 13:52:44 -05:00
nick_m ce3ae4cdc9 remove unnecessary rounding from MidiSource::midi_read()
- we already have start_beats, so don't try to recalculate
	  something similar for the position comparison.
2016-10-25 04:14:14 +11:00
David Robillard 94f8b7b8f2 Clean up MIDI debugging output 2016-10-17 20:22:26 -04:00
nick_m dcae6c42b6 Remove _length_pulse from MidiSource. 2016-09-29 01:27:42 +10:00
nick_m 080e7755a6 Remove _midi_regions_use_bbt_beats from Session, _start_pulse and _length_pulse from MidiRegion.
- _start/length_beats are now quarter notes regardless
	  of loaded session version.

	- also restores note colour update
2016-09-23 03:39:05 +10:00
Paul Davis f41bc70ee9 change all MIDI read-from-source to map all events into the loop-range for seamless looping (if using) 2016-09-13 14:11:29 -05:00
nick_m 21054f6d8d Add length_pulse to MidiSource, usr quarter-notes in midi_read().
- MidiSource _length_beats is in quarter notes.
	  Here we duplicate length_beats for backwards compatibility
2016-08-31 23:12:11 +10:00
Julien "_FrnchFrgg_" RIVAUD f371ac1beb Add a dedicated export method to MidiRegion
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-20 02:01:40 +02:00
Paul Davis cf52d6e4b4 enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h 2016-07-14 14:45:23 -04:00
nick_m f1802667ba Experimental patch to ensure playback buffer bounds use minimal beat->frame rounding. 2016-07-10 02:18:37 +10:00
Paul Davis 17ace643e4 OMNIBUS COMMIT: prefer const XMLNode::property method (and provide a real one) 2016-05-04 23:09:45 -04:00
Robin Gareus e2902a0b76 clarify midi-iterator comment 2015-08-27 14:43:28 +02:00
Robin Gareus 1387e756de fix linked midi-regions on different tracks #6541
A somewhat hacky solution to address missing note-off events when a
linked midi-region is used on separate tracks at the same time.
see the source-code comment for further info.
2015-08-25 03:48:54 +02:00
David Robillard c9023ae73d Fix mute of MIDI tracks with channel forcing.
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-29 00:51:56 -04:00
David Robillard a8aae56d92 Handle edits while playing precisely.
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-03-05 17:30:31 -05:00
David Robillard 2a251b4570 MusicalTime => Beats. 2015-01-07 00:12:07 -05:00
David Robillard 97d344f740 Fix MIDI CC record/playback crash. 2014-12-30 14:45:11 -05:00