Commit Graph

107 Commits

Author SHA1 Message Date
Paul Davis 50232a23a7 temporal: hide superclock_t variant of TempoMap::metric_at()
This fixes several callsites that were passing samplepos_t to get a TempoMetric,
some of them somewhat significant (e.g. VST plugins that want tempo information).

Bad API design on my part, apologies.

This commit combines libs/ and gtk2_ardour because the new private status
of the ::metric_at() call would be a blocking point for git bisect
2023-06-12 12:36:16 -06: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
Paul Davis 94570e0e1e midi clock: no changing tempo when we're not using an external sync source 2023-02-23 15:34:27 -07:00
Paul Davis e430d13d53 midi clock: allow user to "quantize" MIDI clock resolution 2023-02-23 10:17:47 -07:00
Robin Gareus 866876c903
Update MClk DLL, fix calculating coefficient
For whatever reason, previously the DLL bandwidth was set
to (10 Pi bpm^-2).
2023-02-23 17:26:30 +01:00
Robin Gareus 52cfa9ff19
Another step towards fixing MIDI Clock sync
* Fix reset on timeout: Reset needs to be called before
  processing any messages.
* use DLL to compute BPM (remove 1st order LPF)
* set BPM before calculating ppqn
* Fix speed at 1.0, change BPM only. MIDI clock must
  vari-speed (which changes pitch). MIDI clock is acts as
  "Conductor" that specifies when a beat happens at a given
  wall-clock time. timecode moves at speed 1.0 only the BPM
  changes.
2023-02-22 18:41:11 +01:00
Paul Davis 93b68fea89 mclck: compute "predicted_clock_interval_in_samples" correctly 2023-02-20 21:40:02 -07:00
Paul Davis 6721fe4697 mclk: fix debug output arguments 2023-02-20 17:35:24 -07:00
Robin Gareus 78c89fcbae
Fix MIDI Clock transport master (#8750)
MIDI Start and Position messages need to leave
the clock timestamp alone. They are not relevant
to compute BPM.
2023-02-19 22:49:23 +01:00
Robin Gareus cf0b119b45
Towards fixing MClk transport master (#8750)
* Honor MCLk stop messages, do not auto-start as soon as
  the tempo is locked (after 3 clock ticks).
* Retain MIDI beat position, do not rewind in ::update_midi_clock
  Do not directly start when receiving the position message,
  transport speed should be zero (regardless of clock speed),
  until the "continue" message arrives.
* Mclk start needs to rewind (not reset)

There is still an issue with start, when
_session->transport_sample() is not zero. Ardour ends up
constantly locating, rolling for a short time and re-syncing
by locating again.
2023-02-19 18:19:18 +01:00
Robin Gareus 2c7f8eeb97
Indicate UTF8 literals - fixes glyph rendering with MSVC (1/2) 2023-01-16 21:41:09 +01:00
Paul Davis 0d9656ef82 use new macros to cleanup #ifndef NDEBUG as much as possible (libs edition) 2022-06-22 13:31:08 -06:00
Paul Davis f1a24fac98 fix optimized unused variable warning 2022-06-22 13:31:08 -06:00
Paul Davis 79763893b3 remove/hide Session::tempo_map() and use TempoMap::use() instead (thread local shared ptr) 2021-08-13 12:51:30 -06:00
Paul Davis f67029bd02 random commit to facilitate trivial move of work from laptop back to main system 2021-08-13 12:51:29 -06:00
Robin Gareus 7b5d61b7a5
Fix transport master crash when switching backends
Port registration happens asynchronously. During the first process
callbacks the timecode/clock input ports may not have been
re-established.
2021-06-27 16:37:33 +02:00
Robin Gareus 3e6295f538
Fix MIDI Clock slave
* take port latency into account
* fix DLL initialization, and initial speed calculation
* igonre out of bounds BPM

the DLL bandwidth still needs to be tweaked, likewise the
hardcoded 1st order LPF to track BPM (vs speed).
2020-05-27 23:59:27 +02:00
Robin Gareus 16f6e62249
Consolidate TansportMaster implementation
* share port_latency latency query for MTC and MIDIClock slaves
* propagate set_session()
* share session_connections for MasterViaMIDI

This is in preparation to allow MClk slave to access midi-port-latency
2020-05-27 23:40:09 +02:00
Robin Gareus fb203f3df8
Consolidate delta-string format, avoid markup 2020-05-12 14:59:44 +02:00
Paul Davis 7199b657ba no need for MidiClockTransportMaster::starting() method 2019-11-15 16:06:04 -07:00
Paul Davis bd229936ec add finite state machine to control/manage transport state 2019-09-17 18:26:03 -06:00
Robin Gareus a22f918d9d
Update libardour GPL boilerplate and (C) from git log 2019-08-03 15:53:16 +02:00
Paul Davis 3cc3074dc7 use ::reset() not ::update() 2019-02-04 11:24:23 -07:00
Paul Davis 1be3301342 new approach to handling Transport Masters when engine is restarted
Trust that ::reset() works for all transport masters, and call it when engine is stopped. This way
the transport masters are ready to be called again as soon as the engine restarts.
2019-01-25 09:23:08 -07:00
Paul Davis 970c8939d4 some rather simple code to allow MIDI Clock to set the tempo of the session.
This is only allowed if the session has only 1 tempo marker
2018-10-08 12:59:51 -04:00
Paul Davis f0a395e7cd stop MIDIClock transport master reporting continued timestamps 2018-10-05 14:15:02 -04:00
Paul Davis 22061310c0 add new ::update_interval() method for transport masters, and use in shared ::speed_and_position() implementation 2018-10-04 00:42:14 -04:00
Paul Davis c4fcd0c268 consolidate all transport masters on a SafeTime object that is a member of the TransportMaster base class.
This seems to have broken some aspects of chasing/locking
2018-09-27 11:31:13 -04:00
John Emmas a3a156520d Remove some namespace ambiguity
There are a couple of places where we're using both MIDI namespace as well as ARDOUR namespace (both of which declare 'pframes_t)
2018-09-22 08:48:41 +01:00
Paul Davis e6915e01de new transport slave/master implementation, libs/ edition 2018-09-18 19:06:04 -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
nick_m 33e95a1577 rename Tempo _beats_per_minute to _note_types_per_minute, provide pulse helpers.
- adds quarter_notes_per_minute(), note_divisions_per_minute (double)
	  pulses_per_minute() and frames_per_quarter_note()

	- this should be a no-op except for the use of tempo by
	  the vst callback which definitely uses quarter notes per minute.

	- the XML node for TempoSection named 'beats-per-minute'
	  has been renamed.
2016-11-11 03:37:08 +11: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 8f3bc6f809 Tempo ramps - rename tempo_at() -> tempo_at_frame().. 3 decimals for the audioclock tempo display. 2016-05-27 23:38:17 +10:00
nick_m 7898435d3f Tempo ramps - define_one_bar() delivers constant tempo.
- also some renaming and code review
2016-05-27 23:38:09 +10:00
nick_m 9eeccf0c17 Tempo ramps - port audio unit and midi clock slave.
- untested.
2016-05-27 23:38:09 +10:00
Paul Davis 3020b224fa Merge windows+cc branch into cairocanvas branch. Not finished, need to now merge windows branch to get changes from there 2014-01-10 16:07:57 -05:00
Hans Baier 611d1ffc29 midi_clock_slave: fix bandwidth to 2/60 for best results 2013-12-19 05:42:52 +07:00
Hans Baier caac41a9cb midi_clock_slave: fix wrong calculation of loop error
since transport_frame refers to cycle start, the should be position has
to account for position of the midi clock event.
2013-12-18 09:55:15 +07:00
Hans Baier bc5d23d5fa midi_clock_slave.cc: Better debug messages 2013-12-18 08:26:43 +07:00
Hans Baier d826de83ae midi clock slave: make bandwidth variable according to period size 2013-12-18 06:19:21 +07:00
Paul Davis bb826f4bee incomplete merge of master into windows (requires upcoming changes to master to be complete) 2013-09-12 11:28:50 -04:00
Paul Davis a5a75d5e0d fixes to get MTC (and probably MIDI clock) slaving working again
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-13 12:53:28 -04:00
Paul Davis 1ab61b8564 major redesign of MIDI port heirarchy and management (part 2) 2013-08-07 22:22:11 -04:00
John Emmas 490311bc08 'libs/ardour' - Main body of changes required for building with MSVC 2013-08-04 15:36:07 +01:00
Paul Davis 23bec25bf5 Remove non-portable and unnused header includes 2013-07-11 11:34:37 -04:00
Paul Davis 4be2176bd9 Revert "Remove non-portable and unnused header includes"
This reverts commit 7ef79d3f4b.
2013-07-11 11:23:41 -04:00
Paul Davis 7ef79d3f4b Remove non-portable and unnused header includes 2013-07-11 11:19:57 -04:00
Hans Baier 6f47365c0d midi_clock_slave.cc: report to ardour the delta that the loop sees (revert me if you object) 2013-04-05 13:17:13 +07:00
Hans Baier 5308c31767 make MIDI clock work once more:
* increase filter bandwith to make it sync faster
   * use transport_frame instead of audible_frame for calculating the loop error (thanks robin!)
   * reduce the deadzone to 0.1% (thanks robin)
2013-04-05 12:33:58 +07:00